Commit 98ca47818dacc5f40d55d4ac3fc660ddaf11e773
Exists in
master
and in
5 other branches
Merge branch 'dev' of https://github.com/amadeusproject/amadeuslms into dev
Showing
7 changed files
with
188 additions
and
91 deletions
Show diff stats
app/templates/admin_settings.html
@@ -17,32 +17,34 @@ | @@ -17,32 +17,34 @@ | ||
17 | </div> | 17 | </div> |
18 | {% endfor %} | 18 | {% endfor %} |
19 | <!-- Nav tabs --> | 19 | <!-- Nav tabs --> |
20 | + | ||
20 | <ul class="nav nav-tabs md-pills pills-ins" role="tablist"> | 21 | <ul class="nav nav-tabs md-pills pills-ins" role="tablist"> |
22 | + {% if form.safe_conection.errors or form.host.errors or form.default_from_email.errors %} | ||
23 | + <li class="nav-item"> | ||
24 | + <a class="nav-link {% if page == 'system' %}active{% endif %}" data-toggle="tab" href="#system" role="tab"><i class="fa fa-cog"></i> {% trans "System" %}</a> | ||
25 | + </li> | ||
26 | + <li class="nav-item"> | ||
27 | + <a class="nav-link {% if page == 'mail_sender' %}active{% endif %}" data-toggle="tab" href="#mail_sender" role="tab"><i class="fa fa-envelope"></i> {% trans "Mail Sender" %}</a> | ||
28 | + </li> | ||
29 | + {% else %} | ||
30 | + <li class="nav-item"> | ||
31 | + <a class="nav-link {% if page == 'system' %}active{% endif %}" data-toggle="tab" href="#system" role="tab"><i class="fa fa-cog"></i> {% trans "System" %}</a> | ||
32 | + <li class="nav-item"> | ||
33 | + <a class="nav-link {% if page == 'mail_sender' %}active{% endif %}" data-toggle="tab" href="#mail_sender" role="tab"><i class="fa fa-envelope"></i> {% trans "Mail Sender" %}</a> | ||
34 | + </li> | ||
35 | + {% endif %} | ||
21 | <li class="nav-item"> | 36 | <li class="nav-item"> |
22 | - {% if form.safe_conection.errors or form.host.errors or form.default_from_email.errors %} | ||
23 | - <a class="nav-link" data-toggle="tab" href="#panel1" role="tab"><i class="fa fa-cog"></i> {% trans "System" %}</a> | ||
24 | - </li> | ||
25 | - <li class="nav-item"> | ||
26 | - <a class="nav-link active" data-toggle="tab" href="#panel2" role="tab"><i class="fa fa-envelope"></i> {% trans "Mail Sender" %}</a> | 37 | + <a class="nav-link {% if page == 'security' %}active{% endif %}" data-toggle="tab" href="#security" role="tab"><i class="fa fa-lock"></i> {% trans "Security" %}</a> |
27 | </li> | 38 | </li> |
28 | - {% else %} | ||
29 | - <a class="nav-link active" data-toggle="tab" href="#panel1" role="tab"><i class="fa fa-cog"></i> {% trans "System" %}</a> | ||
30 | -<li class="nav-item"> | ||
31 | - <a class="nav-link" data-toggle="tab" href="#panel2" role="tab"><i class="fa fa-envelope"></i> {% trans "Mail Sender" %}</a> | ||
32 | -</li> | ||
33 | -{% endif %} | ||
34 | -<li class="nav-item"> | ||
35 | - <a class="nav-link" data-toggle="tab" href="#panel3" role="tab"><i class="fa fa-lock"></i> {% trans "Security" %}</a> | ||
36 | -</li> | ||
37 | </ul> | 39 | </ul> |
38 | 40 | ||
39 | <!-- Tab panels --> | 41 | <!-- Tab panels --> |
40 | <div class="tab-content"> | 42 | <div class="tab-content"> |
41 | <!--Panel 1--> | 43 | <!--Panel 1--> |
42 | {% if form.errors %} | 44 | {% if form.errors %} |
43 | - <div class="tab-pane fade" id="panel1" role="tabpanel"> | 45 | + <div class="tab-pane fade" id="system" role="tabpanel"> |
44 | {% else %} | 46 | {% else %} |
45 | - <div class="tab-pane fade in active" id="panel1" role="tabpanel"> | 47 | + <div class="tab-pane fade {% if page == 'system' %}in active{% endif %}" id="system" role="tabpanel"> |
46 | {% endif %} | 48 | {% endif %} |
47 | <div class="panel panel-default"> | 49 | <div class="panel panel-default"> |
48 | <div class="panel-body"> | 50 | <div class="panel-body"> |
@@ -60,10 +62,10 @@ | @@ -60,10 +62,10 @@ | ||
60 | 62 | ||
61 | <!--Panel 2--> | 63 | <!--Panel 2--> |
62 | {% if form.errors %} | 64 | {% if form.errors %} |
63 | - <div class="tab-pane fade in active" id="panel2" role="tabpanel"> | 65 | + <div class="tab-pane fade in active" id="mail_sender" role="tabpanel"> |
64 | {% else %} | 66 | {% else %} |
65 | - <div class="tab-pane fade" id="panel2" role="tabpanel"> | ||
66 | - {% endif %} | 67 | + <div class="tab-pane fade {% if page == 'mail_sender' %}in active{% endif %}" id="mail_sender" role="tabpanel"> |
68 | + {% endif %} | ||
67 | <div class="panel panel-default"> | 69 | <div class="panel panel-default"> |
68 | <form class="form-horizontal" method="post"> | 70 | <form class="form-horizontal" method="post"> |
69 | {% csrf_token %} | 71 | {% csrf_token %} |
@@ -252,7 +254,7 @@ | @@ -252,7 +254,7 @@ | ||
252 | <!--/.Panel 2--> | 254 | <!--/.Panel 2--> |
253 | 255 | ||
254 | <!--Panel 3--> | 256 | <!--Panel 3--> |
255 | - <div class="tab-pane fade" id="panel3" role="tabpanel"> | 257 | + <div class="tab-pane fade {% if page == 'security' %}in active{% endif %}" id="security" role="tabpanel"> |
256 | <div class="panel panel-default"> | 258 | <div class="panel panel-default"> |
257 | <div class="panel-body"> | 259 | <div class="panel-body"> |
258 | <div class="togglebutton"> | 260 | <div class="togglebutton"> |
app/templates/home.html
@@ -110,9 +110,9 @@ | @@ -110,9 +110,9 @@ | ||
110 | <a href="#menu_settings" class="accordion" data-toggle="collapse">{% trans 'Settings' %}<span class="pull-right glyphicon glyphicon-chevron-down"></span></a> | 110 | <a href="#menu_settings" class="accordion" data-toggle="collapse">{% trans 'Settings' %}<span class="pull-right glyphicon glyphicon-chevron-down"></span></a> |
111 | <div id="menu_settings" class="collapse"> | 111 | <div id="menu_settings" class="collapse"> |
112 | <ul class="nav nav-pill nav-stacked accordion_list"> | 112 | <ul class="nav nav-pill nav-stacked accordion_list"> |
113 | - <li> <a href="{% url 'app:settings' %}">{% trans "System" %}</a></li> | ||
114 | - <li> <a href="{% url 'app:settings' %}">{% trans "Mail Sender" %}</a></li> | ||
115 | - <li> <a href="{% url 'app:settings' %}">{% trans "Security" %}</a></li> | 113 | + <li> <a href="{% url 'app:settings' page='system' %}">{% trans "System" %}</a></li> |
114 | + <li> <a href="{% url 'app:settings' page='mail_sender' %}">{% trans "Mail Sender" %}</a></li> | ||
115 | + <li> <a href="{% url 'app:settings' page='security' %}">{% trans "Security" %}</a></li> | ||
116 | </ul> | 116 | </ul> |
117 | </div> | 117 | </div> |
118 | </li> | 118 | </li> |
app/urls.py
@@ -4,5 +4,5 @@ from . import views | @@ -4,5 +4,5 @@ from . import views | ||
4 | 4 | ||
5 | urlpatterns = [ | 5 | urlpatterns = [ |
6 | url(r'^$', views.AppIndex.as_view(), name='index'), | 6 | url(r'^$', views.AppIndex.as_view(), name='index'), |
7 | - url(r'^settings/$', views.AmadeusSettings.as_view(), name='settings'), | 7 | + url(r'^settings/(?P<page>[\w_-]+)/$', views.AmadeusSettings.as_view(), name='settings'), |
8 | ] | 8 | ] |
app/views.py
@@ -51,7 +51,10 @@ class AmadeusSettings(LoginRequiredMixin, HasRoleMixin, generic.CreateView): | @@ -51,7 +51,10 @@ class AmadeusSettings(LoginRequiredMixin, HasRoleMixin, generic.CreateView): | ||
51 | model = EmailBackend | 51 | model = EmailBackend |
52 | template_name = 'admin_settings.html' | 52 | template_name = 'admin_settings.html' |
53 | form_class = EmailBackendForm | 53 | form_class = EmailBackendForm |
54 | - success_url = reverse_lazy('app:settings') | 54 | + #success_url = reverse_lazy('app:settings') |
55 | + | ||
56 | + def get_success_url(self): | ||
57 | + return reverse_lazy('app:settings', kwargs = {'page': self.kwargs['page']}) | ||
55 | 58 | ||
56 | def form_invalid(self, form): | 59 | def form_invalid(self, form): |
57 | return self.render_to_response(self.get_context_data(form=form)) | 60 | return self.render_to_response(self.get_context_data(form=form)) |
@@ -75,6 +78,7 @@ class AmadeusSettings(LoginRequiredMixin, HasRoleMixin, generic.CreateView): | @@ -75,6 +78,7 @@ class AmadeusSettings(LoginRequiredMixin, HasRoleMixin, generic.CreateView): | ||
75 | 78 | ||
76 | def get_context_data(self, **kwargs): | 79 | def get_context_data(self, **kwargs): |
77 | context = super(AmadeusSettings, self).get_context_data(**kwargs) | 80 | context = super(AmadeusSettings, self).get_context_data(**kwargs) |
81 | + context['page'] = self.kwargs.get('page') | ||
78 | if not self.request.method == 'POST': | 82 | if not self.request.method == 'POST': |
79 | try: | 83 | try: |
80 | setting = EmailBackend.objects.latest('id') | 84 | setting = EmailBackend.objects.latest('id') |
courses/templates/subject/form_view_teacher.html
@@ -103,6 +103,7 @@ | @@ -103,6 +103,7 @@ | ||
103 | <li><a href="javascript:createForum('{% url 'course:forum:create' %}', '{{ topic.id }}')">{% trans 'Create Forum' %}</a></li> | 103 | <li><a href="javascript:createForum('{% url 'course:forum:create' %}', '{{ topic.id }}')">{% trans 'Create Forum' %}</a></li> |
104 | <li><a href="javascript:modal.get('{% url 'course:poll:create_poll' topic.slug%}','#poll','#requisicoes_ajax');">{% trans 'Create Poll' %}</a></li> | 104 | <li><a href="javascript:modal.get('{% url 'course:poll:create_poll' topic.slug%}','#poll','#requisicoes_ajax');">{% trans 'Create Poll' %}</a></li> |
105 | <li><a href="javascript:modal.get('{% url 'course:exercise:create_exercise' topic.slug %}', '#createExercisesModal','#requisicoes_ajax')">{% trans 'Delivery Material' %}</a></li> | 105 | <li><a href="javascript:modal.get('{% url 'course:exercise:create_exercise' topic.slug %}', '#createExercisesModal','#requisicoes_ajax')">{% trans 'Delivery Material' %}</a></li> |
106 | + <li><a href="javascript:modal.get('{% url 'course:exam:create_exam' topic.slug%}','#exam','#requisicoes_ajax');">{% trans 'Create exam' %}</a></li> | ||
106 | </ul> | 107 | </ul> |
107 | </div> | 108 | </div> |
108 | </div> | 109 | </div> |
@@ -0,0 +1,147 @@ | @@ -0,0 +1,147 @@ | ||
1 | + | ||
2 | +//Insert Create select with question type | ||
3 | + var idQuestionType = 1; | ||
4 | + $("#addQuestion").on("click", function(event){ | ||
5 | + var element = | ||
6 | + '<div class="row form-group" id="questionType_' + idQuestionType +'">' + | ||
7 | + '<label for="questionType" class="col-md-2 control-label">' + | ||
8 | + '{% trans "Question Type" %}</label>' + '<div class="col-md-10">' + | ||
9 | + '<select id="questionType'+ idQuestionType +'" class="form-control" name="option_question" onchange="showDiv (this, '+ idQuestionType +')">' + | ||
10 | + '<option selected disabled>{% trans "Question Type" %}</option>' + | ||
11 | + '<option value="0">{% trans "Multiple Choice" %}</option>' + | ||
12 | + '<option value="1">{% trans "True or False" %}</option>' + | ||
13 | + '<option value="2">{% trans "Gap Filling" %}</option>' + | ||
14 | + '<option value="3">{% trans "Discursive Question" %}</option>' + | ||
15 | + '</select>' + | ||
16 | + '</div>' + | ||
17 | + '</div>' + '<hr id="hr_'+idQuestionType+'">' | ||
18 | + ; | ||
19 | + if (idQuestionType == 1){ | ||
20 | + $(element).insertAfter('#buttonAddQuestion'); | ||
21 | + }else{ | ||
22 | + var idhr = '#hr_'+(idQuestionType-1); | ||
23 | + $(element).insertAfter(idhr); | ||
24 | + } | ||
25 | + idQuestionType++; | ||
26 | + }) | ||
27 | + | ||
28 | + //Insert question choice | ||
29 | + function showDiv (elem, questionType_id) { | ||
30 | + if (elem.value == 0) { | ||
31 | + var questionChoice = | ||
32 | + '<div id="questionChoice_'+questionType_id+'">' + | ||
33 | + '<div class="row form-group">'+ | ||
34 | + '<label for="question-name" class="col-md-2 control-label">Question</label>'+ | ||
35 | + '<div class="col-md-10">'+ | ||
36 | + '<textarea class="form-control" rows="1" id="question-name" placeholder="Wording"></textarea>'+ | ||
37 | + '</div>'+ | ||
38 | + '</div>'+ | ||
39 | + '<div class="row form-group">'+ | ||
40 | + '<label for="alternatives" class="col-md-2 control-label">Alternatives</label>'+ | ||
41 | + '<div class="col-md-10" id="radios_'+questionType_id+'">'+ | ||
42 | + '<div class="radio radio-primary form-group">'+ | ||
43 | + '<label>'+ | ||
44 | + '<input checked type="radio" name="multiple-choice" id="alternative1" value="1">'+ | ||
45 | + '<textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>'+ | ||
46 | + '</label>'+ | ||
47 | + '</div>'+ | ||
48 | + '<div class="radio radio-primary form-group">'+ | ||
49 | + '<label>'+ | ||
50 | + '<input type="radio" name="multiple-choice" id="alternative2" value="2">'+ | ||
51 | + '<textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>'+ | ||
52 | + '</label>'+ | ||
53 | + '</div>'+ | ||
54 | + '</div>'+ | ||
55 | + '</div>'+ | ||
56 | + '<div class="form-group">'+ | ||
57 | + '<button type="button" class="btn btn-raised btn-primary" id="newAlternative_'+questionType_id+'" onclick="functionNewAlternative(radios_'+questionType_id+')">New Alternative</button>'+ | ||
58 | + '</div>'+ | ||
59 | + '</div>'; | ||
60 | + } else if (elem.value == 1) { | ||
61 | + var questionChoice = | ||
62 | + '<div id="questionChoice_'+questionType_id+'">'+ | ||
63 | + '<div class="row form-group">'+ | ||
64 | + '<label for="question-name" class="col-md-2 control-label">Question True or False</label>'+ | ||
65 | + '<div class="col-md-10">'+ | ||
66 | + '<textarea class="form-control" rows="1" id="question-name" placeholder="Wording"></textarea>'+ | ||
67 | + '</div>'+ | ||
68 | + '</div>'+ | ||
69 | + '<div class="row form-group">'+ | ||
70 | + '<label for="alternative" class="col-md-2 control-label">Alternatives: T/F</label>'+ | ||
71 | + '<div class="col-md-10" id="radiosTF_'+questionType_id+'">'+ | ||
72 | + '<div class="radio form-group" value="1">'+ | ||
73 | + '<div class="radio">'+ | ||
74 | + '<label>'+ | ||
75 | + '<textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>'+ | ||
76 | + '</label>'+ | ||
77 | + '<label>'+ | ||
78 | + '<input type="radio" name="true-or-false-1" value="T">'+ | ||
79 | + '</label>'+ | ||
80 | + '<label>'+ | ||
81 | + '<input type="radio" name="true-or-false-1" value="F">'+ | ||
82 | + '</label>'+ | ||
83 | + '</div>'+ | ||
84 | + '</div>'+ | ||
85 | + '<div class="radio form-group" value="2">'+ | ||
86 | + '<label>'+ | ||
87 | + '<textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>'+ | ||
88 | + '</label>'+ | ||
89 | + '<label>'+ | ||
90 | + '<input type="radio" name="true-or-false-2" value="T">'+ | ||
91 | + '</label>'+ | ||
92 | + '<label>'+ | ||
93 | + '<input type="radio" name="true-or-false-2" value="F">'+ | ||
94 | + '</label>'+ | ||
95 | + '</div>'+ | ||
96 | + '</div>'+ | ||
97 | + '</div>'+ | ||
98 | + '<div class="form-group">'+ | ||
99 | + '<button type="button" class="btn btn-raised btn-primary" id="newAlternative_'+questionType_id+'" onclick="functionNewAlternativeTF(radiosTF_'+questionType_id+')">New Alternative</button>'+ | ||
100 | + '</div>'+ | ||
101 | + '</div>'; | ||
102 | + } else if (elem.value == 3) { | ||
103 | + var questionChoice = | ||
104 | + '<div id="questionChoice_'+questionType_id+'">'+ | ||
105 | + '<div class="row form-group">'+ | ||
106 | + '<label for="question-name" class="col-md-2 control-label">Name Question discursive</label>'+ | ||
107 | + '<div class="col-md-10">'+ | ||
108 | + '<textarea class="form-control" rows="2" id="question" placeholder="Wording"></textarea>'+ | ||
109 | + '</div>'+ | ||
110 | + '</div>'+ | ||
111 | + '</div>'; | ||
112 | + } | ||
113 | + if(document.getElementById('questionChoice_'+ questionType_id)){ | ||
114 | + $('#questionChoice_'+ questionType_id).detach(); | ||
115 | + } | ||
116 | + $(questionChoice).insertBefore('#hr_'+questionType_id); | ||
117 | + $.material.init() //O material deve ser iniciado aqui para funcionar os botoes de radio. | ||
118 | + } | ||
119 | +//Bug quando criamos sem ser na ordem | ||
120 | +function functionNewAlternative(Question_Id){ | ||
121 | + var alternative = parseInt($("div input").last().val()) + 1; | ||
122 | + var element = '<div class="radio radio-primary form-group">' + | ||
123 | + '<label>' + | ||
124 | + '<input type="radio" name="alternatives" id="alternative_'+alternative+'_'+Question_Id+'"' + 'value="'+alternative+'">' + | ||
125 | + '<textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>' + | ||
126 | + '</label>'+ | ||
127 | + '</div>'; | ||
128 | + $(Question_Id).append(element); | ||
129 | + $.material.init() //O material deve ser iniciado aqui para funcionar os botoes de radio. | ||
130 | +} | ||
131 | +function functionNewAlternativeTF(Question_Id){ | ||
132 | + var alternative = parseInt($("div").last().val()) + 1; | ||
133 | + var element = | ||
134 | + '<div class="radio form-group">'+ | ||
135 | + '<label>'+ | ||
136 | + '<textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>'+ | ||
137 | + '</label>'+ | ||
138 | + '<label>'+ | ||
139 | + '<input type="radio" name="true-or-false-2" value="T">'+ | ||
140 | + '</label>'+ | ||
141 | + '<label>'+ | ||
142 | + '<input type="radio" name="true-or-false-2" value="F">'+ | ||
143 | + '</label>'+ | ||
144 | + '</div>'; | ||
145 | + $(Question_Id).append(element); | ||
146 | + $.material.init() //O material deve ser iniciado aqui para funcionar os botoes de radio. | ||
147 | +} | ||
0 | \ No newline at end of file | 148 | \ No newline at end of file |
exam/templates/exam/create.html
1 | -{% extends "home.html" %} | ||
2 | 1 | ||
3 | {% load i18n widget_tweaks dict_access static%} | 2 | {% load i18n widget_tweaks dict_access static%} |
4 | 3 | ||
5 | {# {% block style %} #} | 4 | {# {% block style %} #} |
6 | <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> | 5 | <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> |
7 | - <script src="{% static 'js/modal_exam.js' %}"></script> | ||
8 | - | 6 | + <script src="{% static 'js/modalExam.js' %}"></script> |
7 | + <!-- Init material Bootstrap --> | ||
8 | + <script type="text/javascript">$.material.init()</script><!-- O botao radio volta a funcionar quando coloco essa função--> | ||
9 | {# {% endblock %} #} | 9 | {# {% endblock %} #} |
10 | 10 | ||
11 | -{# {% block content %} #} | 11 | +{% block content %} |
12 | <!-- Modal (remember to change the ids!!!) --> | 12 | <!-- Modal (remember to change the ids!!!) --> |
13 | <div class="modal fade" id="exam" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | 13 | <div class="modal fade" id="exam" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> |
14 | <div class="modal-dialog" role="document"> | 14 | <div class="modal-dialog" role="document"> |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | 19 | ||
20 | {% block title_exam %} | 20 | {% block title_exam %} |
21 | <!-- Put your title here!!! --> | 21 | <!-- Put your title here!!! --> |
22 | - <h4 class="modal-title" id="myModalLabel">{% trans "Create a Exam" %}</h4> | 22 | + <h4 class="modal-title" id="myModalLabel">{% trans "Create a Exam" %}</h4> |
23 | {% endblock title_exam %} | 23 | {% endblock title_exam %} |
24 | </div> | 24 | </div> |
25 | <!-- Modal Body --> | 25 | <!-- Modal Body --> |
@@ -50,31 +50,20 @@ | @@ -50,31 +50,20 @@ | ||
50 | <div class="col-md-10"> | 50 | <div class="col-md-10"> |
51 | <div class="checkbox"> | 51 | <div class="checkbox"> |
52 | <label> | 52 | <label> |
53 | - <input type="checkbox" name="checkbox"><span class="checkbox-material"><span class="check"></span></span> {% trans "Allow submissions after deadline?" %} | 53 | + <input type="checkbox" name="checkbox"><span class="checkbox-material"></span> {% trans "Allow submissions after deadline?" %} |
54 | </label> | 54 | </label> |
55 | </div> | 55 | </div> |
56 | </div> | 56 | </div> |
57 | </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> | 58 | + <div class="row form-group" id="buttonAddQuestion"> |
63 | <div class="col-md-10"> | 59 | <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> | 60 | + <button id="addQuestion" type="button" class="btn btn-raised btn-default">Add new question buton</button> |
71 | </div> | 61 | </div> |
72 | </div> | 62 | </div> |
73 | <!-- Modal Footer --> | 63 | <!-- Modal Footer --> |
74 | <div class="modal-footer"> | 64 | <div class="modal-footer"> |
75 | - | ||
76 | <!-- Don't remove that!!! --> | 65 | <!-- Don't remove that!!! --> |
77 | - <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button> | 66 | + <button type="button" class="btn btn-default btn-raised" data-dismiss="modal">{% trans "Close" %}</button> |
78 | {% block button_save %} | 67 | {% block button_save %} |
79 | <!-- Put curtom buttons here!!! --> | 68 | <!-- Put curtom buttons here!!! --> |
80 | <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> | 69 | <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> |
@@ -88,50 +77,4 @@ | @@ -88,50 +77,4 @@ | ||
88 | </div> | 77 | </div> |
89 | </div> | 78 | </div> |
90 | 79 | ||
91 | -<script type="text/javascript"> | ||
92 | - | ||
93 | -var id = 1; | ||
94 | -$("#add_question").click(function(){ | ||
95 | - $.get("{% url 'course:exam:true_or_false_question' %}", function(data){ | ||
96 | - | ||
97 | - $("#questions").append(data); | ||
98 | - | ||
99 | - $("#0").attr("id","true_" + id++); | ||
100 | - }); | ||
101 | -}); | ||
102 | -var alternativeValue = 3; | ||
103 | -$('#newAlternative').click(function () { | ||
104 | - var element = '<div class="radio radio-primary">' + | ||
105 | - '<label>' + | ||
106 | - '<input type="radio" name="alternatives" id="alternative4"' + 'value="' +alternativeValue + '">' + | ||
107 | - '<textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>' + | ||
108 | - '</label>' + | ||
109 | - '</div>'; | ||
110 | - $('#radios').append(element); | ||
111 | - alternativeValue++; | ||
112 | -}); | ||
113 | -var tfAlternativeValue = 3; | ||
114 | -$('#tfAlternative').click(function () { | ||
115 | - var element = '<div class="radio radio-primary">' + | ||
116 | - '<label>' + | ||
117 | - '<textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea>' + | ||
118 | - '</label>' + | ||
119 | - '<label>' + | ||
120 | - '<input type="radio" name="alternative' + tfAlternativeValue +'" value="T">' + | ||
121 | - '</label>' + | ||
122 | - '<label>' + | ||
123 | - '<input type="radio" name="alternative2" value="F">' + | ||
124 | - '</label>' + | ||
125 | - '</div>'; | ||
126 | - $('#radiosTF').append(element); | ||
127 | - tfAlternativeValue++; | ||
128 | -}); | ||
129 | -$(function() { | ||
130 | - $( "#begin_date,#end_date" ).datepicker(); | ||
131 | -}); | ||
132 | - | ||
133 | -</script> | ||
134 | - | ||
135 | - | ||
136 | - | ||
137 | {% endblock content %} | 80 | {% endblock content %} |