From c390fcc28c4499e0594b8ff49df283efc4043b26 Mon Sep 17 00:00:00 2001
From: prathamesh
Date: Fri, 1 Apr 2016 18:03:57 +0530
Subject: Resolved minor issues after rebase
---
yaksh/templates/yaksh/question.html | 8 ++++----
yaksh/views.py | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 8976fed..0c48167 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -90,11 +90,11 @@ function call_skip(url)
form.action = url
form.submit();
}
- {% if question.type == 'code' and success == 'True'%}
- {% if to_attempt|length != 0 %}
+ {% if question.type == 'code' and success == 'True'%}
+ {% if paper.questions_left %}
window.setTimeout(function()
{
- {% for qid, num in questions.items %}
+ {% for qid in paper.questions.all %}
location.href="{{ URL_ROOT }}/exam/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/"
{% endfor %}
}, 1000);
@@ -120,7 +120,7 @@ function call_skip(url)
- You have {{ paper.questions_left }} question(s) left in {{ paper.question_paper.quiz.description }}
+ You have {{ paper.questions_left }} question(s) left in {{ paper.question_paper.quiz.description }}
diff --git a/yaksh/views.py b/yaksh/views.py
index d06785f..314814d 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -689,7 +689,10 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None):
else:
# Display the same question if user_answer is None
if not user_answer:
+ ci = RequestContext(request)
msg = "Please submit a valid option or code"
+ context = {'question': question, 'error_message': msg,
+ 'paper': paper}
elif question.type == 'code' and user_answer:
msg = "Correct Output"
success = "True"
@@ -698,9 +701,6 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None):
'error_message': msg, 'success': success}
ci = RequestContext(request)
- context = {'question': question, 'error_message': msg,
- 'paper': paper}
- ci = RequestContext(request)
return my_render_to_response('yaksh/question.html', context,
context_instance=ci)
else:
--
cgit