From 0b2a7623a7a5e225ee7a29b438872705b2c4ba5b Mon Sep 17 00:00:00 2001
From: prathamesh
Date: Wed, 30 Mar 2016 09:49:19 +0530
Subject: views functions related to exam flow are cleaned-up
Cleaned views various functions related to the exam flow.
That is, introduction, start, check, show questions.
To check prerequisite, can attempt the quiz, start quiz in progress if
time available, get all active quizzes all these functionalities are
shifted from views to models. Still further it has to be cleaned.
For Answerpaper model, made questions, questions_answered and
questions_unanswered manytomany relation with the Question model.
Corrected the testcases.
---
yaksh/templates/yaksh/complete.html | 10 +++-----
yaksh/templates/yaksh/intro.html | 30 +++++++++++-----------
yaksh/templates/yaksh/question.html | 39 +++++++++++++++--------------
yaksh/templates/yaksh/quit.html | 44 ++++++++++++++++-----------------
yaksh/templates/yaksh/quizzes_user.html | 17 +++++++------
yaksh/templates/yaksh/results_user.html | 9 ++++---
6 files changed, 73 insertions(+), 76 deletions(-)
(limited to 'yaksh/templates')
diff --git a/yaksh/templates/yaksh/complete.html b/yaksh/templates/yaksh/complete.html
index 08abe76..7ebd062 100644
--- a/yaksh/templates/yaksh/complete.html
+++ b/yaksh/templates/yaksh/complete.html
@@ -5,27 +5,25 @@
{% block pagetitle %}Online Test{% endblock %}
{% block content %}
{% csrf_token %}
- {% if submitted or unattempted %}
Submitted Questions |
- {% if submitted %}
- {{ submitted|join:", " }}
+ {% if paper.questions_answered.all %}
+ {{ paper.questions_answered.all|join:", " }}
{% else %}
No Questions have been Submitted {% endif %} |
Unattempted Questions |
- {% if unattempted %}
- {{ unattempted|join:", " }}
+ {% if paper.questions_unanswered.all %}
+ {{ paper.questions_unanswered.all|join:", " }}
{% else %}
All Questions have been Submitted {% endif %} |
Welcome {{user.first_name.title}} {{user.last_name.title}}, to the programming quiz!
This examination system has been developed with the intention of making you @@ -44,8 +42,8 @@ {% csrf_token %}
Submitted Questions | -
- {% if submitted %}
- {{ submitted|join:", " }}
- {% else %}
- No Questions have been Submitted - {% endif %} - |
Unattempted Questions | -
- {% if unattempted %}
- {{ unattempted|join:", " }}
- {% else %}
- All Questions have been Submitted - {% endif %} - |
Submitted Questions | +
+ {% if paper.questions_answered.all %}
+ {{ paper.questions_answered.all|join:", " }}
+ {% else %}
+ No Questions have been Submitted + {% endif %} + |
Unattempted Questions | +
+ {% if paper.questions_unanswered.all %}
+ {{ paper.questions_unanswered.all|join:", " }}
+ {% else %}
+ All Questions have been Submitted + {% endif %} + |
Quiz | Pre requisite quiz | - {% for paper in quizzes %} - {% if paper.quiz.course_id == course.id %} + {% for quiz in quizzes %} + {% if quiz.course_id == course.id %}|||
---|---|---|---|---|
- {{ paper.quiz.description }} + {{ quiz.description }} |
{% else %}
- {{ paper.quiz.description }} Expired + {{ quiz.description }} + {{ quiz.description }} INACTIVE |
{% endif %}
- {% if paper.quiz.prerequisite %} - You have to pass {{ paper.quiz.prerequisite.description }} for taking {{ paper.quiz.description }} + {% if quiz.prerequisite %} + You have to pass {{ quiz.prerequisite.description }} for taking {{ paper.quiz.description }} {% else %} - No pre requisites for {{ paper.quiz.description }} + No pre requisites for {{ quiz.description }} {% endif %} | Percentage {% for paper in papers %} | |
{{ i }}
- {% endfor %}
- + | {{ paper.question_paper.quiz.description }} | +{{ paper.marks_obtained }} | +{{ paper.question_paper.total_marks }} | +{{ paper.percent }} | +