From 60503c9bd1ea49177f0adfc39ff129bfba86c9de Mon Sep 17 00:00:00 2001
From: prathamesh
Date: Fri, 27 Nov 2020 04:18:27 +0530
Subject: Fix answer paper view.
- Slight optimisation in retrieving and rendering the data
- avoids the arrange type question's custom filter error
- Marks obtained appears properly on all the interface(user view
answerpaper, monitor and grade user)
- if not attempted then shows the question and says "Did not attempt"
---
yaksh/templates/yaksh/grade_user.html | 14 +++++++-------
yaksh/templates/yaksh/user_data.html | 17 ++++++++---------
yaksh/templates/yaksh/view_answerpaper.html | 14 +++++++-------
3 files changed, 22 insertions(+), 23 deletions(-)
(limited to 'yaksh/templates')
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html
index 341fd7c..64b9cb5 100644
--- a/yaksh/templates/yaksh/grade_user.html
+++ b/yaksh/templates/yaksh/grade_user.html
@@ -319,7 +319,6 @@ function searchNames() {
{% for question, answers in paper.get_question_answers.items %}
- {% with answers|last as answer %}
@@ -327,14 +326,13 @@ function searchNames() {
|
{{ question.type }} |
- {{ answer.marks }} |
+ {{ answers|last }} |
Regrade
|
- {% endwith %}
{% endfor %}
@@ -437,7 +435,10 @@ function searchNames() {
{% endif %}
{% else %}
- {% for ans in answers %}
+ {% if answers|first is None %}
+ Did not attempt
+ {% else %}
+ {% for ans in answers|slice:":-1" %}
Attempt Number: {{forloop.counter}}
@@ -559,6 +560,7 @@ function searchNames() {
{% endfor %}
+ {% endif %}
{% endif %}
@@ -566,9 +568,7 @@ function searchNames() {
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index a79071d..0506df0 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -78,11 +78,7 @@
{{question.summary}} |
{{question.type}} |
-
- {% for answer in answers %}
- {{answer.marks}}
- {% endfor %}
- |
+ {{ answers|last }} |
{% endfor %}
@@ -181,7 +177,11 @@
{% endif %}
{% else %}
- {% for ans in answers %}
+
+ {% if answers|first is None %}
+ Did not attempt
+ {% else %}
+ {% for ans in answers|slice:":-1" %}
Attempt Number: {{forloop.counter}}
@@ -303,6 +303,7 @@
{% endfor %}
+ {% endif %}
{% endif %}
@@ -310,9 +311,7 @@
diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html
index 905a111..775525e 100644
--- a/yaksh/templates/yaksh/view_answerpaper.html
+++ b/yaksh/templates/yaksh/view_answerpaper.html
@@ -80,7 +80,6 @@
{% for question, answers in paper.get_question_answers.items %}
- {% with answers|last as answer %}
@@ -88,9 +87,8 @@
|
{{ question.type }} |
- {{ answer.answer.marks }} |
+ {{ answers|last }}{{ answer.answer.marks }} |
- {% endwith %}
{% endfor %}
@@ -200,7 +198,10 @@
{% endif %}
{% else %}
- {% for ans in answers %}
+ {% if answers|first is None %}
+ Did not attempt
+ {% else %}
+ {% for ans in answers|slice:":-1" %}
Attempt Number: {{forloop.counter}}
@@ -324,6 +325,7 @@
{% endfor %}
+ {% endif %}
{% endif %}
@@ -331,9 +333,7 @@
--
cgit