summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprathamesh2015-04-07 14:05:27 +0530
committerprathamesh2015-04-07 14:05:27 +0530
commitd0b6afb0d73c8ed32d6ca1151f5e3c6b216c50b7 (patch)
treee2e3664638c203254e241cbd86c4f96948f0407a
parentbd5b1e21c4d837dab410f9a3eb332d7af3d0185a (diff)
downloadonline_test-d0b6afb0d73c8ed32d6ca1151f5e3c6b216c50b7.tar.gz
online_test-d0b6afb0d73c8ed32d6ca1151f5e3c6b216c50b7.tar.bz2
online_test-d0b6afb0d73c8ed32d6ca1151f5e3c6b216c50b7.zip
url cleaned and checked assignment upload on time-up
-rw-r--r--testapp/exam/urls.py3
-rw-r--r--testapp/exam/views.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py
index 5ffb588..6cd56cf 100644
--- a/testapp/exam/urls.py
+++ b/testapp/exam/urls.py
@@ -18,7 +18,6 @@ urlpatterns = patterns('testapp.exam.views',
url(r'^(?P<q_id>\d+)/check/(?P<attempt_no>\d+)/(?P<questionpaper_id>\d+)/$',\
'check'),
url(r'^intro/$', 'start'),
- url(r'^up/$', 'updation'),
url(r'^manage/$', 'prof_manage'),
url(r'^manage/addquestion/$', 'add_question'),
@@ -28,7 +27,7 @@ urlpatterns = patterns('testapp.exam.views',
url(r'^manage/editquestion/$', 'edit_question'),
url(r'^manage/addquiz/(?P<quiz_id>\d+)/$', 'add_quiz'),
url(r'^manage/gradeuser/$', 'show_all_users'),
- url(r'^manage/gradeuser/(?P<username>.*/$', 'grade_user'),
+ url(r'^manage/gradeuser/(?P<username>.*)/$', 'grade_user'),
url(r'^manage/questions/$', 'show_all_questions'),
url(r'^manage/showquiz/$', 'show_all_quiz'),
url(r'^manage/monitor/$', 'monitor'),
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: