diff options
author | hardythe1 | 2012-04-14 07:24:02 +0530 |
---|---|---|
committer | hardythe1 | 2012-04-14 07:24:02 +0530 |
commit | 9d0a737afdb23a50b28237055c87bfa72197d99b (patch) | |
tree | f0be0b52f49e7dee75239b2fe7f2be8e906abe35 /testapp | |
parent | 5d7ab20a710e2374a3345b07ed62154456dbd2c8 (diff) | |
download | online_test-9d0a737afdb23a50b28237055c87bfa72197d99b.tar.gz online_test-9d0a737afdb23a50b28237055c87bfa72197d99b.tar.bz2 online_test-9d0a737afdb23a50b28237055c87bfa72197d99b.zip |
minor changes as model changes
Diffstat (limited to 'testapp')
-rw-r--r-- | testapp/exam/views.py | 16 | ||||
-rw-r--r-- | testapp/templates/exam/grade_user.html | 4 | ||||
-rw-r--r-- | testapp/templates/exam/monitor.html | 4 | ||||
-rw-r--r-- | testapp/templates/exam/showusers.html | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/testapp/exam/views.py b/testapp/exam/views.py index b742785..5e594b2 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -756,20 +756,20 @@ def monitor(request, quiz_id=None): raise Http404('You are not allowed to view this page!') if quiz_id is None: - quizzes = Quiz.objects.all() + q_paper = QuestionPaper.objects.all() context = {'papers': [], 'quiz': None, - 'quizzes':quizzes} + 'quizzes':q_paper} return my_render_to_response('exam/monitor.html', context, context_instance=RequestContext(request)) # quiz_id is not None. try: - quiz = Quiz.objects.get(id=quiz_id) - except Quiz.DoesNotExist: + quiz = QuestionPaper.objects.get(id=quiz_id) + except QuestionPaper.DoesNotExist: papers = [] quiz = None else: - papers = QuestionPaper.objects.all().annotate( + papers = AnswerPaper.objects.all().annotate( total=Sum('answers__marks')).order_by('-total') context = {'papers': papers, 'quiz': quiz, 'quizzes': None} @@ -781,7 +781,7 @@ def get_user_data(username): related to the user including all the user's answers submitted. """ user = User.objects.get(username=username) - papers = QuestionPaper.objects.filter(user=user) + papers = AnswerPaper.objects.filter(user=user) data = {} try: @@ -801,7 +801,7 @@ def show_all_users(request): if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page !') user = User.objects.filter(username__contains="") - questionpaper = QuestionPaper.objects.all() + questionpaper = AnswerPaper.objects.all() context = { 'question': questionpaper } return my_render_to_response('exam/showusers.html',context,context_instance=RequestContext(request)) @@ -972,7 +972,7 @@ def grade_user(request, username): last_ans = answers[-1] last_ans.marks = marks last_ans.save() - paper.comments = request.POST.get('comments_%d'%paper.quiz.id) + paper.comments = request.POST.get('comments_%d'%paper.question_paper.id) paper.save() context = {'data': data} diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index 7137548..58e118b 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -92,8 +92,8 @@ Marks: <input id="q{{ question.id }}" type="text" <h3>Teacher comments: </h3> -<textarea id="comments_{{paper.quiz.id}}" rows="10" cols="80" - name="comments_{{ paper.quiz.id }}">{{ paper.comments }}</textarea> +<textarea id="comments_{{paper.question_paper.id}}" rows="10" cols="80" + name="comments_{{ paper.question_paper.id }}">{{ paper.comments }}</textarea> <br> <br><button class="btn" type="submit" name="submit_{{paper.quiz.id}}">Save Marks</button> diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html index 29cb6e9..aa8b678 100644 --- a/testapp/templates/exam/monitor.html +++ b/testapp/templates/exam/monitor.html @@ -27,8 +27,8 @@ {# This is rendered when we are just viewing exam/monitor #} {% if quizzes %} <ul> -{% for quiz in quizzes %} -<li><a href="{{URL_ROOT}}/exam/manage/monitor/{{quiz.id}}/">{{ quiz.description }}</a></li> +{% for q in quizzes %} +<li><a href="{{URL_ROOT}}/exam/manage/monitor/{{q.id}}/">{{ q.quiz.description }}</a></li> {% endfor %} </ul> {% endif %} diff --git a/testapp/templates/exam/showusers.html b/testapp/templates/exam/showusers.html index 603af8a..01ecc37 100644 --- a/testapp/templates/exam/showusers.html +++ b/testapp/templates/exam/showusers.html @@ -20,7 +20,7 @@ List of Users <tr><td><a href="{{URL_ROOT}}/exam/manage/gradeuser/{{ papers.user.username }}">{{ papers.user.username }}</a><br> <td >{{ papers.user.first_name.title }} <td>{{ papers.user.last_name.title }} - <td>{{ papers.quiz.description }} + <td>{{ papers.question_paper.quiz.description }} {% endfor %} </table></center> {% endblock %} |