diff options
author | ankitjavalkar | 2016-04-28 18:19:09 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-05-05 19:20:23 +0530 |
commit | 5967e0e1cce19d356ba622719b332f776127b277 (patch) | |
tree | 8a98600738d1ce586f275ee52e51f09e1d9dc2ce /yaksh/templates | |
parent | 23216995e0fc0e94fd58c6186eed74c943ae5081 (diff) | |
download | online_test-5967e0e1cce19d356ba622719b332f776127b277.tar.gz online_test-5967e0e1cce19d356ba622719b332f776127b277.tar.bz2 online_test-5967e0e1cce19d356ba622719b332f776127b277.zip |
- Add formsets to Add question templates
- add/modify test cases in place when adding questions
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/add_question.html | 27 | ||||
-rw-r--r-- | yaksh/templates/yaksh/add_testcase.html | 39 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_testcase.html | 31 |
3 files changed, 13 insertions, 84 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index 44aca9d..bba8db2 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 %} @@ -30,23 +29,23 @@ <!-- <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}} --> - <tr><td> test_case_type: <td> {{ form.test_case_type }}{{ form.test_case_type.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="save_question">Save</button> <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> - {% if question_id %} - <button class="btn" type="button" name="testcase_button" onClick='location.replace("{{URL_ROOT}}/exam/manage/showtestcase/{{ question_id }}/");'>Go To TestCases</button> - {% endif %} </center> </form> {% endblock %} diff --git a/yaksh/templates/yaksh/add_testcase.html b/yaksh/templates/yaksh/add_testcase.html deleted file mode 100644 index 7e29765..0000000 --- a/yaksh/templates/yaksh/add_testcase.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "manage.html" %} - -{% block subtitle %}Add Test Case{% endblock %} - -{% block css %} -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" /> -{% endblock %} - -{% block manage %} -<form name=frm id=frm action="" method="post" > - {% csrf_token %} - <center> - <table class=span1> - {{ form.as_table }} - </table> - </center> - - <center><button class="btn primary" type="submit" id="submit" name="testcase">Save</button> - <button class="btn primary" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/showtestcase/{{question_id}}");'>Cancel</button> </center> -</form> -{% endblock %} - -<!-- {% comment %}{% extends "manage.html" %} - -{% block subtitle %}Add Testcase{% endblock %} - -{% block script %} -<script type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.4.2.min.js"></script> -{% endblock %} - -{% block onload %} onload='javascript:textareaformat();' {% endblock %} - -{% block manage %} -<form name=testcase_frm id=testcase_frm action="" method="post"> -{{ form.as_table }} -</form> -<button class="btn" type="submit" name="save_testcase">Save</button> -{% endblock %}{% endcomment %} - --> diff --git a/yaksh/templates/yaksh/show_testcase.html b/yaksh/templates/yaksh/show_testcase.html deleted file mode 100644 index b9cb55f..0000000 --- a/yaksh/templates/yaksh/show_testcase.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "manage.html" %} - -{% block title %} Test Case List {% endblock title %} - -{% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/show_testcase.js"></script> -{% endblock %} - -{% block subtitle %} Test Case List {% endblock %} -{% block manage %} -{% if not test_cases %} -<center><h5> No Test Cases Available for This Question. </h5></center> -<button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/testcase/{{ question_id }}");'>Add New Test Case</button> -{% endif %} - - -{% if test_cases %} -<form method="post" action="" name='frm'> -{% csrf_token %} - -{% for test_case in test_cases %} -<input type=checkbox name='test_case' value={{test_case.id}} /> <a href="{{URL_ROOT}}/exam/manage/testcase/{{ question_id }}/{{ test_case.id }}">{{ test_case }}</a><br> -{% endfor %} - -<br><br> -<button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/testcase/{{ question_id }}");'>Add New Test Case</button> -<button class="btn" type="submit" name="delete" value='delete' onClick="return confirm_delete(frm);">Delete Selected</button> -</form> -{% endif %} - -{% endblock %} |