summaryrefslogtreecommitdiff
path: root/testapp/templates/exam
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/templates/exam')
-rw-r--r--testapp/templates/exam/edit_question.html29
-rw-r--r--testapp/templates/exam/showquestions.html18
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>&nbsp;&nbsp;
-<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>&nbsp;&nbsp;
+<button class="btn" type="submit" onClick="confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button>
+
</form>
{% endblock %}