diff options
author | hardythe1 | 2015-01-16 16:47:43 +0530 |
---|---|---|
committer | hardythe1 | 2015-01-16 16:47:43 +0530 |
commit | cbdeb90a756832c71c80bac4dbe9ba1a3aceacb2 (patch) | |
tree | ce0aeb69dde2351ac1d1372fdd15dbec94ac9ccc /testapp/exam/views.py | |
parent | 534cc561e22da308e31282ab9c598041558aa1b4 (diff) | |
download | online_test-cbdeb90a756832c71c80bac4dbe9ba1a3aceacb2.tar.gz online_test-cbdeb90a756832c71c80bac4dbe9ba1a3aceacb2.tar.bz2 online_test-cbdeb90a756832c71c80bac4dbe9ba1a3aceacb2.zip |
added view, urls for assignment upload & changed the model
Diffstat (limited to 'testapp/exam/views.py')
-rw-r--r-- | testapp/exam/views.py | 16 |
1 files changed, 16 insertions, 0 deletions
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 + |