diff options
author | Prabhu Ramachandran | 2016-05-10 20:09:08 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2016-05-10 20:09:08 +0530 |
commit | 5c74697b00ea08a2b78615637d8b322410fca4b0 (patch) | |
tree | d5b937e90bc7d3051b9c9128c4e1560b09db1c2c /yaksh/templates | |
parent | d386d24aaa662f91e4314060926dc9bc02426c7d (diff) | |
parent | c384c60c6d7fb5d30f3f929c518e0b41e084c4c4 (diff) | |
download | online_test-5c74697b00ea08a2b78615637d8b322410fca4b0.tar.gz online_test-5c74697b00ea08a2b78615637d8b322410fca4b0.tar.bz2 online_test-5c74697b00ea08a2b78615637d8b322410fca4b0.zip |
Merge pull request #96 from ankitjavalkar/code-eval-refactor-clean2
Code evaluator refactor
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/add_question.html | 36 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 18 |
2 files changed, 26 insertions, 28 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index 61b146c..d38aa1c 100644 --- a/yaksh/templates/yaksh/add_question.html +++ b/yaksh/templates/yaksh/add_question.html @@ -1,6 +1,5 @@ {% extends "manage.html" %} - {% block subtitle %}Add Question{% endblock %} {% block css %} @@ -25,25 +24,24 @@ <tr><td>Points:<td><button class="btn-mini" type="button" onClick="increase(frm);">+</button>{{ form.points }}<button class="btn-mini" type="button" onClick="decrease(frm);">-</button>{{ form.points.errors }} <tr><td><strong>Rendered: </strong><td><p id='my'></p> <tr><td>Description: <td>{{ form.description}} {{form.description.errors}} - <tr><td>Snippet: <td>{{ form.snippet }}{{ form.snippet.errors }}</td></tD></td></tr> <tr><td>Tags: <td>{{ form.tags }} - <tr><td id='label_option'>Options: <td>{{ form.options }} {{form.options.errors}} - <tr><td id='label_solution'>Test: <td>{{ form.test }} {{form.test.errors}} - <tr><td id='label_ref_code_path'>Reference Code Path: <td>{{ form.ref_code_path }} {{form.ref_code_path.errors}} - - <form method="post" action=""> - {% if formset%} - {{ formset.management_form }} - {% for form in formset %} - {{ form }} - {% endfor %} - {% endif %} - </form> + <tr><td> Test Case Type: <td> {{ form.test_case_type }}{{ form.test_case_type.errors }} + + <div class="form-group"> + {{ test_case_formset.management_form }} + + {% for form in test_case_formset %} + <div class="link-formset"> + {{ form }} + </div> + {% endfor %} + + </div> + </table></center> - <center><button class="btn" type="submit" name="add_test">Add Test Case</button> - <button class="btn" type="submit" name="delete_test">Remove Test Case</button> - </center><br> - <center><button class="btn" type="submit" name="save_question">Save</button> - <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> </center> + <center> + <button class="btn" type="submit" name="save_question">Save & Add Testcase</button> + <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Back to Questions</button> + </center> </form> {% endblock %} diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index e542fe9..8a67818 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -165,8 +165,14 @@ function call_skip(url) <input type=hidden name="question_id" id="question_id" value={{ question.id }}></input> {% if question.type == "mcq" %} - {% for option in question.options.strip.splitlines %} - <input name="answer" type="radio" value="{{option}}" />{{option}} <br/> + {% for test_case in test_cases %} + <input name="answer" type="radio" value="{{ test_case.options }}" />{{ test_case.options }} <br/> + {% endfor %} + {% endif %} + {% if question.type == "mcc" %} + {% for test_case in test_cases %} + <input name="answer" type="checkbox" value="{{ test_case.options }}"> {{ test_case.options }} + <br> {% endfor %} {% endif %} {% if question.type == "upload" %} @@ -174,12 +180,6 @@ function call_skip(url) <input type=file id="assignment" name="assignment"> <hr> {% endif %} - {% if question.type == "mcc" %} - {% for option in question.options.strip.splitlines %} - <input name="answer" type="checkbox" value="{{ option }}"> {{ option }} - <br> - {% endfor %} - {% endif %} {% if question.type == "code" %} <h3>Program:</h3> <textarea rows="1" class="bash" readonly="yes" name="snippet" id="snippet" wrap="off" >{% if last_attempt %}{{ question.snippet }}{% else %}{% if question.type == "bash" %} #!/bin/bash {{ question.snippet }}{% else %}{{ question.snippet }}{% endif %}{% endif %}</textarea> @@ -204,7 +204,7 @@ function call_skip(url) {% endif %} </form> </div> - + <!-- Modal --> <div class="modal fade " id="upload_alert" > <div class="modal-dialog"> |