summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprathamesh2016-03-07 17:20:55 +0530
committerprathamesh2016-03-07 17:20:55 +0530
commitc974da07d46709d3aa3640ba69c89d1a287ff3c1 (patch)
tree444f167c4bf4516b84e0cfeb6e60e921ae8519f8
parente94f589eea5fbe85253d35f836d308bbfd339ff0 (diff)
downloadonline_test-c974da07d46709d3aa3640ba69c89d1a287ff3c1.tar.gz
online_test-c974da07d46709d3aa3640ba69c89d1a287ff3c1.tar.bz2
online_test-c974da07d46709d3aa3640ba69c89d1a287ff3c1.zip
UI modification and checks for answerpaper before evaluating.
-rw-r--r--yaksh/templates/yaksh/course_detail.html4
-rw-r--r--yaksh/templates/yaksh/courses.html17
-rw-r--r--yaksh/views.py2
3 files changed, 17 insertions, 6 deletions
diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html
index cae7335..ed56585 100644
--- a/yaksh/templates/yaksh/course_detail.html
+++ b/yaksh/templates/yaksh/course_detail.html
@@ -1,8 +1,8 @@
{% extends "manage.html" %}
-{% block title %} Course Detail {% endblock title %}
+{% block title %} Course {% endblock title %}
-{% block subtitle %} Course Detail for {{ course.name }} {% endblock %}
+{% block subtitle %} {{ course.name }} {% endblock %}
{% block css %}
<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/course.css" />
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
index 291a746..f8f8273 100644
--- a/yaksh/templates/yaksh/courses.html
+++ b/yaksh/templates/yaksh/courses.html
@@ -17,15 +17,26 @@
<div class="span14">
<div class="row">
<div class="span6">
- <p> <b><u>Course</u></b></p>
+ <p>
+ <b><u>Course</u></b>
+ {% if course.active %}
+ <span class="label success">Active</span>
+ {% else %}
+ <span class="label important">Closed</span>
+ {% endif %}
+ </p>
<a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }}</a>
</br>
</div>
<div class="span6">
<p><b><u>Quiz(zes)</u></b></p>
- {% for quiz in course.get_quizzes %}
- <a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a><br>
+ {% if course.get_quizzes %}
+ {% for quiz in course.get_quizzes %}
+ <a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a><br>
{% endfor %}
+ {% else %}
+ <p><b>No quiz </b></p>
+ {% endif %}
</div>
</div>
</div>
diff --git a/yaksh/views.py b/yaksh/views.py
index 20a416d..9cd6fdb 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -949,7 +949,7 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None):
"""Checks the answers of the user for particular question"""
user = request.user
q_paper = QuestionPaper.objects.get(id=questionpaper_id)
- paper = AnswerPaper.objects.get(user=request.user, attempt_number=attempt_num,
+ paper = get_object_or_404(AnswerPaper, user=request.user, attempt_number=attempt_num,
question_paper=q_paper)
if q_id in paper.questions_answered: