summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-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: