diff options
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/base.html | 1 | ||||
-rw-r--r-- | yaksh/templates/manage.html | 9 | ||||
-rw-r--r-- | yaksh/templates/user.html | 1 | ||||
-rw-r--r-- | yaksh/templates/yaksh/courses.html | 18 | ||||
-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 | 98 |
8 files changed, 128 insertions, 15 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..b628a44 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> @@ -77,15 +78,15 @@ <h5>Click on the button given below to add a new course.</h5> <button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button> </center> - {% if trial_quiz %} + {% if trial_paper %} <h5/> You have trial papers. <table class="bordered-table zebra-striped"> <form action="" method="post"> {% csrf_token %} - {% for quiz in trial_quiz %} + {% for paper in trial_paper %} <tr> - <td> <input type = "checkbox" name="delete_quiz" value = {{quiz.id}}></input></td> - <td> <a href="{{URL_ROOT}}/exam/manage/gradeuser/{{quiz.id}}">{{quiz.description}}</td> + <td> <input type = "checkbox" name="delete_paper" value = {{paper.id}}></input></td> + <td> <a href="{{URL_ROOT}}/exam/manage/gradeuser/{{paper.question_paper.quiz.id}}">{{paper.question_paper.quiz.description}}</td> </tr> {% endfor %} </table> 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/courses.html b/yaksh/templates/yaksh/courses.html index 42f49d1..109b996 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -65,13 +65,17 @@ <p><b><u>Quiz(zes)</u></b></p> {% if course.get_quizzes %} {% for quiz in course.get_quizzes %} - <a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a><br> + <a href="{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/{{quiz.id}}/">{{ quiz.description }}</a><br> + {% endfor %} {% else %} <p><b>No quiz </b></p> {% endif %} </div> </div> + <br/> + <button class="btn primary"type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/");'>Add New Quiz</button> + </div> </div> <br><br> @@ -130,22 +134,22 @@ <p><b><u>Quiz(zes)</u></b></p> {% if course.get_quizzes %} {% for quiz in course.get_quizzes %} - <a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a><br> + <a href="{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/{{quiz.id}}/">{{ quiz.description }}</a><br> {% endfor %} {% else %} <p><b>No quiz </b></p> {% endif %} </div> </div> + <button class="btn primary"type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/");'>Add New Quiz</button> </div> </div> <br><br> {% endfor %} {% else %} - <center><h4> No new Courses allotted </h4></center> + <center><h4> No new Courses allotted</h4></center> + <br><br> {% endif %} -<button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button> - {% if courses or allotted_courses %} - <button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button> -{% endif %} +<center><button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button></center> + {% 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..9227561 --- /dev/null +++ b/yaksh/templates/yaksh/view_answerpaper.html @@ -0,0 +1,98 @@ +{% extends "user.html" %} +{% block css %} +<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/view_answerpaper.css" /> +{% endblock %} + +{% 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/> + End time : {{ paper.end_time }} <br/> + Percentage obtained: {{ paper.percent }}% <br/> + {% if paper.passed == 0 %} + Status : <b style="color: red;"> Failed </b><br/> + {% else %} + Status : <b style="color: green;"> Passed </b><br/> + {% endif %} + </p> + + {% if paper.answers.count %} + <h3> Answerpaper: </h3> + {% for question, answers in paper.get_question_answers.items %} + + <div class="panel panel-info"> + <div class="panel-heading"> + <strong> Details: {{forloop.counter}}. {{ question.summary }} + <span class="marks"> Mark(s): {{ question.points }} </span> + </strong> + </div> + <div class="panel-body"> + <h5><u>Question:</u></h5> <strong>{{ question.description|safe }}</strong> + {% if question.type == "mcq" or question.type == "mcc" %} + <h5> <u>Choices:</u></h5> + {% for testcase in question.get_test_cases %} + <br/><strong>{{ forloop.counter }}. {{ testcase.options }}</strong> + {% endfor %} + {%endif%} + + </div> + </div> + {% if question.type == "mcq" or question.type == "mcc" %} + {% if "Correct answer" in answers.0.error %} + <div class="panel panel-success"> + {% else %} + <div class="panel panel-danger"> + {% endif %} + <div class="panel-heading"> + Autocheck: {{ answers.0.error }} + </div> + <div class="panel-body"> + <h5><u>Student answer:</u></h5> + <pre><code>{{forloop.counter}}. {{ answers.0 }}</code></pre> + </div> + </div> + {% else %} + <h5>Student answer: </h5> + {% for answer in answers %} + {% if not answer.skipped %} + {% if "Correct answer" in answer.error %} + <div class="panel panel-success"> + {% else %} + <div class="panel panel-danger"> + {% endif %} + <div class="panel-heading">Autocheck: {{ answer.error }}</div> + <div class="panel-body"><pre><code>{{ answer.answer.strip }}</code></pre></div> + </div> + {% endif %} + {% endfor %} + {% endif %} + {% with answers|last as answer %} + <p><em><mark>Obtained Marks: {{answer.marks}}</mark></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 %} |