diff options
author | adityacp | 2018-01-19 15:58:06 +0530 |
---|---|---|
committer | adityacp | 2018-01-19 17:01:44 +0530 |
commit | bfc3f08d5da08f774e76aa169a50f8e7847ff6ed (patch) | |
tree | 7405617e9351e724db5269e55d915ad6cbaff01d /yaksh/views.py | |
parent | 6da1f77a6a1a2bffb85d5395f2703f186b18cb4a (diff) | |
download | online_test-bfc3f08d5da08f774e76aa169a50f8e7847ff6ed.tar.gz online_test-bfc3f08d5da08f774e76aa169a50f8e7847ff6ed.tar.bz2 online_test-bfc3f08d5da08f774e76aa169a50f8e7847ff6ed.zip |
Change in views and templates
- Add active field for exercise form
- Fix views test case for creating exercise
- Show question paper for exercise
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 4ff1032..98cd010 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -320,9 +320,7 @@ def add_quiz(request, quiz_id=None, course_id=None): return my_redirect("/exam/manage/courses/") else: - quiz = Quiz.objects.get(id=quiz_id) if quiz_id else None form = QuizForm(instance=quiz) - context["quiz_id"] = quiz_id context["course_id"] = course_id context["quiz"] = quiz context["form"] = form @@ -347,7 +345,7 @@ def add_exercise(request, quiz_id=None, course_id=None): if course_id: course = get_object_or_404(Course, pk=course_id) if not course.is_creator(user) and not course.is_teacher(user): - raise Http404('This quiz does not belong to you') + raise Http404('This Course does not belong to you') context = {} if request.method == "POST": @@ -371,9 +369,8 @@ def add_exercise(request, quiz_id=None, course_id=None): return my_redirect("/exam/manage/courses/") else: - quiz = Quiz.objects.get(id=quiz_id) if quiz_id else None form = ExerciseForm(instance=quiz) - context["quiz_id"] = quiz_id + context["exercise"] = quiz context["course_id"] = course_id context["form"] = form return my_render_to_response( |