From 18288cbb0dadca66c71ec5abb854d726ca6e27d8 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Wed, 7 Sep 2016 15:35:20 +0530 Subject: students can view questions, beautified view_answerpaper.html --- yaksh/static/yaksh/css/view_answerpaper.css | 61 ++++++++++++++++++++++++++++ yaksh/templates/yaksh/view_answerpaper.html | 62 +++++++++++++++++++++-------- 2 files changed, 107 insertions(+), 16 deletions(-) create mode 100644 yaksh/static/yaksh/css/view_answerpaper.css (limited to 'yaksh') diff --git a/yaksh/static/yaksh/css/view_answerpaper.css b/yaksh/static/yaksh/css/view_answerpaper.css new file mode 100644 index 0000000..50eab55 --- /dev/null +++ b/yaksh/static/yaksh/css/view_answerpaper.css @@ -0,0 +1,61 @@ +.panel { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: 0 1px 1px rgba(0, 0, 0, .05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} + .panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-body > pre > code { + background-color:transparent; + color: red; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-body > pre > code { + background-color:transparent; + color: green; +} +.marks{ + float:right; +} +mark{ + background-color: #dff0d8; +} +code{ + background-color: transparent; +} +pre{ + background-color: transparent; +} \ No newline at end of file diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html index ae70e69..a213d7b 100644 --- a/yaksh/templates/yaksh/view_answerpaper.html +++ b/yaksh/templates/yaksh/view_answerpaper.html @@ -1,4 +1,7 @@ {% extends "user.html" %} +{% block css %} + +{% endblock %} {% block title %} Answer Paper for {{ quiz.description }}{% endblock title %} @@ -6,7 +9,6 @@ {% block subtitle %} Answer Paper for {{ quiz.description }}{% endblock %} - {% if not data.papers %}

You have not attempted the quiz {{ quiz.description }}

{% else %} @@ -24,29 +26,57 @@

{% if paper.answers.count %} -

Answers

+

Answerpaper:

{% for question, answers in paper.get_question_answers.items %} -

Question: {{ question.id }}. {{ question.summary }} (Mark(s): {{ question.points }})

+ +
+
+ Details: {{forloop.counter}}. {{ question.summary }} + Mark(s): {{ question.points }} + +
+
+
Question:
{{ question.description|safe }} + {% if question.type == "mcq" or question.type == "mcc" %} +
Choices:
+ {% for testcase in question.get_test_cases %} +
{{ forloop.counter }}.  {{ testcase.options }} + {% endfor %} + {%endif%} + +
+
{% if question.type == "mcq" or question.type == "mcc" %} -

Choices: - {% for testcase in question.get_test_cases %}
{{ testcase.options }} {% endfor %} -

-

Student answer: {{ answers.0 }}

- Autocheck: {{ answers.0.error }} - {% else %}{# non-mcq questions #} -

Student answer:

+ {% 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 not answer.skipped %} -
-    ###############################################################################
-    {{ answer.answer.strip }}
-    # Autocheck: {{ answer.error }}
-    
+ {% if "Correct answer" in answer.error %} +
+ {% else %} +
+ {% endif %} +
Autocheck: {{ answer.error }}
+
{{ answer.answer.strip }}
+
{% endif %} {% endfor %} {% endif %} {% with answers|last as answer %} -

Obtained Marks: {{answer.marks}}

+

Obtained Marks: {{answer.marks}}

{% endwith %}
{% endfor %} {# for question, answers ... #} -- cgit From bd0ed17050159e4ca3ba4493bdc520f26d85120c Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Thu, 8 Sep 2016 08:17:25 +0530 Subject: changed template to add end_time and status details in answerpaper --- yaksh/templates/yaksh/view_answerpaper.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'yaksh') diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html index a213d7b..9227561 100644 --- a/yaksh/templates/yaksh/view_answerpaper.html +++ b/yaksh/templates/yaksh/view_answerpaper.html @@ -23,6 +23,13 @@ Questions correctly answered: {{ paper.get_answered_str }}
Marks obtained: {{ paper.marks_obtained }}
Start time: {{ paper.start_time }}
+ End time : {{ paper.end_time }}
+ Percentage obtained: {{ paper.percent }}%
+ {% if paper.passed == 0 %} + Status : Failed
+ {% else %} + Status : Passed
+ {% endif %}

{% if paper.answers.count %} @@ -40,7 +47,7 @@ {% if question.type == "mcq" or question.type == "mcc" %}
Choices:
{% for testcase in question.get_test_cases %} -
{{ forloop.counter }}.  {{ testcase.options }} +
{{ forloop.counter }}. {{ testcase.options }} {% endfor %} {%endif%} -- cgit