summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authoradityacp2017-11-20 10:33:05 +0530
committeradityacp2017-11-20 10:33:45 +0530
commite78f61f7b69871662c120daefdfc9d1562fdbe2a (patch)
tree97e3e5f9d094624675b09c8b1993439275b4f734 /yaksh/views.py
parent9abf26990c7cf1dc349567d007955695835a0d3f (diff)
downloadonline_test-e78f61f7b69871662c120daefdfc9d1562fdbe2a.tar.gz
online_test-e78f61f7b69871662c120daefdfc9d1562fdbe2a.tar.bz2
online_test-e78f61f7b69871662c120daefdfc9d1562fdbe2a.zip
Change complete.html and change download quiz csv in views
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 5a97626..28eed91 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -417,12 +417,12 @@ def start(request, questionpaper_id=None, attempt_num=None, course_id=None,
msg = 'Quiz not found, please contact your '\
'instructor/administrator.'
return complete(request, msg, attempt_num, course_id=course_id,
- questionpaper_id=None, module_id=module_id)
+ questionpaper_id=None)
if not quest_paper.has_questions():
msg = 'Quiz does not have Questions, please contact your '\
'instructor/administrator.'
return complete(request, msg, attempt_num, course_id=course_id,
- questionpaper_id=None, module_id=module_id)
+ questionpaper_id=None)
course = Course.objects.prefetch_related("learning_module").get(
id=course_id)
learning_module = course.learning_module.get(id=module_id)
@@ -1073,7 +1073,8 @@ def monitor(request, quiz_id=None, course_id=None):
attempt_numbers = []
else:
if q_paper:
- attempt_numbers = AnswerPaper.objects.get_attempt_numbers(q_paper.last().id)
+ attempt_numbers = AnswerPaper.objects.get_attempt_numbers(
+ q_paper.last().id, course.id)
else:
attempt_numbers = []
latest_attempts = []
@@ -1378,7 +1379,8 @@ def download_quiz_csv(request, course_id, quiz_id):
csv_fields = []
attempt_number = None
question_paper = quiz.questionpaper_set.last()
- last_attempt_number =AnswerPaper.objects.get_attempt_numbers(question_paper.id).last()
+ last_attempt_number = AnswerPaper.objects.get_attempt_numbers(
+ question_paper.id, course.id).last()
if request.method == 'POST':
csv_fields = request.POST.getlist('csv_fields')
attempt_number = request.POST.get('attempt_number', last_attempt_number)