summaryrefslogtreecommitdiff
path: root/testapp/exam/models.py
diff options
context:
space:
mode:
authorprathamesh2014-06-27 17:29:33 +0530
committerprathamesh2014-06-27 17:29:33 +0530
commitc7a2f3c83f0d53741e53e0e21276aefaea8a5c28 (patch)
tree15ad3a81f86e5c362262b0744e70ae7a6d4d058b /testapp/exam/models.py
parentfaacb5ba720abc9660e1afa12c9a3c4d0761254f (diff)
parent3c82dd0faf2f1273cb590b360a9696a973b30720 (diff)
downloadonline_test-c7a2f3c83f0d53741e53e0e21276aefaea8a5c28.tar.gz
online_test-c7a2f3c83f0d53741e53e0e21276aefaea8a5c28.tar.bz2
online_test-c7a2f3c83f0d53741e53e0e21276aefaea8a5c28.zip
Merge branch 'model_modification' into multiple_correct_type
Diffstat (limited to 'testapp/exam/models.py')
-rw-r--r--testapp/exam/models.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/testapp/exam/models.py b/testapp/exam/models.py
index 0d31b16..4d82783 100644
--- a/testapp/exam/models.py
+++ b/testapp/exam/models.py
@@ -249,8 +249,8 @@ class AnswerPaper(models.Model):
# Marks percent scored by the user
percent = models.FloatField(null=True, default=None)
- # Result of the quiz, pass if True.
- result = models.NullBooleanField()
+ # Result of the quiz, True if student passes the exam.
+ passed = models.NullBooleanField()
def current_question(self):
"""Returns the current active question to display."""
@@ -332,16 +332,16 @@ class AnswerPaper(models.Model):
percent = self.marks_obtained/self.question_paper.total_marks*100
self.percent = round(percent, 2)
- def update_result(self):
+ def update_passed(self):
"""
- Updates the result.
- It is either passed or failed, as per the quiz passing criteria
+ Checks whether student passed or failed, as per the quiz
+ passing criteria.
"""
if self.percent is not None:
if self.percent >= self.question_paper.quiz.pass_criteria:
- self.result = True
+ self.passed = True
else:
- self.result = False
+ self.passed = False
def get_question_answers(self):
"""