diff options
author | Prabhu Ramachandran | 2011-11-17 17:35:30 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2011-11-17 17:35:30 +0530 |
commit | 9f674808a5681a0380531ff62079b94874641c1e (patch) | |
tree | 63fdb2f431d9fc68705e1170cc4e536a36c18169 /templates/exam/question.html | |
parent | 78e18eae416a37fdb2e27d4dde7ed9675692ac7d (diff) | |
download | online_test-9f674808a5681a0380531ff62079b94874641c1e.tar.gz online_test-9f674808a5681a0380531ff62079b94874641c1e.tar.bz2 online_test-9f674808a5681a0380531ff62079b94874641c1e.zip |
BUG/ENH: Cleaning up page templates and fixing bug
If you complete the quiz it was going into a redirect loop, this is
fixed. Also cleaned up all the page templates with proper block
contents.
Diffstat (limited to 'templates/exam/question.html')
-rw-r--r-- | templates/exam/question.html | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/templates/exam/question.html b/templates/exam/question.html index 2267efc..9ea27c4 100644 --- a/templates/exam/question.html +++ b/templates/exam/question.html @@ -1,5 +1,8 @@ -<h2> {{ question.summary }} </h2> +{% extends "base.html" %} + +{% block title %} Answer question {% endblock %} +{% block script %} <script type="text/javascript"> <!-- var time_left = {{ time_left }}; @@ -25,24 +28,27 @@ function secs_to_time(secs) return h_s + m_s + s_s; } -function dec_time() +function update_time() { time_left -= 1; if (time_left) { var elem = document.getElementById("time_left"); var t_str = secs_to_time(time_left); elem.innerHTML = "<strong> Time left: " + t_str + "</strong>"; - setTimeout("dec_time()", 1000); + setTimeout("update_time()", 1000); } else { document.forms["logout"].submit(); } } - //--> </script> +{% endblock script %} -<body onload="dec_time()"> +{% block onload %} onload="update_time()" {% endblock %} + +{% block content %} +<h2> {{ question.summary }} </h2> <p>{{ question.description }} </p> @@ -75,4 +81,4 @@ you have {{ paper.questions_left }} question(s) left in {{ quiz_name }}.</p> <input type="submit" name="quit" value="Quit exam and logout" /> </form> -</body>
\ No newline at end of file +{% endblock content %}
\ No newline at end of file |