summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authorankitjavalkar2017-02-21 16:20:25 +0530
committerankitjavalkar2017-02-21 16:20:25 +0530
commita8392a2a9e62264af8ea096a4a5e99be6cd1b289 (patch)
tree10b8528ace158a8368e4ccba44d5da26c6b52b02 /yaksh
parentee83b9693075771dcba885bc380e20dfdd8289a1 (diff)
downloadonline_test-a8392a2a9e62264af8ea096a4a5e99be6cd1b289.tar.gz
online_test-a8392a2a9e62264af8ea096a4a5e99be6cd1b289.tar.bz2
online_test-a8392a2a9e62264af8ea096a4a5e99be6cd1b289.zip
Add a new view for logout
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/manage.html2
-rw-r--r--yaksh/templates/user.html2
-rw-r--r--yaksh/urls.py1
-rw-r--r--yaksh/views.py7
4 files changed, 10 insertions, 2 deletions
diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html
index 9744594..c9025d2 100644
--- a/yaksh/templates/manage.html
+++ b/yaksh/templates/manage.html
@@ -19,7 +19,7 @@
<li><a href="{{ URL_ROOT }}/exam/viewprofile">My Profile</a></li>
<li><a href="{{ URL_ROOT }}/exam/changepassword">Change Password</a></li>
<li><a href="{{ URL_ROOT }}/exam/manage/grader"> Grader </a></li>
- <li><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/complete/");'>Log out</a></li>
+ <li><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/logout/");'>Log out</a></li>
</ul>
</div><!-- /.navbar -->
</div><!-- /.container -->
diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html
index 6f879fe..1707305 100644
--- a/yaksh/templates/user.html
+++ b/yaksh/templates/user.html
@@ -16,7 +16,7 @@
<div class= "collapse navbar-collapse" id="navbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="{{ URL_ROOT }}/exam/viewprofile"> {{ user.get_full_name.title }} </a></li>
- <li><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/complete/");'> <span class="glyphicon glyphicon-log-out">Logout </span></a></li>
+ <li><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/logout/");'> <span class="glyphicon glyphicon-log-out">Logout </span></a></li>
</ul>
</div><!-- /.navbar -->
</div><!-- /.container -->
diff --git a/yaksh/urls.py b/yaksh/urls.py
index 5544088..ad58985 100644
--- a/yaksh/urls.py
+++ b/yaksh/urls.py
@@ -4,6 +4,7 @@ from yaksh import views
urlpatterns = [
url(r'^$', views.index),
url(r'^login/$', views.user_login, name='login'),
+ url(r'^logout/$', views.user_logout),
url(r'^quizzes/$', views.quizlist_user, name='quizlist_user'),
url(r'^quizzes/(?P<enrolled>\w+)/$', views.quizlist_user, name='quizlist_user'),
url(r'^results/$', views.results_user),
diff --git a/yaksh/views.py b/yaksh/views.py
index ae29508..74c409c 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -104,6 +104,13 @@ def user_register(request):
context_instance=ci)
+def user_logout(request):
+ """Show a page to inform user that the quiz has been compeleted."""
+ logout(request)
+ context = {'message': "You have been logged out successfully"}
+ return my_render_to_response('yaksh/complete.html', context)
+
+
@login_required
def quizlist_user(request, enrolled=None):
"""Show All Quizzes that is available to logged-in user."""