diff options
author | adityacp | 2018-01-18 14:21:05 +0530 |
---|---|---|
committer | adityacp | 2018-01-18 14:21:58 +0530 |
commit | 9f0724354ae2801be02c5c8b8762d76ef6ce589d (patch) | |
tree | 3afff6a6c4e608542cdcad070bbeb4840edb406a /yaksh/views.py | |
parent | 6e9fa57333261f2ef1e38f1de9f88e0daeed32da (diff) | |
parent | 1445358b4ee548edd16a8d42026b080b7d92a0c4 (diff) | |
download | online_test-9f0724354ae2801be02c5c8b8762d76ef6ce589d.tar.gz online_test-9f0724354ae2801be02c5c8b8762d76ef6ce589d.tar.bz2 online_test-9f0724354ae2801be02c5c8b8762d76ef6ce589d.zip |
Update to latest changes from master
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index c586854..40bec2e 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2675,3 +2675,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) |