Commit cbe675da089e2b9f8b11304c38ee2df1b042134a
1 parent
dacf1055
Exists in
master
and in
5 other branches
modifying create exam #362
Showing
1 changed file
with
8 additions
and
65 deletions
Show diff stats
exam/templates/exam/create.html
| 1 | -{% extends "home.html" %} | |
| 2 | 1 | |
| 3 | 2 | {% load i18n widget_tweaks dict_access static%} |
| 4 | 3 | |
| 5 | 4 | {# {% block style %} #} |
| 6 | 5 | <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> |
| 7 | 6 | <script src="{% static 'js/modalExam.js' %}"></script> |
| 8 | - | |
| 7 | + <!-- Init material Bootstrap --> | |
| 8 | + <script type="text/javascript">$.material.init()</script><!-- O botao radio volta a funcionar quando coloco essa função--> | |
| 9 | 9 | {# {% endblock %} #} |
| 10 | 10 | |
| 11 | -{# {% block content %} #} | |
| 11 | +{% block content %} | |
| 12 | 12 | <!-- Modal (remember to change the ids!!!) --> |
| 13 | 13 | <div class="modal fade" id="exam" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> |
| 14 | 14 | <div class="modal-dialog" role="document"> |
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | |
| 20 | 20 | {% block title_exam %} |
| 21 | 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 | 23 | {% endblock title_exam %} |
| 24 | 24 | </div> |
| 25 | 25 | <!-- Modal Body --> |
| ... | ... | @@ -50,31 +50,20 @@ |
| 50 | 50 | <div class="col-md-10"> |
| 51 | 51 | <div class="checkbox"> |
| 52 | 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 | 54 | </label> |
| 55 | 55 | </div> |
| 56 | 56 | </div> |
| 57 | 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 | 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 | 61 | </div> |
| 72 | 62 | </div> |
| 73 | 63 | <!-- Modal Footer --> |
| 74 | 64 | <div class="modal-footer"> |
| 75 | - | |
| 76 | 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 | 67 | {% block button_save %} |
| 79 | 68 | <!-- Put curtom buttons here!!! --> |
| 80 | 69 | <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> |
| ... | ... | @@ -88,50 +77,4 @@ |
| 88 | 77 | </div> |
| 89 | 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 | 80 | {% endblock content %} | ... | ... |