From c2185243e9e3e8a66a2a4c7a549d9bc00fd9f2fa Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Mon, 21 Nov 2011 02:41:27 +0530 Subject: 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. --- templates/exam/monitor.html | 41 ++++++++++++++++++++++++++++++++++++----- templates/exam/user_data.html | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 templates/exam/user_data.html (limited to 'templates/exam') 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 %} {% endblock meta %} {% block content %} -
No quizzes available.
+ +{% endif %} + +{# ############################################################### #} +{# This is rendered when we are just viewing exam/monitor #} +{% if quiz_data %} +Quiz: {{ quiz_name }}
#} +Number of papers: {{ paper_list|length }}
+Student | Roll number | Questions answered | Total marks | +Name | +Username | +Roll number | +Questions answered | +Total marks | +Attempts |
---|---|---|---|---|---|---|---|---|---|
{{ paper.username }} | +{{ paper.name }} | +{{ paper.username }} | {{ paper.rollno }} | {{ paper.answered }} | {{ paper.total }} | - +{{ paper.attempts }} |
No answer papers so far.
+ {% 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 %} + +Name: {{ user_data.name }}
+Username: {{ user_data.username }}
+Roll number: {{ user_data.rollno }}
+Email: {{ user_data.email }}
+ +{% if user_data.papers %} + +{% for paper in user_data.papers %} + +Answered questions: {{ paper.answered }}
+Total attempts at questions: {{ paper.attempts }}
+Total marks: {{ paper.total }}
+ +{% if paper.answers %} ++{{ answer|safe }} ++{% endfor %} +{% endif %} {# if paper.answers #} + +{% endfor %} {# for paper in user_data.papers #} + +{% endif %} {# if user_data.papers #} + +{% endblock content %} -- cgit