Commit 537af213ca6a7540c3f4c4058e0b07986295cfae

Authored by ifac0
1 parent 7ece2fea

template create/remove/update/view de avaliacao #254

Showing 40 changed files with 530 additions and 330 deletions   Show diff stats
amadeus/staticfiles/js/modal_exam.js 0 → 100644
... ... @@ -0,0 +1,43 @@
  1 +//controles do modal
  2 +$(window).ready(function() { // utilizado para abrir o modal quando tiver tido algum erro no preenchimento do formulario
  3 + if($('.not_submited').length){
  4 + $('#exam').modal('show');
  5 + }
  6 +});
  7 +var Answer = {
  8 + init: function(url) { // utilizado para adicionar um novo campo de resposta
  9 + $.get(url, function(data){
  10 + $("#form").append(data);
  11 + var cont = 1;
  12 + $("#form div div div input").each(function(){
  13 + $(this).attr('name',cont++);
  14 + });
  15 + });
  16 + }
  17 +};
  18 +
  19 +var Submite = {
  20 + post: function(url,dados){
  21 + $('#exam').modal('hide');
  22 + $.post(url,dados, function(data){
  23 + }).fail(function(data){
  24 + $("div.modal-backdrop.fade.in").remove();
  25 + $("#modal_exam").empty();
  26 + $("#modal_exam").append(data.responseText);
  27 + });
  28 + },
  29 + remove: function(url,dados, id_li_link){
  30 + $('#exam').modal('hide');
  31 + $.post(url,dados, function(data){
  32 + $(id_li_link).remove();
  33 + $("#modal_exam").empty();
  34 + $("div.modal-backdrop.fade.in").remove();
  35 + }).fail(function(){
  36 + $("#modal_exam").empty();
  37 + $("#modal_exam").append(data);
  38 + $('#exam').modal('show');
  39 + });
  40 + }
  41 +}
  42 +
  43 +alert("essfd");
