diff options
-rw-r--r-- | yaksh/templates/yaksh/complete.html | 8 | ||||
-rw-r--r-- | yaksh/views.py | 10 |
2 files changed, 13 insertions, 5 deletions
diff --git a/yaksh/templates/yaksh/complete.html b/yaksh/templates/yaksh/complete.html index 585129d..5c954da 100644 --- a/yaksh/templates/yaksh/complete.html +++ b/yaksh/templates/yaksh/complete.html @@ -31,13 +31,19 @@ {% endif %} <center><h2> Good bye! </h2></center> <center><h4> {{message}} </h4></center> + {% if not module_id %} <br><center><h4>You may now close the browser.</h4></center><br> - <center> + {% endif %} + <center> <a href="{{URL_ROOT}}/exam/" id="home" class="btn btn-success"> Home </a> + </center> + {% if module_id %} + <center> {% if first_unit %} <a href="{{URL_ROOT}}/exam/next_unit/{{course_id}}/{{module_id}}/{{learning_unit.id}}/1" class="btn btn-info"> Next Unit </a> {% else %} <a href="{{URL_ROOT}}/exam/next_unit/{{course_id}}/{{module_id}}/{{learning_unit.id}}" class="btn btn-info"> Next Unit </a> {% endif %} </center> + {% endif %} {% endblock content %} 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) |