summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/models.py4
-rw-r--r--yaksh/templates/yaksh/user_data.html8
-rw-r--r--yaksh/views.py2
3 files changed, 10 insertions, 4 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 6e1744c..4fd6967 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -1027,9 +1027,9 @@ class AnswerPaper(models.Model):
for answer in self.answers.all():
question = answer.question
if question in q_a:
- q_a[question].append(answer)
+ q_a[question].append((answer, [e for e in json.loads(answer.error)]))
else:
- q_a[question] = [answer]
+ q_a[question] = [(answer, [e for e in json.loads(answer.error)])]
return q_a
def get_questions(self):
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index 378e7fd..856433d 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -99,7 +99,13 @@ User IP address: {{ paper.user_ip }}
{% else %}
<div class="panel panel-danger">
{% endif %}
- <div class="panel-heading">Autocheck: {{ answer.error }}</div>
+ <div class="panel-heading">
+ {% for error in error %}
+ <div class="panel-body">
+ <pre><code>{{ error }}</code></pre>
+ </div>
+ {% endfor %}
+ </div>
<div class="panel-body"><pre><code>{{ answer.answer.strip }}</code></pre></div>
</div>
{% endif %}
diff --git a/yaksh/views.py b/yaksh/views.py
index c330a75..b92b3fe 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1044,7 +1044,7 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None):
if request.method == "POST":
papers = data['papers']
for paper in papers:
- for question, answers in six.iteritems(paper.get_question_answers()):
+ for question, answers, errors in six.iteritems(paper.get_question_answers()):
marks = float(request.POST.get('q%d_marks' % question.id, 0))
answers = answers[-1]
answers.set_marks(marks)