diff options
Diffstat (limited to 'testapp/exam/views.py')
-rw-r--r-- | testapp/exam/views.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/testapp/exam/views.py b/testapp/exam/views.py index d307be7..8222319 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -766,7 +766,10 @@ def check(request, q_id, attempt_no=None, questionpaper_id=None): assign = AssignmentUpload() assign.user = user.profile assign.assignmentQuestion = question - assign.assignmentFile = request.FILES['assignment'] + # if time-up at upload question then the form is submitted without + # validation + if 'assignment' in request.FILES: + assign.assignmentFile = request.FILES['assignment'] assign.save() user_answer = 'ASSIGNMENT UPLOADED' else: |