diff options
author | hardythe1 | 2014-07-02 13:04:00 +0530 |
---|---|---|
committer | hardythe1 | 2014-07-02 13:04:00 +0530 |
commit | 6e0a770f36a88c82f948628255d9dd8a8ead8580 (patch) | |
tree | de125abf7ba765794e08ea320fbf701e4d9c1450 /testapp/exam | |
parent | c8af24bf0adf393fb2e61bff06b54d00633e16d1 (diff) | |
download | online_test-6e0a770f36a88c82f948628255d9dd8a8ead8580.tar.gz online_test-6e0a770f36a88c82f948628255d9dd8a8ead8580.tar.bz2 online_test-6e0a770f36a88c82f948628255d9dd8a8ead8580.zip |
changes to start the quiz if prerequisite is passed
Diffstat (limited to 'testapp/exam')
-rw-r--r-- | testapp/exam/views.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 3e11ed5..8b84920 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -168,16 +168,18 @@ def intro(request, questionpaper_id): user = request.user ci = RequestContext(request) quest_paper = QuestionPaper.objects.get(id=questionpaper_id) + print quest_paper.quiz.prerequisite if quest_paper.quiz.prerequisite: try: + pre_quest = QuestionPaper.objects.get(quiz=quest_paper.quiz.prerequisite) answer_paper = AnswerPaper.objects.get( - quest_paper.quiz=quest_paper.quiz.prerequisite, + question_paper=pre_quest, user=user) if answer_paper.passed: context = {'user': user, 'paper_id': questionpaper_id} return my_render_to_response('exam/intro.html', context, context_instance=ci) - else: + else: else: context = {'user': user, 'cannot_attempt':True} return my_redirect("/exam/quizzes/?cannot_attempt=True") |