--- a/event/views.py Thu Jul 01 16:13:01 2010 +0530
+++ b/event/views.py Thu Jul 01 16:20:17 2010 +0530
@@ -7,7 +7,7 @@
from offline.event.models import Event
from offline.event.forms import EventCreateForm, OpenQuizForm
-from offline.quiz.models import Quiz, QuestionBank
+from offline.quiz.models import Quiz, QuestionBank, TOPIC_CHOICES
from offline.quiz.utils import correct_quiz
num2name = {"11" : "Day 1 Quiz 1",
@@ -203,5 +203,9 @@
"""
questions = QuestionBank.objects.all()
+ topic_num2name = dict(TOPIC_CHOICES)
+
+ for question in questions:
+ question.topic_name = topic_num2name[question.topic]
return render_to_response("list_questions.html", {"questions":questions})
--- a/templates/list_questions.html Thu Jul 01 16:13:01 2010 +0530
+++ b/templates/list_questions.html Thu Jul 01 16:20:17 2010 +0530
@@ -9,7 +9,7 @@
{% for question in questions %}
<tr>
<td><a href="/quiz/questions/ditchax/question.id">{{question.description}}</a></td>
-<td>{{question.topic}}</td>
+<td>{{question.topic_name}}</td>
</tr>
{% endfor %}
</table>