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 %} -Question: {{ question.id }}. {{ question.summary }} (Mark(s): {{ question.points }})
+ + 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 %} +{{forloop.counter}}. {{ answers.0 }}
+ - ############################################################################### - {{ answer.answer.strip }} - # Autocheck: {{ answer.error }} -+ {% if "Correct answer" in answer.error %} +
{{ answer.answer.strip }}
Obtained Marks: {{answer.marks}}
+Obtained Marks: {{answer.marks}}
{% endwith %}