summaryrefslogtreecommitdiff
path: root/testapp/exam
diff options
context:
space:
mode:
authorprathamesh2015-03-04 17:13:14 +0530
committerprathamesh2015-03-04 17:13:14 +0530
commit3f9be69fd9af4a169feb1a49e6d89839073b4da5 (patch)
treea42476d4fe065903593766c54855baa3418e7462 /testapp/exam
parente7e82959bb819e60ef5ab21f1950404d20e661a8 (diff)
downloadonline_test-3f9be69fd9af4a169feb1a49e6d89839073b4da5.tar.gz
online_test-3f9be69fd9af4a169feb1a49e6d89839073b4da5.tar.bz2
online_test-3f9be69fd9af4a169feb1a49e6d89839073b4da5.zip
Corrected a logical issue in the random questions for question paper generation.
Diffstat (limited to 'testapp/exam')
-rw-r--r--testapp/exam/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/testapp/exam/views.py b/testapp/exam/views.py
index c6e3024..474fa2f 100644
--- a/testapp/exam/views.py
+++ b/testapp/exam/views.py
@@ -1155,7 +1155,8 @@ def design_questionpaper(request):
question_paper.fixed_questions.add(question_id)
if random_questions:
for random_question, num in zip(random_questions, random_number):
- question = Question.objects.get(id=random_question[0])
+ qid = random_question.split(',')[0]
+ question = Question.objects.get(id=int(qid))
marks = question.points
question_set = QuestionSet(marks=marks, num_questions=num)
question_set.save()