diff options
author | ankitjavalkar | 2015-03-18 12:16:20 +0530 |
---|---|---|
committer | ankitjavalkar | 2015-04-26 19:46:00 +0530 |
commit | 28ba37e907553aeac3841e221853683b9171f0db (patch) | |
tree | 9926315f93ac82fb21ae1f98450cfa031da8f996 /testapp/exam/templates | |
parent | a88e59fa419d7ab31aa430e7424ff0a25169713f (diff) | |
download | online_test-28ba37e907553aeac3841e221853683b9171f0db.tar.gz online_test-28ba37e907553aeac3841e221853683b9171f0db.tar.bz2 online_test-28ba37e907553aeac3841e221853683b9171f0db.zip |
Changes to Question model, Views, Add-Question UI
- ref_code_path is now part of Question model
- MCQ/MCC answers checked using solution field in question model
- Formset should reload even after errors
- add_question page chould display solution field only in MCQ/MCC
Diffstat (limited to 'testapp/exam/templates')
-rw-r--r-- | testapp/exam/templates/exam/add_question.html | 9 | ||||
-rw-r--r-- | testapp/exam/templates/exam/edit_question.html | 24 |
2 files changed, 5 insertions, 28 deletions
diff --git a/testapp/exam/templates/exam/add_question.html b/testapp/exam/templates/exam/add_question.html index e5e2574..e117ef3 100644 --- a/testapp/exam/templates/exam/add_question.html +++ b/testapp/exam/templates/exam/add_question.html @@ -27,11 +27,12 @@ <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>Test: <td>{{ form.test }}{{form.test.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}} - <!-- start --> + <tr><td id='label_solution'>Solution: <td>{{ form.solution }} {{form.solution.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 }} @@ -41,8 +42,8 @@ {% endif %} </form> </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><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> diff --git a/testapp/exam/templates/exam/edit_question.html b/testapp/exam/templates/exam/edit_question.html index 1c34dee..6deca4a 100644 --- a/testapp/exam/templates/exam/edit_question.html +++ b/testapp/exam/templates/exam/edit_question.html @@ -21,30 +21,6 @@ <table> -<!-- {% for form in forms %} - - <tr><td height=10><a id='a{{forloop.counter}}' onClick="data('contentDiv{{forloop.counter}}','myContent{{forloop.counter}}','a{{forloop.counter}}','{{form.summary.value}}');" style='cursor:pointer;'>{{form.summary.value}}</a> - - <div id="contentDiv{{forloop.counter}}" style="display:none;"> - <div id="myContent{{forloop.counter}}" style="display: none;"> - - <center><table class=span1> - <tr><td><b>Summary:</b> <td>{{ form.summary }}{{ form.summary.errors }} - <tr><td><b> Language: </b><td> {{form.language}}{{form.language.errors}} - <tr><td><b> Active: </b><td> {{ form.active }}{{form.active.errors}} Type: {{ form.type }}{{form.type.errors}} - <tr><td><b>Points:<td><button class="btn-mini" name={{forloop.counter}} type="button" onClick="increase(frm,{{forloop.counter}});">+</button>{{ form.points }}<button class="btn-mini" type="button" onClick="decrease(frm,{{forloop.counter}});">-</button>{{ form.points.errors }} - <tr><td><strong>Rendered: </strong><td><p id='my{{forloop.counter}}'></p> - <tr><td><b>Description: <td>{{ form.description }} {{form.description.errors}} - <tr><td><b>Test: <td>{{ form.test }}{{form.test.errors}} - <tr><td><b>Snippet: <td>{{ form.snippet }}{{ form.snippet.errors }}</td></b></td></tr> - <tr><td><b>Tags: </b><td>{{ form.tags }} - <tr><td id='label_option{{forloop.counter}}'><b>Options:<td>{{ form.options }} {{form.options.errors}} {{form.options.helptext}} - </table></center> - </div> - </div> - {% endfor %} -</table></center> --> - {% for question, test in data_list %} <tr><td height=10><a id='a{{forloop.counter}}' onClick="data('contentDiv{{forloop.counter}}','myContent{{forloop.counter}}','a{{forloop.counter}}','{{question.summary.value}}');" style='cursor:pointer;'>{{question.summary.value}}</a> |