summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authormahesh2018-02-02 15:22:25 +0530
committermaheshgudi2018-03-16 15:15:50 +0530
commit9c9e505e79abce0cae6b341880ed9f8a4e31a8be (patch)
tree4a95429d0b2fd65cfc33ff932a2ebb3c2491ba53 /yaksh/templates
parent1c8bc4aaadb307b14cb4e673485bf2405e921543 (diff)
downloadonline_test-9c9e505e79abce0cae6b341880ed9f8a4e31a8be.tar.gz
online_test-9c9e505e79abce0cae6b341880ed9f8a4e31a8be.tar.bz2
online_test-9c9e505e79abce0cae6b341880ed9f8a4e31a8be.zip
Add jumble question type
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/add_question.html1
-rw-r--r--yaksh/templates/yaksh/question.html23
2 files changed, 23 insertions, 1 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index ed69657..79c132c 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -64,6 +64,7 @@
<option value="integertestcase">Integer </option>
<option value="stringtestcase"> String </option>
<option value="floattestcase"> Float </option>
+ <option value="arrangetestcase">Arrange options </option>
</select></p>
<center>
<button class="btn" type="submit" name="save_question">Save</button>
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 9d6ce48..ed04963 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -21,6 +21,7 @@
<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/mode/clike/clike.js"></script>
<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/mode/shell/shell.js"></script>
<script src="{{ URL_ROOT }}/static/yaksh/js/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script>
+<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-sortable.js"></script>
<script>
init_val = '{{ last_attempt|escape_quotes|safe }}';
lang = "{{ question.language }}"
@@ -175,10 +176,12 @@ question_type = "{{ question.type }}"
{% else %}
<h5>(CASE SENSITIVE)</h5>
{% endif %}
-
{% elif question.type == "float" %}
(FILL IN THE BLANKS WITH FLOAT ANSWER)
+ {% elif question.type == "arrange" %}
+ (ARRANGE THE OPTIONS IN CORRECT ORDER)
{% endif %}
+
</u>
<font class=pull-right>(Marks : {{ question.points }}) </font>
</h4>
@@ -251,6 +254,21 @@ question_type = "{{ question.type }}"
<input type=file id="assignment" name="assignment" multiple="">
<hr>
{% endif %}
+
+ {% if question.type == "arrange" %}
+ <input name="answer" type="hidden" id='arrange_order'/>
+ <ol class="arrange">
+ {% for test_case in test_cases %}
+ <li id = {{test_case.id}}>{{test_case.options| safe }}</li>
+ {% endfor %}
+ </ol>
+ <script type="text/javascript">
+ var arrange = $("ol.arrange");
+ var order_array = $(arrange).sortable(['serialize']);
+ </script>
+ {% endif %}
+
+
{% if question.type == "code" %}
<div class="row">
<div class="col-md-9">
@@ -269,6 +287,9 @@ question_type = "{{ question.type }}"
<br><button class="btn btn-primary" type="submit" name="check" id="check">Submit Answer</button>&nbsp;&nbsp;
{% elif question.type == "upload" %}
<br><button class="btn btn-primary" type="submit" name="check" id="check" onClick="return validate();">Upload</button>&nbsp;&nbsp;
+ {% elif question.type == "arrange" %}
+ <br><button class="btn btn-primary" type="submit" name="check" id="check" onClick="return user_arranged_options();">Submit Answer</button>&nbsp;&nbsp;
+
{% else %}
{% if question in paper.get_questions_unanswered or quiz.is_exercise %}