diff options
author | Prabhu Ramachandran | 2011-11-21 02:41:27 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2011-11-21 02:41:27 +0530 |
commit | c2185243e9e3e8a66a2a4c7a549d9bc00fd9f2fa (patch) | |
tree | 6109a8f027139e8d86d58bc0cb6f147b29c31d9c /templates | |
parent | 8f7b25c5639dbe7912df35ea94dfb665d74d0107 (diff) | |
download | online_test-c2185243e9e3e8a66a2a4c7a549d9bc00fd9f2fa.tar.gz online_test-c2185243e9e3e8a66a2a4c7a549d9bc00fd9f2fa.tar.bz2 online_test-c2185243e9e3e8a66a2a4c7a549d9bc00fd9f2fa.zip |
ENH: Better monitor reporting and user_data info
This checkin adds the following:
- /exam/monitor displays all available quizzes.
- /exam/monitor/quiz_id displays results for the specified quiz.
- /exam/user_data/username displays the users data including answers.
- A link is provided in monitor output to see user data.
- More monitor data like number of attempts.
- The monitor and user data are only shown for a user who is
authenticated and is staff.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/exam/monitor.html | 41 | ||||
-rw-r--r-- | templates/exam/user_data.html | 38 |
2 files changed, 74 insertions, 5 deletions
diff --git a/templates/exam/monitor.html b/templates/exam/monitor.html index d79bb35..201e5db 100644 --- a/templates/exam/monitor.html +++ b/templates/exam/monitor.html @@ -5,26 +5,57 @@ {% block meta %} <meta http-equiv="refresh" content="30"/> {% endblock meta %} {% block content %} -<h1> Current quiz results </h1> +{% if not quiz_data and not paper_list %} +<h1> Quiz results </h1> +<p> No quizzes available. </p> + +{% endif %} + +{# ############################################################### #} +{# This is rendered when we are just viewing exam/monitor #} +{% if quiz_data %} +<h1> Available quizzes </h1> + +<ul> +{% for quiz_id, quiz_name in quiz_data.items %} +<li><a href="{{URL_ROOT}}/exam/monitor/{{quiz_id}}/">{{ quiz_name }}</a></li> +{% endfor %} +</ul> +{% endif %} + +{# ############################################################### #} +{# This is rendered when we are just viewing exam/monitor/quiz_num #} {% if paper_list %} +<h1> {{ quiz_name }} results </h1> + +{# <p> Quiz: {{ quiz_name }}</p> #} +<p>Number of papers: {{ paper_list|length }} </p> + <table border="1" cellpadding="3"> <tr> - <th>Student </th> <th> Roll number </th> <th>Questions answered</th> <th>Total marks</th> + <th> Name </th> + <th> Username </th> + <th> Roll number </th> + <th> Questions answered </th> + <th> Total marks </th> + <th> Attempts </th> </tr> {% for paper in paper_list %} <tr> - <td> {{ paper.username }} </td> + <td> <a href="{{URL_ROOT}}/exam/user_data/{{paper.username}}">{{ paper.name }}</a> </td> + <td> <a href="{{URL_ROOT}}/exam/user_data/{{paper.username}}">{{ paper.username }}</a> </td> <td> {{ paper.rollno }} </td> <td> {{ paper.answered }} </td> <td> {{ paper.total }} </td> - + <td> {{ paper.attempts }} </td> </tr> {% endfor %} </table> -{% else %} +{% else %} {% if quiz_name %} <p> No answer papers so far. </p> + {% endif %} {% endif %} {% endblock content %} diff --git a/templates/exam/user_data.html b/templates/exam/user_data.html new file mode 100644 index 0000000..7560903 --- /dev/null +++ b/templates/exam/user_data.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} + +{% block title %} Data for user {{ user_data.name }} {% endblock title %} + +{% block content %} + +<h1> Data for user {{ user_data.name }} </h1> + +<p> Name: {{ user_data.name }} </p> +<p> Username: {{ user_data.username }} </p> +<p> Roll number: {{ user_data.rollno }} </p> +<p> Email: {{ user_data.email }} </p> + +{% if user_data.papers %} + +{% for paper in user_data.papers %} + +<h2> Quiz: {{ paper.name }} </h2> + +<p> Answered questions: {{ paper.answered }} </p> +<p> Total attempts at questions: {{ paper.attempts }} </p> +<p> Total marks: {{ paper.total }} </p> + +{% if paper.answers %} +<h3> Answers </h3> +{% for question, answer in paper.answers.items %} +<h4> Question summary: {{ question }} </h4> +<pre> +{{ answer|safe }} +</pre> +{% endfor %} +{% endif %} {# if paper.answers #} + +{% endfor %} {# for paper in user_data.papers #} + +{% endif %} {# if user_data.papers #} + +{% endblock content %} |