diff options
Diffstat (limited to 'testapp/exam/templates')
-rw-r--r-- | testapp/exam/templates/exam/add_question.html | 37 | ||||
-rw-r--r-- | testapp/exam/templates/exam/edit_question.html | 34 |
2 files changed, 62 insertions, 9 deletions
diff --git a/testapp/exam/templates/exam/add_question.html b/testapp/exam/templates/exam/add_question.html index b6ce908..d989b81 100644 --- a/testapp/exam/templates/exam/add_question.html +++ b/testapp/exam/templates/exam/add_question.html @@ -27,17 +27,38 @@ <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>Test Keyword Arguments: <td>{{ form.test_keyword_args }}{{form.test.errors}} <!-- --> - <tr><td>Test Positional Arguments: <td>{{ form.test_pos_args }}{{form.test.errors}} <!-- --> - <tr><td>Test Expected Answer: <td>{{ form.test_expected_answer }}{{form.test.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}} - - + <tr><td id='label_option'>Options: <td>{{ form.options }} {{form.options.errors}} + <!-- start --> + <form method="post" action=""> + {% if formset%} + {{ formset.management_form }} + {% for form in formset %} + {{ form }} + {% endfor %} + {% endif %} + </form> +<!-- <form method="post" action=""> + <center><table class=span1> + {{ formset.management_form }} + {% for form in formset %} + {{ form.id }} + <tr><td>Question <td>{{ form.question }} + <tr><td>Function Name <td>{{ form.func_name }} + <tr><td>Keyword argument <td>{{ form.kw_args }} + <tr><td>Positional Argument <td>{{ form.pos_args }} + <tr><td>Expected Answer <td>{{ form.expected_answer }} + <tr><td>Code Path <td>{{ form.ref_code_path }} + {% endfor %} + </form> --> + <!-- end --> </table></center> - <center><button class="btn" type="submit" name="savequestion">Save</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> </form> {% endblock %} diff --git a/testapp/exam/templates/exam/edit_question.html b/testapp/exam/templates/exam/edit_question.html index b28cc3e..1c34dee 100644 --- a/testapp/exam/templates/exam/edit_question.html +++ b/testapp/exam/templates/exam/edit_question.html @@ -21,7 +21,7 @@ <table> - {% for form in forms %} +<!-- {% 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> @@ -43,7 +43,39 @@ </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> + + <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>{{ question.summary }}{{ question.summary.errors }} + <tr><td><b> Language: </b><td> {{question.language}}{{question.language.errors}} + <tr><td><b> Active: </b><td> {{ question.active }}{{question.active.errors}} Type: {{ question.type }}{{question.type.errors}} + <tr><td><b>Points:<td><button class="btn-mini" name={{forloop.counter}} type="button" onClick="increase(frm,{{forloop.counter}});">+</button>{{ question.points }}<button class="btn-mini" type="button" onClick="decrease(frm,{{forloop.counter}});">-</button>{{ question.points.errors }} + <tr><td><strong>Rendered: </strong><td><p id='my{{forloop.counter}}'></p> + <tr><td><b>Description: <td>{{ question.description }} + {{question.description.errors}} <tr><td><b>Test: <td> + {{ question.test }}{{question.test.errors}} + <tr><td><b>Snippet: <td>{{ question.snippet }}{{ question.snippet.errors }} + </td></b></td></tr> + <tr><td><b>Tags: </b><td>{{ question.tags }} + <tr><td id='label_option{{forloop.counter}}'><b>Options:<td>{{ question.options }} + {{question.options.errors}} {{question.options.helptext}} + </table></center> + <center><table class=span1> + {{ test }} + </table></center> + </div> + </div> + {% endfor %} </table></center> + + {% for i in data %} <input type=hidden name='questions' value="{{ i }}" /> {% endfor %} |