diff options
author | Prabhu Ramachandran | 2016-08-31 17:36:03 +0530 |
---|---|---|
committer | GitHub | 2016-08-31 17:36:03 +0530 |
commit | 27e7a443ef132e04cc5aeece7a5bf34d0687f482 (patch) | |
tree | 5107b580ad56199f021bdaeac04af71a7921f490 /yaksh/templates | |
parent | aefc8eed3b0c18520059b4005978f1db9cf5591b (diff) | |
parent | 18cbf091f991cd205a07c87db0ddde980bef34e2 (diff) | |
download | online_test-27e7a443ef132e04cc5aeece7a5bf34d0687f482.tar.gz online_test-27e7a443ef132e04cc5aeece7a5bf34d0687f482.tar.bz2 online_test-27e7a443ef132e04cc5aeece7a5bf34d0687f482.zip |
Merge pull request #129 from prathamesh920/view_answerpaper
View answerpaper
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/base.html | 1 | ||||
-rw-r--r-- | yaksh/templates/manage.html | 1 | ||||
-rw-r--r-- | yaksh/templates/user.html | 1 | ||||
-rw-r--r-- | yaksh/templates/yaksh/login.html | 1 | ||||
-rw-r--r-- | yaksh/templates/yaksh/quizzes_user.html | 8 | ||||
-rw-r--r-- | yaksh/templates/yaksh/user_data.html | 7 | ||||
-rw-r--r-- | yaksh/templates/yaksh/view_answerpaper.html | 61 |
7 files changed, 76 insertions, 4 deletions
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index 17df0d9..7fe2d27 100644 --- a/yaksh/templates/base.html +++ b/yaksh/templates/base.html @@ -16,6 +16,7 @@ <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/bootstrap.min.css"> <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/base.css"> + <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/font-awesome.css" type="text/css" /> <style> body { diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html index 334f6a2..2fd0f7a 100644 --- a/yaksh/templates/manage.html +++ b/yaksh/templates/manage.html @@ -13,6 +13,7 @@ <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/base.css" type="text/css" /> <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/manage.css" type="text/css" /> + <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/font-awesome.css" type="text/css" /> {% block css %} {% endblock %} <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.4.2.min.js"></script> diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html index 009dd2f..4805c2d 100644 --- a/yaksh/templates/user.html +++ b/yaksh/templates/user.html @@ -15,6 +15,7 @@ {% endblock %} <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/base.css" type="text/css" /> + <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/font-awesome.css" type="text/css" /> {% block css %} {% endblock %} diff --git a/yaksh/templates/yaksh/login.html b/yaksh/templates/yaksh/login.html index 0a78c1b..5694f75 100644 --- a/yaksh/templates/yaksh/login.html +++ b/yaksh/templates/yaksh/login.html @@ -6,7 +6,6 @@ {% block css %} <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/bootstrap-social.css" type="text/css" /> <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/login.css" type="text/css" /> -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/font-awesome.css" type="text/css" /> {% endblock %} {% block content %} diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index 6403a21..98c156b 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -48,6 +48,7 @@ {% endif %} <table> <th>Quiz</th> + <th>View Answer Paper</th> <th>Pre requisite quiz</th> {% for quiz in quizzes %} {% if quiz.course_id == course.id %} @@ -63,6 +64,13 @@ </td> {% endif %} <td> + {% if quiz.view_answerpaper %} + <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ quiz.questionpaper_set.get.id }}/"><i class="fa fa-eye" aria-hidden="true"></i> Can View </a> + {% else%} + <a><i class="fa fa-eye-slash" aria-hidden="true"></i> Cannot view now </a> + {% endif %} + </td> + <td> {% if quiz.prerequisite %} You have to pass {{ quiz.prerequisite.description }} for taking {{ paper.quiz.description }} {% else %} diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 2e7db50..1060e2d 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -50,11 +50,12 @@ User IP address: {{ paper.user_ip }} <h3> Answers </h3> {% for question, answers in paper.get_question_answers.items %} <p><strong> Question: {{ question.id }}. {{ question.summary }} (Points: {{ question.points }})</strong> </p> -{% if question.type == "mcq" %} -<p> Choices: -{% for option in question.options.strip.splitlines %} {{option}}, {% endfor %} +{% if question.type == "mcq" or question.type == "mcc" %} +<p> Choices: +{% for testcase in question.get_test_cases %} <br>{{ testcase.options }} {% endfor %} </p> <p>Student answer: {{ answers.0 }}</p> +Autocheck: {{ answers.0.error }} {% else %}{# non-mcq questions #} {% for answer in answers %} {% if not answer.skipped %} diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html new file mode 100644 index 0000000..ae70e69 --- /dev/null +++ b/yaksh/templates/yaksh/view_answerpaper.html @@ -0,0 +1,61 @@ +{% extends "user.html" %} + +{% block title %} Answer Paper for {{ quiz.description }}{% endblock title %} + +{% block manage %} + +{% block subtitle %} Answer Paper for {{ quiz.description }}{% endblock %} + + +{% if not data.papers %} + <p><b> You have not attempted the quiz {{ quiz.description }} </b></p> +{% else %} + {% for paper in data.papers %} + {% if forloop.counter == 2 and data.questionpaperid %} + <U><h2> Previous attempts </h2></U> + {% endif %} + <h2> Quiz: {{ paper.question_paper.quiz.description }} </h2> + + <p> + Attempt Number: {{ paper.attempt_number }}<br/> + Questions correctly answered: {{ paper.get_answered_str }} <br/> + Marks obtained: {{ paper.marks_obtained }} <br/> + Start time: {{ paper.start_time }} <br/> + </p> + + {% if paper.answers.count %} + <h3> Answers </h3> + {% for question, answers in paper.get_question_answers.items %} + <p><strong> Question: {{ question.id }}. {{ question.summary }} (Mark(s): {{ question.points }})</strong> </p> + {% if question.type == "mcq" or question.type == "mcc" %} + <p> Choices: + {% for testcase in question.get_test_cases %} <br>{{ testcase.options }} {% endfor %} + </p> + <p>Student answer: {{ answers.0 }}</p> + Autocheck: {{ answers.0.error }} + {% else %}{# non-mcq questions #} + <p>Student answer: </p> + {% for answer in answers %} + {% if not answer.skipped %} + <pre> + ############################################################################### + {{ answer.answer.strip }} + # Autocheck: {{ answer.error }} + </pre> + {% endif %} + {% endfor %} + {% endif %} + {% with answers|last as answer %} + <p><em>Obtained Marks: {{answer.marks}} </em> </p> + {% endwith %} + <hr> + {% endfor %} {# for question, answers ... #} + <h3>Teacher comments: </h3> + {{ paper.comments|default:"None" }} + <hr><hr> + {% endif %} {# if paper.answers.count #} + + {% endfor %} {# for paper in data.papers #} + +{% endif %} {# if not data.papers #} +{% endblock %} |