From 15de9ce5fe9d1e456bfae60090807a77c6afef0a Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 18 Nov 2016 16:10:22 +0530 Subject: Fix output rendering in the question --- yaksh/templates/yaksh/question.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 74ac786..c3babaa 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -209,11 +209,19 @@ function call_skip(url) {% if question.type == "code" %} @@ -156,14 +156,19 @@ Status : Passed
{% else %}
Student answer:
{% for answer in answers %} - {% if not answer.skipped %} - {% if answer.correct %} + {% if not answer.0.skipped %} + {% if answer.0.correct %}
+
Correct: {% else %}
+
Error: {% endif %} -
Autocheck: {{ answer.error }}
-
{{ answer.answer.strip }}
+ {% for err in answer.1 %} +
{{ err }}
+ {% endfor %} +
+
{{ answer.0.answer.strip }}
{% endif %} {% endfor %} @@ -171,7 +176,7 @@ Status : Passed
{% with answers|last as answer %} Marks:

+ value="{{ answer.0.marks }}">

{% endwith %}
{% endfor %} {# for question, answers ... #} -- cgit From 42ed7c142e2c4ff4dccdaec2365e22d30bc276dd Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 22 Dec 2016 15:55:54 +0530 Subject: Refactor check method for cleaner code and fixing multiple issues - Question should skip to new question with new error rendering - Fix test cases Fix change_dir context manager in grader --- yaksh/templates/yaksh/grade_user.html | 1 - 1 file changed, 1 deletion(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 4fc5026..516a6d0 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -156,7 +156,6 @@ Status : Passed
{% else %}
Student answer:
{% for answer in answers %} - {% if not answer.0.skipped %} {% if answer.0.correct %}
Correct: -- cgit From 0e56fc6a77ec21db05c9bafb42b1acc652354a32 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 22 Dec 2016 20:16:00 +0530 Subject: - Fix grade user rendering issue when question is skipped - Modify grade user html template to create readable variables for answer and error --- yaksh/templates/yaksh/grade_user.html | 26 +++++--------------------- yaksh/templates/yaksh/question.html | 24 ++++++++++++++++++++---- 2 files changed, 25 insertions(+), 25 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 516a6d0..6fb8187 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -118,6 +118,7 @@ Status : Passed
method="post"> {% csrf_token %} {% for question, answers in paper.get_question_answers.items %} +
Details: {{forloop.counter}}. {{ question.summary }} @@ -139,39 +140,22 @@ Status : Passed
{%endif%}
- {% if question.type == "mcq" or question.type == "mcc" %} - {% if "Correct answer" in answers.0.error %} -
- {% else %} -
- {% endif %} -
- Autocheck: {{ answers.0.error }} -
-
-
Student answer:
-
{{forloop.counter}}. {{ answers.0 }}
-
-
- {% else %}
Student answer:
- {% for answer in answers %} - {% if answer.0.correct %} + {% for ans in answers %} + {% if ans.answer.correct %}
Correct: {% else %}
Error: {% endif %} - {% for err in answer.1 %} + {% for err in ans.error_list %}
{{ err }}
{% endfor %}
-
{{ answer.0.answer.strip }}
+
{{ ans.answer.answer.strip }}
- {% endif %} {% endfor %} - {% endif %} {% with answers|last as answer %} Marks: {% if question.type == "mcq" %} {% if error_message %} -

{{ error_message }}

- {% endif %} +

+

+
+ {% for err in error_message %} + {{ err }} + {% endfor %} +
+
+

+ {% endif %} {% for test_case in test_cases %} {{ test_case.options }}
{% endfor %} {% endif %} {% if question.type == "mcc" %} {% if error_message %} -

{{ error_message }}

- {% endif %} +

+

+
+ {% for err in error_message %} + {{ err }} + {% endfor %} +
+
+

+ {% endif %} {% for test_case in test_cases %} {{ test_case.options }}
-- cgit