... ...
courses/templates/subject/exam_item_actions.html 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +{% load static i18n permission_tags professor_access %}
  2 +
  3 +<script src="{% static 'js/modals_requisitions.js'%}"></script>
  4 +<script src="{% static 'js/modal_exam.js'%}"></script>
  5 +
  6 +{% for exam in exams %}
  7 + {% professor_subject exam.topic.subject request.user as permission%}
  8 + {% if permission %}
  9 + <li id="exam_{{exam.slug}}"><i class="material-icons">{% trans 'exam' %}</i> <a href="javascript:modal.get('{% url 'course:exam:update_exam' exam.slug %}','#exam','#modal_exam');">{{ exam.name }}</a><a href="javascript:modal.get('{% url 'course:exam:delete_exam' exam.slug %}','#exam','#modal_exam');"><span class="glyphicon glyphicon-remove"></span></a></li>
  10 + {% else %}
  11 + <li id="exam_{{exam.slug}}"><i class="material-icons">{% trans 'exam' %}</i> <a href="javascript:modal.get('{% url 'course:exam:view_exam' exam.slug %}','#exam','#modal_exam');">{{ exam.name }}</a></li>
  12 + {% endif %}
  13 + {% endfor %}
  14 +{# <button class="btn btn-primary btn-raised" onclick="javascript:modal.get('{% url 'course:exam:create_exam' topic.slug%}','#exam','#modal_exam');">{% trans '+ Create Exam' %}</button> #}
  15 +<div class="row" id="modal_exam">
  16 +
  17 +
  18 +
  19 +
  20 +</div>
... ...
courses/templates/subject/form_view_teacher.html
... ... @@ -93,10 +93,12 @@
93 93 <ul class="dropdown-menu" aria-labelledby="dLabel">
94 94 <li><a href="javascript:createForum('{% url 'course:forum:create' %}', '{{ topic.id }}')">{% trans 'Create Forum' %}</a></li>
95 95 <li><a href="javascript:modal.get('{% url 'course:poll:create_poll' topic.slug%}','#poll','#modal_poll');">{% trans 'Create Poll' %}</a></li>
  96 + <li><a href="javascript:modal.get('{% url 'course:exam:create_exam' topic.slug%}','#exam','#modal_exam');">{% trans 'Create Exam' %}</a></li>
96 97 </ul>
97 98 </div>
98 99 </div>
99 100 <ul>
  101 + {% list_topic_exam request topic %}
100 102 {% list_topic_poll request topic %}
101 103 {% list_topic_foruns request topic %}
102 104 </ul>
... ...
courses/templates/subject/poll_item_actions.html
... ... @@ -3,6 +3,7 @@
3 3 <script src="{% static 'js/modals_requisitions.js'%}"></script>
4 4 <script src="{% static 'js/modal_poll.js'%}"></script>
5 5  
  6 +
6 7 {% for poll in polls %}
7 8 {% professor_subject poll.topic.subject request.user as permission%}
8 9 {% if permission %}
... ... @@ -14,4 +15,7 @@
14 15 {# <button class="btn btn-primary btn-raised" onclick="javascript:modal.get('{% url 'course:poll:create_poll' topic.slug%}','#poll','#modal_poll');">{% trans '+ Create Poll' %}</button> #}
15 16 <div class="row" id="modal_poll">
16 17  
  18 +
  19 +
  20 +
17 21 </div>
... ...
courses/templates/topic/topic_card_student.html
... ... @@ -6,11 +6,11 @@
6 6 <div class="resource_inline">
7 7 <h4>{% trans "Materials" %}</h4>
8 8 </div>
9   -
  9 +
10 10 <ul id="list-materials">
11 11 {% list_topic_file request topic %}
12 12 {% list_topic_link request topic%}
13   -
  13 +
14 14 </ul>
15 15 </div>
16 16 <div class="col-xs-4 col-md-4">
... ... @@ -19,10 +19,11 @@
19 19 </div>
20 20 <ul>
21 21 <div class="foruns_list">
  22 + {% list_topic_exam request topic %}
22 23 {% list_topic_poll request topic %}
23 24 {% list_topic_foruns request topic %}
24 25 </div>
25 26 </ul>
26 27 </div>
27   -
28   -</div>
29 28 \ No newline at end of file
  29 +
  30 +</div>
... ...
courses/templatetags/list_topic_foruns.py
... ... @@ -3,6 +3,7 @@ from django import template
3 3 from links.models import Link
4 4 from forum.models import Forum
5 5 from poll.models import Poll
  6 +from exam.models import Exam
6 7 from files.models import TopicFile
7 8 register = template.Library()
8 9  
... ... @@ -31,6 +32,17 @@ def list_topic_poll(request, topic):
31 32  
32 33 return context
33 34  
  35 +@register.inclusion_tag('subject/exam_item_actions.html')
  36 +def list_topic_exam(request, topic):
  37 + context = {
  38 + 'request': request,
  39 + }
  40 +
  41 + context['exams'] = Exam.objects.filter(topic = topic)
  42 + context['topic'] = topic
  43 +
  44 + return context
  45 +
34 46 @register.inclusion_tag('topic/list_file.html')
35 47 def list_topic_file(request, topic):
36 48 context = {
... ...
exam/templates/exam/create.html
1   -{% extends "base.html" %}
  1 +{# {% extends "topic/index.html" %} #}
2 2  
3   -{% load i18n %}
  3 +{% load i18n widget_tweaks dict_access static%}
4 4  
5   -{% block content %}
6   -<div class="panel panel-info">
7   - <div class="panel-heading">
8   - {% block title_poll %}
9   - <h1 class="panel-title">{% trans "New Exam" %}</h1>
10   - {% endblock title_poll %}
11   - </div>
12   - <div class="panel-body">
13   - <div class="row form-group">
14   - <label for="exam_name" class="col-md-2 control-label">{% trans "Exam Name" %}</label>
15   - <div class="col-md-10">
16   - <input type="text" name="exam_name" class="form-control" id="exam_name" placeholder="{% trans 'Exam Name' %}">
17   - </div>
18   - </div>
19   - <div class="row form-group">
20   - <label for="begin_date" class="col-md-2 control-label">{% trans "Exam's begin date" %}</label>
21   - <div class="col-md-10">
22   - <input type="date" name="begin_date" class="form-control" id="begin_date" placeholder='{% trans "Begin Date" %}'>
23   - </div>
24   - </div>
25   - <div class="row form-group">
26   - <label for="end_date" class="col-md-2 control-label">{% trans "Exam's end date" %}</label>
27   - <div class="col-md-10">
28   - <input type="text" name="end_date" class="form-control" id="end_date" placeholder='{% trans "End Date" %}'>
29   - </div>
30   - </div>
31   - <div class="row form-group">
32   - <div class="col-md-10">
33   - <div class="checkbox">
34   - <label>
35   - <input type="checkbox" name="checkbox"><span class="checkbox-material"><span class="check"></span></span> {% trans "Allow submissions after deadline?" %}
36   - </label>
37   - </div>
38   - </div>
39   - </div>
40   - <div class="row form-group" id="questions">
  5 +{# {% block style %} #}
  6 + <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  7 + <script src="{% static 'js/modal_exam.js' %}"></script>
41 8  
42   - </div>
43   - <div class="row form-group">
44   - <label for="questionType" class="col-md-2 control-label">{% trans "Question Type" %}</label>
45   - <div class="col-md-10">
46   - <select id="questionType" class="form-control" name="option_question" onchange="showDiv (this)">
47   - <option selected disabled>{% trans "Question Type" %}</option>
48   - <option value="0">{% trans "Multiple Choice" %}</option>
49   - <option value="1">{% trans "True or False" %}</option>
50   - <option value="2">{% trans "Gap Filling" %}</option>
51   - <option value="3">{% trans "Discursive Question" %}</option>
52   - </select>
  9 +{# {% endblock %} #}
  10 +
  11 +{# {% block content %} #}
  12 +<!-- Modal (remember to change the ids!!!) -->
  13 +<div class="modal fade" id="exam" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  14 + <div class="modal-dialog" role="document">
  15 + <div class="modal-content">
  16 +
  17 + <!-- Modal Header -->
  18 + <div class="modal-header">
  19 +
  20 + {% block title_exam %}
  21 + <!-- Put your title here!!! -->
  22 + <h4 class="modal-title" id="myModalLabel">{% trans "Create a Exam" %}</h4>
  23 + {% endblock title_exam %}
53 24 </div>
54   - </div>
55   - <div class="row">
56   - <div class="col-md-12">
57   - <button type="button" class="btn btn-primary btn-raised" id="add_question">{% trans "add question" %}</button>
  25 + <!-- Modal Body -->
  26 + <div class="modal-body">
  27 +
  28 + {% block content_exam %}
  29 +
  30 + <div class="panel-body">
  31 + <div class="row form-group">
  32 + <label for="exam_name" class="col-md-2 control-label">{% trans "Exam Name" %}</label>
  33 + <div class="col-md-10">
  34 + <input type="text" name="exam_name" class="form-control" id="exam_name" placeholder="{% trans 'Exam Name' %}">
  35 + </div>
  36 + </div>
  37 + <div class="row form-group">
  38 + <label for="begin_date" class="col-md-2 control-label">{% trans "Exam's begin date" %}</label>
  39 + <div class="col-md-10">
  40 + <input type="date" name="begin_date" class="form-control" id="begin_date" placeholder='{% trans "Begin Date" %}'>
  41 + </div>
  42 + </div>
  43 + <div class="row form-group">
  44 + <label for="end_date" class="col-md-2 control-label">{% trans "Exam's end date" %}</label>
  45 + <div class="col-md-10">
  46 + <input type="date" name="end_date" class="form-control" id="end_date" placeholder='{% trans "End Date" %}'>
  47 + </div>
  48 + </div>
  49 + <div class="row form-group">
  50 + <div class="col-md-10">
  51 + <div class="checkbox">
  52 + <label>
  53 + <input type="checkbox" name="checkbox"><span class="checkbox-material"><span class="check"></span></span> {% trans "Allow submissions after deadline?" %}
  54 + </label>
  55 + </div>
  56 + </div>
  57 + </div>
  58 + <div class="row form-group" id="questions">
  59 +
  60 + </div>
  61 + <div class="row form-group">
  62 + <label for="questionType" class="col-md-2 control-label">{% trans "Question Type" %}</label>
  63 + <div class="col-md-10">
  64 + <select id="questionType" class="form-control" name="option_question" onchange="showDiv (this)">
  65 + <option selected disabled>{% trans "Question Type" %}</option>
  66 + <option value="0">{% trans "Multiple Choice" %}</option>
  67 + <option value="1">{% trans "True or False" %}</option>
  68 + <option value="2">{% trans "Gap Filling" %}</option>
  69 + <option value="3">{% trans "Discursive Question" %}</option>
  70 + </select>
  71 + </div>
  72 + </div>
  73 + <!-- Modal Footer -->
  74 + <div class="modal-footer">
  75 +
  76 + <!-- Don't remove that!!! -->
  77 + <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button>
  78 + {% block button_save %}
  79 + <!-- Put curtom buttons here!!! -->
  80 + <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button>
  81 + {% endblock button_save %}
  82 + </div>
  83 +
  84 +
  85 + {% endblock content_exam %}
58 86 </div>
59 87 </div>
60 88 </div>
61   - <div class="panel-footer text-right">
62   - <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button>
63   - </div>
64 89 </div>
65   -<script>
  90 +{% block script_exam %}
  91 +<script type="text/javascript">
  92 +
66 93 var id = 1;
67 94 $("#add_question").click(function(){
68 95 $.get("{% url 'course:exam:true_or_false_question' %}", function(data){
... ... @@ -104,6 +131,10 @@ $(&#39;#tfAlternative&#39;).click(function () {
104 131 $(function() {
105 132 $( "#begin_date,#end_date" ).datepicker();
106 133 });
  134 +
107 135 </script>
  136 +{% endblock script_exam %}
  137 +{# <a href="" data-toggle="modal" data-target="#exam">modal</a> #}
  138 +
108 139  
109   -{% endblock content %}
  140 +{# {% endblock content %} #}
... ...
exam/templates/exam/discursive_question.html
... ... @@ -1,6 +0,0 @@
1   -<div class="form-group" id="discursiveQuestion">
2   - <label for="question" class="col-md-2 control-label">{% trans "Question" %}</label>
3   - <div class="col-md-10">
4   - <textarea class="form-control" rows="1" id="question" placeholder="{% trans 'Question' %}"></textarea>
5   - </div>
6   -</div>
exam/templates/exam/discursive_question.html.py
... ... @@ -1,6 +0,0 @@
1   -XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX
2   - XXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX
3   - XXXX XXXXXXXXXXXXXXXXXX
4   - XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Question') XXXXXXXXXXXXX
5   - XXXXXX
6   -XXXXXX
exam/templates/exam/gap_filling_answer.html
exam/templates/exam/gap_filling_answer.html.py
exam/templates/exam/gap_filling_question.html
... ... @@ -1,3 +0,0 @@
1   -<div class="form-group" id="gapFilling" style="display: none;">
2   - <p>{% trans 'Gap Filling Question' %}</p>
3   -</div>
exam/templates/exam/gap_filling_question.html.py
... ... @@ -1,3 +0,0 @@
1   -XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXX
2   - XXX gettext(u'Gap Filling Question') XXXX
3   -XXXXXX
exam/templates/exam/multiple_choice_answer.html
exam/templates/exam/multiple_choice_answer.html.py
exam/templates/exam/multiple_choice_question.html
... ... @@ -1,42 +0,0 @@
1   -{% load i18n %}
2   -
3   -<div class="form-group" id="multipleChoice">
4   -
5   - <label for="questionName" class="col-md-2 control-label">{% trans 'Question' %}</label>
6   -
7   -
8   - <div class="col-md-10">
9   - <textarea class="form-control" rows="1" id="questionName" placeholder="Wording"></textarea>
10   - </div>
11   -
12   -
13   -</div>
14   -<div class="form-group">
15   - <label for="alternative" class="col-md-2 control-label">{% trans 'Alternatives' %}</label>
16   - <div class="col-md-10" id="radios">
17   - <div class="radio radio-primary">
18   - <label>
19   - <input checked type="radio" name="alternatives" id="alternative1" value="1">
20   - <textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>
21   - </label>
22   - </div>
23   - <div class="radio radio-primary">
24   - <label>
25   - <input type="radio" name="alternatives" id="alternative2" value="2">
26   - <textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>
27   - </label>
28   - </div>
29   - </div>
30   -</div>
31   -<!-- new alternative button -->
32   -<div class="form-group">
33   - <div class="col-md-12 col-md-offset-2">
34   - <button type="button" class="btn btn-primary" id="newAlternative">{% trans 'New Alternative' %]</button>
35   - </div>
36   -</div>
37   -<div class="form-group">
38   - <div class="col-md-12 col-md-offset-2">
39   - <button type="submit" class="btn btn-primary">Save</button>
40   - <button type="cancel" class="btn btn-default">Cancel</button>
41   - </div>
42   -</div>
exam/templates/exam/multiple_choice_question.html.py
... ... @@ -1,42 +0,0 @@
1   -BBBB BBBB
2   -
3   -XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX
4   -
5   - XXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX
6   -
7   -
8   - XXXX XXXXXXXXXXXXXXXXXX
9   - XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
10   - XXXXXX
11   -
12   -
13   -XXXXXX
14   -XXXX XXXXXXXXXXXXXXXXXXX
15   - XXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Alternatives') XXXXXXXX
16   - XXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXX
17   - XXXX XXXXXXXXXXXX XXXXXXXXXXXXXXX
18   - XXXXXXX
19   - XXXXXX XXXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXX
20   - XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXX
21   - XXXXXXXX
22   - XXXXXX
23   - XXXX XXXXXXXXXXXX XXXXXXXXXXXXXXX
24   - XXXXXXX
25   - XXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXX
26   - XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXX
27   - XXXXXXXX
28   - XXXXXX
29   - XXXXXX
30   -XXXXXX
31   -XXXX XXX XXXXXXXXXXX XXXXXX XXX
32   -XXXX XXXXXXXXXXXXXXXXXXX
33   - XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
34   - XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX XXXX XXXXXXXXXXXX XXXXXXXXXXX
35   - XXXXXX
36   -XXXXXX
37   -XXXX XXXXXXXXXXXXXXXXXXX
38   - XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
39   - XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX
40   - XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX
41   - XXXXXX
42   -XXXXXX
exam/templates/exam/questions/discursive_question.html 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +<div class="form-group" id="discursiveQuestion">
  2 + <label for="question" class="col-md-2 control-label">{% trans "Question" %}</label>
  3 + <div class="col-md-10">
  4 + <textarea class="form-control" rows="1" id="question" placeholder="{% trans 'Question' %}"></textarea>
  5 + </div>
  6 +</div>
... ...
exam/templates/exam/questions/discursive_question.html.py 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX
  2 + XXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX
  3 + XXXX XXXXXXXXXXXXXXXXXX
  4 + XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Question') XXXXXXXXXXXXX
  5 + XXXXXX
  6 +XXXXXX
... ...
exam/templates/exam/questions/gap_filling_answer.html 0 → 100644
exam/templates/exam/questions/gap_filling_answer.html.py 0 → 100644
exam/templates/exam/questions/gap_filling_question.html 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +<div class="form-group" id="gapFilling" style="display: none;">
  2 + <p>{% trans 'Gap Filling Question' %}</p>
  3 +</div>
... ...
exam/templates/exam/questions/gap_filling_question.html.py 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXX
  2 + XXX gettext(u'Gap Filling Question') XXXX
  3 +XXXXXX
... ...
exam/templates/exam/questions/multiple_choice_answer.html 0 → 100644
exam/templates/exam/questions/multiple_choice_answer.html.py 0 → 100644
exam/templates/exam/questions/multiple_choice_question.html 0 → 100644
... ... @@ -0,0 +1,42 @@
  1 +{% load i18n %}
  2 +
  3 +<div class="form-group" id="multipleChoice">
  4 +
  5 + <label for="questionName" class="col-md-2 control-label">{% trans 'Question' %}</label>
  6 +
  7 +
  8 + <div class="col-md-10">
  9 + <textarea class="form-control" rows="1" id="questionName" placeholder="Wording"></textarea>
  10 + </div>
  11 +
  12 +
  13 +</div>
  14 +<div class="form-group">
  15 + <label for="alternative" class="col-md-2 control-label">{% trans 'Alternatives' %}</label>
  16 + <div class="col-md-10" id="radios">
  17 + <div class="radio radio-primary">
  18 + <label>
  19 + <input checked type="radio" name="alternatives" id="alternative1" value="1">
  20 + <textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>
  21 + </label>
  22 + </div>
  23 + <div class="radio radio-primary">
  24 + <label>
  25 + <input type="radio" name="alternatives" id="alternative2" value="2">
  26 + <textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>
  27 + </label>
  28 + </div>
  29 + </div>
  30 +</div>
  31 +<!-- new alternative button -->
  32 +<div class="form-group">
  33 + <div class="col-md-12 col-md-offset-2">
  34 + <button type="button" class="btn btn-primary" id="newAlternative">{% trans 'New Alternative' %]</button>
  35 + </div>
  36 +</div>
  37 +<div class="form-group">
  38 + <div class="col-md-12 col-md-offset-2">
  39 + <button type="submit" class="btn btn-primary">Save</button>
  40 + <button type="cancel" class="btn btn-default">Cancel</button>
  41 + </div>
  42 +</div>
... ...
exam/templates/exam/questions/multiple_choice_question.html.py 0 → 100644
... ... @@ -0,0 +1,42 @@
  1 +BBBB BBBB
  2 +
  3 +XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX
  4 +
  5 + XXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX
  6 +
  7 +
  8 + XXXX XXXXXXXXXXXXXXXXXX
  9 + XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  10 + XXXXXX
  11 +
  12 +
  13 +XXXXXX
  14 +XXXX XXXXXXXXXXXXXXXXXXX
  15 + XXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Alternatives') XXXXXXXX
  16 + XXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXX
  17 + XXXX XXXXXXXXXXXX XXXXXXXXXXXXXXX
  18 + XXXXXXX
  19 + XXXXXX XXXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXX
  20 + XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXX
  21 + XXXXXXXX
  22 + XXXXXX
  23 + XXXX XXXXXXXXXXXX XXXXXXXXXXXXXXX
  24 + XXXXXXX
  25 + XXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXX
  26 + XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXX
  27 + XXXXXXXX
  28 + XXXXXX
  29 + XXXXXX
  30 +XXXXXX
  31 +XXXX XXX XXXXXXXXXXX XXXXXX XXX
  32 +XXXX XXXXXXXXXXXXXXXXXXX
  33 + XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
  34 + XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX XXXX XXXXXXXXXXXX XXXXXXXXXXX
  35 + XXXXXX
  36 +XXXXXX
  37 +XXXX XXXXXXXXXXXXXXXXXXX
  38 + XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
  39 + XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX
  40 + XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX
  41 + XXXXXX
  42 +XXXXXX
... ...
exam/templates/exam/questions/true_or_false_answer.html 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +{% load i18n %}
  2 +
  3 +<div class="row form-group" >
  4 + <div class="col-md-1">
  5 + </br>
  6 + <label><span class="glyphicon glyphicon-move"></span></label>
  7 + </div>
  8 + <div class="col-md-10">
  9 + <input class="form-control" placeholder='{% trans "Write your alternative" %}'></input>
  10 + </div>
  11 + <div class="col-md-1">
  12 + </br>
  13 + <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label>
  14 + </div>
  15 +</div>
... ...
exam/templates/exam/questions/true_or_false_answer.html.py 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +BBBB BBBB
  2 +
  3 +XXXX XXXXXXXXXX XXXXXXXXXXX X
  4 + XXXX XXXXXXXXXXXXXXXXX
  5 + XXXXX
  6 + XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  7 + XXXXXX
  8 + XXXX XXXXXXXXXXXXXXXXXX
  9 + XXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Write your alternative') XXXXXXXXXX
  10 + XXXXXX
  11 + XXXX XXXXXXXXXXXXXXXXX
  12 + XXXXX
  13 + XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  14 + XXXXXX
  15 +XXXXXX
... ...
exam/templates/exam/questions/true_or_false_question.html 0 → 100644
... ... @@ -0,0 +1,67 @@
  1 +{# {% extends "base.html" %} #}
  2 +
  3 +{% load i18n %}
  4 +{# {% block content %} #}
  5 +<style>
  6 + .glyphicon-remove:hover {
  7 + cursor: pointer;
  8 + }
  9 + .glyphicon-move:hover {
  10 + cursor: move;
  11 + }
  12 +</style>
  13 +<div class="" id="0">
  14 + <div class="row form-group">
  15 + <div class="col-md-1">
  16 + </br>
  17 + <label><span class="glyphicon glyphicon-move"></span></label>
  18 + </div>
  19 + <div class="col-md-2">
  20 + <label for="questionName" class="control-label">{% trans "Question" %}</label>
  21 + </div>
  22 + <div class="col-md-9">
  23 + <div class="row">
  24 + <div class="col-md-11">
  25 + <input class="form-control" id="questionName" placeholder="{% trans 'Question' %}"></input>
  26 + </div>
  27 + <div class="col-md-1">
  28 + </br>
  29 + <label><span class="glyphicon glyphicon-remove"></span></label>
  30 + </div>
  31 + </div>
  32 + </div>
  33 +
  34 + </div>
  35 + <div class="row">
  36 + <div class="col-md-offset-1 col-md-2">
  37 + <label class="control-label">{% trans "Alternatives: T/F" %}</label>
  38 + </div>
  39 + <div class="col-md-9" id="radiosTF">
  40 + {% include "exam/true_or_false_answer.html" %}
  41 + </div>
  42 + </div>
  43 + <div class="form-group">
  44 + <div class="col-md-9 col-md-offset-3">
  45 + <button type="button" class="btn btn-primary btn-raised" id="new_alternative">{% trans "New Alternative" %}</button>
  46 + </div>
  47 + </div>
  48 +</div>
  49 +<script type="text/javascript">
  50 + $("#new_alternative").click(function(){
  51 + $.get("{% url 'course:exam:true_or_false_answer' %}", function(data){
  52 + $("#radiosTF").append(data);
  53 + });
  54 + });
  55 + //deve ser importado apenas depois do html
  56 + $( "#radiosTF" ).sortable({ // utilizado para fazer a re-organização das respostas
  57 + delay: 100,
  58 + distance: 5,
  59 + update: function( event, ui ) {
  60 + var cont = 1;
  61 + $("#radiosTF div div input").each(function(){
  62 + $(this).attr('name',cont++);
  63 + });
  64 + },
  65 + });
  66 +</script>
  67 +{# {% endblock content %} #}
... ...
exam/templates/exam/questions/true_or_false_question.html.py 0 → 100644
... ... @@ -0,0 +1,67 @@
  1 +
  2 +
  3 +BBBB BBBB
  4 +
  5 +XXXXXXX
  6 + XXXXXXXXXXXXXXXXXXXXXXX X
  7 + XXXXXXX XXXXXXXX
  8 + X
  9 + XXXXXXXXXXXXXXXXXXXXX X
  10 + XXXXXXX XXXXX
  11 + X
  12 +XXXXXXXX
  13 +XXXX XXXXXXXX XXXXXXX
  14 + XXXX XXXXXXXXXX XXXXXXXXXXXX
  15 + XXXX XXXXXXXXXXXXXXXXX
  16 + XXXXX
  17 + XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  18 + XXXXXX
  19 + XXXX XXXXXXXXXXXXXXXXX
  20 + XXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX
  21 + XXXXXX
  22 + XXXX XXXXXXXXXXXXXXXXX
  23 + XXXX XXXXXXXXXXXX
  24 + XXXX XXXXXXXXXXXXXXXXXX
  25 + XXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Question') XXXXXXXXXX
  26 + XXXXXX
  27 + XXXX XXXXXXXXXXXXXXXXX
  28 + XXXXX
  29 + XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  30 + XXXXXX
  31 + XXXXXX
  32 + XXXXXX
  33 +
  34 + XXXXXX
  35 + XXXX XXXXXXXXXXXX
  36 + XXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX
  37 + XXXXXX XXXXXXXXXXXXXXXXXXXXXX gettext(u'Alternatives: T/F') XXXXXXXX
  38 + XXXXXX
  39 + XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX
  40 + BBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
  41 + XXXXXX
  42 + XXXXXX
  43 + XXXX XXXXXXXXXXXXXXXXXXX
  44 + XXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
  45 + XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX gettext(u'New Alternative') XXXXXXXXX
  46 + XXXXXX
  47 + XXXXXX
  48 +XXXXXX
  49 +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXX
  50 + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  51 + XXXXXXXBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBXX XXXXXXXXXXXXXXX
  52 + XXXXXXXXXXXXXXXXXXXXXXXXXXXX
  53 + XXX
  54 + XXX
  55 + XXXXXX XXX XXXXXXXXX XXXXXX XXXXXX XX XXXX
  56 + XX XXXXXXXXXXX XXXXXXXXXXXX XX XXXXXXXXX XXXX XXXXX X XXXXXXXXXXXXXX XXX XXXXXXXXX
  57 + XXXXXX XXXX
  58 + XXXXXXXXX XX
  59 + XXXXXXX XXXXXXXXX XXXXXX XX X X
  60 + XXX XXXX X XX
  61 + XXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXXXXXXXXXXXX
  62 + XXXXXXXXXXXXXXXXXXXXXXXXXXXX
  63 + XXX
  64 + XX
  65 + XXX
  66 +XXXXXXXXX
  67 +
... ...
exam/templates/exam/remove.html
... ... @@ -0,0 +1,27 @@
  1 +{% extends "exam/create.html" %}
  2 +
  3 +{% load i18n static%}
  4 +
  5 +{% block title_exam %}
  6 +<!-- Put your title here!!! -->
  7 +<h4 class="modal-title" id="myModalLabel">{% trans "Delete Exam" %}</h4>
  8 +{% endblock title_exam %}
  9 +
  10 +{% block content_exam %}
  11 +<script src="{% static 'js/modal_exam.js' %}"></script>
  12 +<!-- Put ONLY your content here!!! -->
  13 +<form id="delete_form" action="" method="post">
  14 + {% csrf_token %}
  15 + <p>{% trans 'Are you sure you want to delete the subject' %} "{{exam.name}}"?</p>
  16 +</form>
  17 +{% endblock content_exam %}
  18 +
  19 +{% block button_save %}
  20 +<button type="submite" id="button" form="delete_form" class="btn btn-primary btn-raised">{% trans "Delete" %}</button>
  21 +<script>
  22 + $("#delete_form").submit(function(event) {
  23 + Submite.remove("{% url 'course:exam:delete_exam' exam.slug %}",$(this).serialize(),"#exam_{{exam.slug}}");
  24 + event.preventDefault();
  25 + });
  26 +</script>
  27 +{% endblock button_save %}
... ...
exam/templates/exam/true_or_false_answer.html
... ... @@ -1,15 +0,0 @@
1   -{% load i18n %}
2   -
3   -<div class="row form-group" >
4   - <div class="col-md-1">
5   - </br>
6   - <label><span class="glyphicon glyphicon-move"></span></label>
7   - </div>
8   - <div class="col-md-10">
9   - <input class="form-control" placeholder='{% trans "Write your alternative" %}'></input>
10   - </div>
11   - <div class="col-md-1">
12   - </br>
13   - <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label>
14   - </div>
15   -</div>
exam/templates/exam/true_or_false_answer.html.py
... ... @@ -1,15 +0,0 @@
1   -BBBB BBBB
2   -
3   -XXXX XXXXXXXXXX XXXXXXXXXXX X
4   - XXXX XXXXXXXXXXXXXXXXX
5   - XXXXX
6   - XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7   - XXXXXX
8   - XXXX XXXXXXXXXXXXXXXXXX
9   - XXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Write your alternative') XXXXXXXXXX
10   - XXXXXX
11   - XXXX XXXXXXXXXXXXXXXXX
12   - XXXXX
13   - XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
14   - XXXXXX
15   -XXXXXX
exam/templates/exam/true_or_false_question.html
... ... @@ -1,67 +0,0 @@
1   -{# {% extends "base.html" %} #}
2   -
3   -{% load i18n %}
4   -{# {% block content %} #}
5   -<style>
6   - .glyphicon-remove:hover {
7   - cursor: pointer;
8   - }
9   - .glyphicon-move:hover {
10   - cursor: move;
11   - }
12   -</style>
13   -<div class="" id="0">
14   - <div class="row form-group">
15   - <div class="col-md-1">
16   - </br>
17   - <label><span class="glyphicon glyphicon-move"></span></label>
18   - </div>
19   - <div class="col-md-2">
20   - <label for="questionName" class="control-label">{% trans "Question" %}</label>
21   - </div>
22   - <div class="col-md-9">
23   - <div class="row">
24   - <div class="col-md-11">
25   - <input class="form-control" id="questionName" placeholder="{% trans 'Question' %}"></input>
26   - </div>
27   - <div class="col-md-1">
28   - </br>
29   - <label><span class="glyphicon glyphicon-remove"></span></label>
30   - </div>
31   - </div>
32   - </div>
33   -
34   - </div>
35   - <div class="row">
36   - <div class="col-md-offset-1 col-md-2">
37   - <label class="control-label">{% trans "Alternatives: T/F" %}</label>
38   - </div>
39   - <div class="col-md-9" id="radiosTF">
40   - {% include "exam/true_or_false_answer.html" %}
41   - </div>
42   - </div>
43   - <div class="form-group">
44   - <div class="col-md-9 col-md-offset-3">
45   - <button type="button" class="btn btn-primary btn-raised" id="new_alternative">{% trans "New Alternative" %}</button>
46   - </div>
47   - </div>
48   -</div>
49   -<script type="text/javascript">
50   - $("#new_alternative").click(function(){
51   - $.get("{% url 'course:exam:true_or_false_answer' %}", function(data){
52   - $("#radiosTF").append(data);
53   - });
54   - });
55   - //deve ser importado apenas depois do html
56   - $( "#radiosTF" ).sortable({ // utilizado para fazer a re-organização das respostas
57   - delay: 100,
58   - distance: 5,
59   - update: function( event, ui ) {
60   - var cont = 1;
61   - $("#radiosTF div div input").each(function(){
62   - $(this).attr('name',cont++);
63   - });
64   - },
65   - });
66   -</script>
67   -{# {% endblock content %} #}
exam/templates/exam/true_or_false_question.html.py
... ... @@ -1,67 +0,0 @@
1   -
2   -
3   -BBBB BBBB
4   -
5   -XXXXXXX
6   - XXXXXXXXXXXXXXXXXXXXXXX X
7   - XXXXXXX XXXXXXXX
8   - X
9   - XXXXXXXXXXXXXXXXXXXXX X
10   - XXXXXXX XXXXX
11   - X
12   -XXXXXXXX
13   -XXXX XXXXXXXX XXXXXXX
14   - XXXX XXXXXXXXXX XXXXXXXXXXXX
15   - XXXX XXXXXXXXXXXXXXXXX
16   - XXXXX
17   - XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
18   - XXXXXX
19   - XXXX XXXXXXXXXXXXXXXXX
20   - XXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX
21   - XXXXXX
22   - XXXX XXXXXXXXXXXXXXXXX
23   - XXXX XXXXXXXXXXXX
24   - XXXX XXXXXXXXXXXXXXXXXX
25   - XXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Question') XXXXXXXXXX
26   - XXXXXX
27   - XXXX XXXXXXXXXXXXXXXXX
28   - XXXXX
29   - XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
30   - XXXXXX
31   - XXXXXX
32   - XXXXXX
33   -
34   - XXXXXX
35   - XXXX XXXXXXXXXXXX
36   - XXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX
37   - XXXXXX XXXXXXXXXXXXXXXXXXXXXX gettext(u'Alternatives: T/F') XXXXXXXX
38   - XXXXXX
39   - XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX
40   - BBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
41   - XXXXXX
42   - XXXXXX
43   - XXXX XXXXXXXXXXXXXXXXXXX
44   - XXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
45   - XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX gettext(u'New Alternative') XXXXXXXXX
46   - XXXXXX
47   - XXXXXX
48   -XXXXXX
49   -XXXXXXX XXXXXXXXXXXXXXXXXXXXXXX
50   - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
51   - XXXXXXXBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBXX XXXXXXXXXXXXXXX
52   - XXXXXXXXXXXXXXXXXXXXXXXXXXXX
53   - XXX
54   - XXX
55   - XXXXXX XXX XXXXXXXXX XXXXXX XXXXXX XX XXXX
56   - XX XXXXXXXXXXX XXXXXXXXXXXX XX XXXXXXXXX XXXX XXXXX X XXXXXXXXXXXXXX XXX XXXXXXXXX
57   - XXXXXX XXXX
58   - XXXXXXXXX XX
59   - XXXXXXX XXXXXXXXX XXXXXX XX X X
60   - XXX XXXX X XX
61   - XXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXXXXXXXXXXXX
62   - XXXXXXXXXXXXXXXXXXXXXXXXXXXX
63   - XXX
64   - XX
65   - XXX
66   -XXXXXXXXX
67   -
exam/templates/exam/update.html
... ... @@ -0,0 +1,32 @@
  1 +{% extends "exam/create.html" %}
  2 +
  3 +{% load i18n dict_access static%}
  4 +
  5 +{% block title_exam %}
  6 +<!-- Put your title here!!! -->
  7 +<h4 class="modal-title" id="myModalLabel">{% trans "Update a Exam" %}</h4>
  8 +{% endblock title_exam %}
  9 +
  10 +{% block button_save %}
  11 +<!-- Put curtom buttons here!!! -->
  12 +<button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Update" %}</button>
  13 +{% endblock button_save %}
  14 +
  15 +{% block script_exam %}
  16 +<script type="text/javascript">
  17 + var locale = navigator.language || navigator.userLanguage;
  18 +
  19 + $('.date-picker').datepicker({
  20 + language: locale,
  21 + });
  22 +// Este js tem que ficar aqui se não o button add não vai funcionar
  23 + $("#add").click(function (){
  24 + Answer.init('{% url "course:exam:answer_exam" %}');
  25 + });
  26 +
  27 + $("#form").submit(function(event) {
  28 + Submite.post("{% url 'course:exam:update_exam' exam.slug %}",$(this).serialize());
  29 + event.preventDefault();
  30 + });
  31 +</script>
  32 +{% endblock script_exam %}
... ...
exam/templates/exam/view.html
... ... @@ -0,0 +1,28 @@
  1 +{% extends "exam/create.html" %}
  2 +
  3 +{% load i18n dict_access static%}
  4 +
  5 +{% block style %}
  6 +{% endblock %}
  7 +
  8 +{% block title_exam %}
  9 +<!-- Put your title here!!! -->
  10 +<h4 class="modal-title" id="myModalLabel">{{exam.name}}</h4>
  11 +{% endblock title_exam %}
  12 +
  13 +{% block content_exam %}
  14 +<!-- Put ONLY your content here!!! -->
  15 +<div class="row">
  16 + <div class="col-md-10 col-md-offset-1">
  17 + <p>{% trans "Limit date:" %} {{exam.limit_date|date:'d/m/y'}}</p>
  18 + </div>
  19 +
  20 +</div>
  21 +{% endblock content_exam %}
  22 +
  23 +{% block button_save %}
  24 +<!-- Put curtom buttons here!!! -->
  25 +{% if not status %}
  26 +<button type="button" onclick="javascript:modal.get('{% url 'course:exam:answer_student_exam' exam.slug%}','#exam','#modal_exam');$('div.modal-backdrop.fade.in').remove();" class="btn btn-primary btn-raised">{% trans "Answer" %}</button>
  27 +{% endif %}
  28 +{% endblock button_save %}
... ...
exam/views.py
... ... @@ -76,7 +76,7 @@ class CreateExam(LoginRequiredMixin,HasRoleMixin, NotificationMixin,generic.Crea
76 76 self.object.save()
77 77  
78 78 super(CreateExam, self).createNotification(message="created an Exam "+ self.object.name, actor=self.request.user,
79   - resource_name=self.object.name, resource_link= reverse('course:exam:view_exam', args=[self.object.slug]),
  79 + resource_name=self.object.name, resource_link= reverse('course:exam:view_exam', args=[self.object.slug]),
80 80 users=self.object.topic.subject.students.all())
81 81 for key in self.request.POST:
82 82 if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'):
... ...
poll/templates/poll/create.html
... ... @@ -151,7 +151,7 @@
151 151 <div class="modal-footer">
152 152  
153 153 <!-- Don't remove that!!! -->
154   - <button type="button" class="btn btn-default btn-raised" data-dismiss="modal">{% trans "Close" %}</button>
  154 + <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button>
155 155 {% block button_save %}
156 156 <!-- Put curtom buttons here!!! -->
157 157 <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button>
... ...