summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorankitjavalkar2016-12-22 20:16:00 +0530
committerankitjavalkar2016-12-22 20:32:48 +0530
commit0e56fc6a77ec21db05c9bafb42b1acc652354a32 (patch)
treeadb07f2709621b8906b5047da02010958bebba67 /yaksh/views.py
parent42ed7c142e2c4ff4dccdaec2365e22d30bc276dd (diff)
downloadonline_test-0e56fc6a77ec21db05c9bafb42b1acc652354a32.tar.gz
online_test-0e56fc6a77ec21db05c9bafb42b1acc652354a32.tar.bz2
online_test-0e56fc6a77ec21db05c9bafb42b1acc652354a32.zip
- Fix grade user rendering issue when question is skipped
- Modify grade user html template to create readable variables for answer and error
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 35121e7..7ecf6aa 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -430,7 +430,8 @@ def skip(request, q_id, next_q=None, attempt_num=None, questionpaper_id=None):
if request.method == 'POST' and question.type == 'code':
user_code = request.POST.get('answer')
new_answer = Answer(question=question, answer=user_code,
- correct=False, skipped=True)
+ correct=False, skipped=True,
+ error=json.dumps([]))
new_answer.save()
paper.answers.add(new_answer)
if next_q is not None:
@@ -479,7 +480,7 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None):
msg = ["Please submit a valid option or code"]
return show_question(request, current_question, paper, msg)
new_answer = Answer(question=current_question, answer=user_answer,
- correct=False)
+ correct=False, error=json.dumps([]))
new_answer.save()
paper.answers.add(new_answer)
# If we were not skipped, we were asked to check. For any non-mcq