From cbdeb90a756832c71c80bac4dbe9ba1a3aceacb2 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Fri, 16 Jan 2015 16:47:43 +0530 Subject: added view, urls for assignment upload & changed the model --- testapp/exam/views.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'testapp/exam/views.py') diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 8fde7a7..9902b74 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -1189,3 +1189,19 @@ def design_questionpaper(request): context = {'form': form} return my_render_to_response('exam/design_questionpaper.html', context, context_instance=ci) + + +def submit_assignment(request, question_id=None): + user = request.user + skip = request.POST.get('skip', None) + if request.method == "POST" and skip is not None: + question = Question.objects.get(id=question_id) + assignment = AssignmentUpload() + assignment.user = user + assignment.assignmentQuestion = question + assignment.assignmentFile = request.FILES['assignment'] + assignment.save() + #next question ke liye code idhar + else: + #code for skipping the question + -- cgit