From 30f56443790841901f15b5ab435f97fba1c81d85 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Wed, 23 Nov 2011 14:58:16 +0530 Subject: ENH: Cleanup and adding error/comments for answers Adding error and marks field to each answer. Adding a new comment field to the question paper and also a profile field for convenience. Changing the views, templates and dump scripts to use the models rather than Python code. This cleans things up a lot more. The user data logged and printed is also way more comprehensive, paving the way for easy online grading as well in the next phase of changes. --- templates/exam/monitor.html | 34 +++++++++++++------------ templates/exam/user_data.html | 59 +++++++++++++++++++++++++------------------ 2 files changed, 52 insertions(+), 41 deletions(-) (limited to 'templates') diff --git a/templates/exam/monitor.html b/templates/exam/monitor.html index 1ce6c69..8f34a7f 100644 --- a/templates/exam/monitor.html +++ b/templates/exam/monitor.html @@ -6,7 +6,7 @@ {% block content %} -{% if not quiz_data and not paper_list %} +{% if not quizzes and not papers %}
No quizzes available.
@@ -15,23 +15,23 @@ {# ############################################################### #} {# This is rendered when we are just viewing exam/monitor #} -{% if quiz_data %} +{% if quizzes %}Quiz: {{ quiz_name }}
#} -Number of papers: {{ paper_list|length }}
+Number of papers: {{ papers|length }}
Total marks | Attempts | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ paper.name.title }} | -{{ paper.username }} | -{{ paper.rollno }} | -{{ paper.institute }} | -{{ paper.answered }} | -{{ paper.total }} | -{{ paper.attempts }} | ++ {{ paper.user.get_full_name.title }} | ++ {{ paper.user.username }} | +{{ paper.profile.roll_number }} | +{{ paper.profile.institute }} | +{{ paper.get_answered_str }} | +{{ paper.get_total_marks }} | +{{ paper.answers.count }} |
No answer papers so far.
{% endif %} {% endif %} diff --git a/templates/exam/user_data.html b/templates/exam/user_data.html index c2e8014..7563e0e 100644 --- a/templates/exam/user_data.html +++ b/templates/exam/user_data.html @@ -1,49 +1,58 @@ {% extends "base.html" %} -{% block title %} Data for user {{ user_data.name.title }} {% endblock title %} +{% block title %} Data for user {{ data.user.get_full_name.title }} {% endblock title %} {% block content %} -
-Name: {{ user_data.name.title }}
-Username: {{ user_data.username }}
-Roll number: {{ user_data.rollno }}
-Email: {{ user_data.email }}
-Position: {{ user_data.position }}
-Department: {{ user_data.department }}
-Institute: {{ user_data.institute }}
-Date joined: {{ user_data.date_joined }}
-Last login: {{ user_data.last_login }}
+Name: {{ data.user.get_full_name.title }}
+Username: {{ data.user.username }}
+{% if data.profile %}
+Roll number: {{ data.profile.roll_number }}
+Position: {{ data.profile.position }}
+Department: {{ data.profile.department }}
+Institute: {{ data.profile.institute }}
+{% endif %}
+Email: {{ data.user.email }}
+Date joined: {{ data.user.date_joined }}
+Last login: {{ data.user.last_login }}
-Answered questions: {{ paper.answered }}
-Total attempts at questions: {{ paper.attempts }}
-Total marks: {{ paper.total }}
+Questions correctly answered: {{ paper.get_answered_str }}
+Total attempts at questions: {{ paper.answers.count }}
+Marks obtained: {{ paper.get_total_marks }}
Start time: {{ paper.start_time }}
User IP address: {{ paper.user_ip }}
Question: {{ question }}
+{% for question, answers in paper.get_question_answers.items %} +Question: {{ question.id }}. {{ question.summary }} (Points: {{ question.points }})
+{% for answer in answers %}-{{ answer|safe }} +################################################################################ +{{ answer.answer|safe }} +# Autocheck: {{ answer.error }} +# Marks: {{ answer.marks }}-{% endfor %} -{% endif %} {# if paper.answers #} +{% endfor %} {# for answer in answers #} +{% endfor %} {# for question, answers ... #} +