summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2018-01-15 12:23:52 +0530
committerGitHub2018-01-15 12:23:52 +0530
commit1445358b4ee548edd16a8d42026b080b7d92a0c4 (patch)
tree99b437d71f841cb1ac9f26266d7e7de04031f340 /yaksh/views.py
parent3abbc557c57eaf2f3d08222034f9a720a1e7a1ed (diff)
parentef22478a11d518982f38a6a0d4d84f6f8ba5e492 (diff)
downloadonline_test-1445358b4ee548edd16a8d42026b080b7d92a0c4.tar.gz
online_test-1445358b4ee548edd16a8d42026b080b7d92a0c4.tar.bz2
online_test-1445358b4ee548edd16a8d42026b080b7d92a0c4.zip
Merge pull request #422 from adityacp/show_course_status
Show course status
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 49249ca..7049912 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -2666,3 +2666,20 @@ def course_modules(request, course_id, msg=None):
context = {"course": course, "learning_modules": learning_modules,
"user": user, "msg": msg}
return my_render_to_response('yaksh/course_modules.html', context)
+
+
+@login_required
+@email_verified
+def course_status(request, course_id):
+ user = request.user
+ if not is_moderator(user):
+ raise Http404('You are not allowed to view this page!')
+ course = get_object_or_404(Course, pk=course_id)
+ if not course.is_creator(user) and not course.is_teacher(user):
+ raise Http404('This course does not belong to you')
+ students = course.get_only_students()
+ context = {
+ 'course': course, 'students': students,
+ 'state': 'course_status', 'modules': course.get_learning_modules()
+ }
+ return my_render_to_response('yaksh/course_detail.html', context)