summaryrefslogtreecommitdiff
path: root/testapp/exam/models.py
diff options
context:
space:
mode:
authorprathamesh2014-06-26 17:08:24 +0530
committerprathamesh2014-06-26 17:08:24 +0530
commitf50f2a37a0908a05a4da1d03f9e3c776d32df74c (patch)
tree55566c1b20a5c127091140fdae3d88c50e4ebe07 /testapp/exam/models.py
parentbd70b4d7f748eb3f56ac4b8366e02d113c1be3b9 (diff)
downloadonline_test-f50f2a37a0908a05a4da1d03f9e3c776d32df74c.tar.gz
online_test-f50f2a37a0908a05a4da1d03f9e3c776d32df74c.tar.bz2
online_test-f50f2a37a0908a05a4da1d03f9e3c776d32df74c.zip
changes as per suggestion
Diffstat (limited to 'testapp/exam/models.py')
-rw-r--r--testapp/exam/models.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/testapp/exam/models.py b/testapp/exam/models.py
index 5bb94fd..eb270ae 100644
--- a/testapp/exam/models.py
+++ b/testapp/exam/models.py
@@ -119,7 +119,7 @@ class Quiz(models.Model):
pass_criteria = models.FloatField("Passing percentage", default=40)
# List of prerequisite quizzes to be passed to take this quiz
- prerequisite = models.ForeignKey("self", null=True)
+ prerequisite = models.ForeignKey("Quiz", null=True)
# Programming language for a quiz
language = models.CharField(max_length=20, choices=LANGUAGES)
@@ -161,7 +161,6 @@ class QuestionPaper(models.Model):
for question_set in self.random_questions.all():
marks += question_set.marks * question_set.num_questions
self.total_marks = marks
- return None
def _get_questions_for_answerpaper(self):
""" Returns fixed and random questions for the answer paper"""
@@ -324,7 +323,6 @@ class AnswerPaper(models.Model):
"""Updates the total marks earned by student for this paper."""
marks = sum([x.marks for x in self.answers.filter(marks__gt=0.0)])
self.marks_obtained = marks
- return None
def update_percent(self):
"""Updates the percent gained by the student for this paper."""
@@ -332,7 +330,6 @@ class AnswerPaper(models.Model):
if self.marks_obtained is not None:
percent = self.marks_obtained/self.question_paper.total_marks*100
self.percent = round(percent, 2)
- return None
def update_result(self):
"""
@@ -344,7 +341,6 @@ class AnswerPaper(models.Model):
self.result = "PASSED"
else:
self.result = "FAILED"
- return None
def get_question_answers(self):
"""