diff options
author | hardythe1 | 2012-02-23 16:30:36 +0530 |
---|---|---|
committer | hardythe1 | 2012-02-23 16:30:36 +0530 |
commit | 9acff5f2cf9f9ae3d2fc097e1fcd84712d3199d0 (patch) | |
tree | cac2d9feddb2c5d45f24a806275d23635b528fe9 /testapp/templates/exam | |
parent | f2d65592affd34bc60cf4a3a2c72de1d84c934c0 (diff) | |
download | online_test-9acff5f2cf9f9ae3d2fc097e1fcd84712d3199d0.tar.gz online_test-9acff5f2cf9f9ae3d2fc097e1fcd84712d3199d0.tar.bz2 online_test-9acff5f2cf9f9ae3d2fc097e1fcd84712d3199d0.zip |
more changes to edit multiple questions at a time
Diffstat (limited to 'testapp/templates/exam')
-rw-r--r-- | testapp/templates/exam/edit_question.html | 29 | ||||
-rw-r--r-- | testapp/templates/exam/showquestions.html | 18 |
2 files changed, 45 insertions, 2 deletions
diff --git a/testapp/templates/exam/edit_question.html b/testapp/templates/exam/edit_question.html new file mode 100644 index 0000000..04217ab --- /dev/null +++ b/testapp/templates/exam/edit_question.html @@ -0,0 +1,29 @@ +{% extends "manage.html" %} + +{% block subtitle %} +Edit Question +{% endblock %} + + +{% block manage %} +<style type="text/css"> + +table th, table td { + padding: 10px 10px 9px; + line-height: 18px solid; + text-align: left; +} +</style> + +<form action="{{URL_ROOT}}/exam/manage/editquestion/" method="post"> +{% csrf_token %} +{% for form in forms %} +<table> +{{ form.as_table }} +</table> +<hr> +{% endfor %} +<center><button class="btn" type="submit" name="savequestion">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/templates/exam/showquestions.html b/testapp/templates/exam/showquestions.html index 994ca26..edcba6f 100644 --- a/testapp/templates/exam/showquestions.html +++ b/testapp/templates/exam/showquestions.html @@ -7,7 +7,7 @@ List of Questions {% block script %} <script type='text/javascript'> -function my_confirm(frm) +function confirm_delete(frm) { var r = confirm("Are you Sure ?"); if(r==false) @@ -19,6 +19,18 @@ function my_confirm(frm) location.replace("{{URL_ROOT}}/exam/manage/showquestion"); } } +function confirm_edit(frm) +{ + var n = 0; + for(i=0;i<frm.question.length;i++) + { + if(frm.question[i].checked==true) + n = n+1; + } + if(n==0) + location.replace("{{URL_ROOT}}/exam/manage/showquestion"); + +} </script> {% endblock %} @@ -30,6 +42,8 @@ function my_confirm(frm) {% endfor %} <br> <button class="btn" type="button" onclick='location.replace("{{URL_ROOT}}/exam/manage/addquestion/");'>Add Question</button> -<button class="btn" type="submit" onClick="my_confirm(frm);">Delete</button> +<button class="btn" type="submit" name='edit' value='edit' onClick="confirm_edit(frm);">Edit Selected</button> +<button class="btn" type="submit" onClick="confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button> + </form> {% endblock %} |