From 573dcc6149f3ccf8ffaa2df2dba3461b3b795c48 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Thu, 2 Feb 2012 12:45:09 +0530 Subject: Updated Views.py, monitor.html and login.html with new changes --- testapp/exam/views.py | 10 ++++----- testapp/templates/exam/login.html | 11 +++++----- testapp/templates/exam/monitor.html | 43 +++++++++++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/testapp/exam/views.py b/testapp/exam/views.py index c178a0b..05b69d1 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -5,6 +5,7 @@ import stat from os.path import dirname, pardir, abspath, join, exists import datetime +from django.http import HttpResponse from django.contrib.auth import login, logout, authenticate from django.shortcuts import render_to_response, get_object_or_404, redirect from django.template import RequestContext @@ -246,15 +247,15 @@ def check(request, q_id): return show_question(request, next_q) def quit(request): - return my_render_to_response('exam/quit.html', - context_instance=RequestContext(request)) + + return my_render_to_response('exam/quit.html',context_instance=RequestContext(request)) -def complete(request, reason=None): +def complete(request,reason = None): user = request.user no = False message = reason or 'The quiz has been completed. Thank you.' if request.method == 'POST' and 'no' in request.POST: - no = request.POST.get('no', False) + no = True if not no: # Logout the user and quit with the message given. logout(request) @@ -263,7 +264,6 @@ def complete(request, reason=None): else: return my_redirect('/exam/') - def monitor(request, quiz_id=None): """Monitor the progress of the papers taken so far.""" user = request.user diff --git a/testapp/templates/exam/login.html b/testapp/templates/exam/login.html index 9420903..0908fc2 100644 --- a/testapp/templates/exam/login.html +++ b/testapp/templates/exam/login.html @@ -19,19 +19,20 @@
{{ form.as_table }}
-
 
+
    

Forgot Password?

New User? Sign-Up
@@ -48,4 +49,4 @@ -{% endblock content %} \ No newline at end of file +{% endblock content %} diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html index fb6cb58..0b59f76 100644 --- a/testapp/templates/exam/monitor.html +++ b/testapp/templates/exam/monitor.html @@ -1,22 +1,35 @@ {% extends "base.html" %} + + {% block title %} Quiz results {% endblock title %} {% block meta %} {% endblock meta %} + + {% block content %} +
+
+ +
+
-

No quizzes available.

+
No quizzes available.
{% endif %} {# ############################################################### #} {# This is rendered when we are just viewing exam/monitor #} {% if quizzes %} -

Available quizzes

+

Available quizzes

+
+
+
    {% for quiz in quizzes %} @@ -28,11 +41,24 @@ {# ############################################################### #} {# This is rendered when we are just viewing exam/monitor/quiz_num #} {% if quiz %} -

    {{ quiz.description }} results

    +

    {{ quiz.description }} results

    +
+
+
+ {% if papers %} {#

Quiz: {{ quiz_name }}

#}

Number of papers: {{ papers|length }}

- + @@ -61,7 +87,12 @@

No answer papers so far.

{% endif %} {# if papers #} {% endif %} - Admin + + +
+

© FOSSEE group, IIT Bombay

+
+ {% endblock content %} -- cgit
Name