From 9484e8bebcd4363fa3aa1c2fc842de1bdcc25a10 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 23 Feb 2017 17:33:07 +0530 Subject: Allow revisiting all types of question to resubmit answer --- yaksh/models.py | 3 ++- yaksh/templates/exam.html | 4 +++- yaksh/templates/yaksh/user_data.html | 4 ++-- yaksh/views.py | 21 +++++++++++---------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/yaksh/models.py b/yaksh/models.py index 2d84622..61c9059 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -988,7 +988,8 @@ class AnswerPaper(models.Model): questions and returns the next question. """ next_question = self.next_question(question_id) - self.questions_answered.add(question_id) + if question_id not in self.questions_answered.all(): + self.questions_answered.add(question_id) self.questions_unanswered.remove(question_id) if next_question.id == int(question_id): return None diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index b497cc0..02ff70a 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -52,7 +52,9 @@ {% endif %} {% endif %} {% if qid in paper.get_questions_answered %} -
{{ answer.answer.answer.strip }}