From 3f9be69fd9af4a169feb1a49e6d89839073b4da5 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Wed, 4 Mar 2015 17:13:14 +0530 Subject: Corrected a logical issue in the random questions for question paper generation. --- testapp/exam/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'testapp') 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() -- cgit