diff options
author | hardythe1 | 2012-02-15 18:35:40 +0530 |
---|---|---|
committer | hardythe1 | 2012-02-15 18:35:40 +0530 |
commit | 7c65d02d8a1f2ea72eabf3f13f85b8b444b1505e (patch) | |
tree | 8b5cbdef2a1be1193600b3e6a3c4e9a47024d33b /testapp/exam | |
parent | 85a76d4777d3917cf5dbb716107581d4998c408d (diff) | |
download | online_test-7c65d02d8a1f2ea72eabf3f13f85b8b444b1505e.tar.gz online_test-7c65d02d8a1f2ea72eabf3f13f85b8b444b1505e.tar.bz2 online_test-7c65d02d8a1f2ea72eabf3f13f85b8b444b1505e.zip |
New views to manage/moderate Quiz
Diffstat (limited to 'testapp/exam')
-rw-r--r-- | testapp/exam/urls.py | 4 | ||||
-rw-r--r-- | testapp/exam/views.py | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 34e329f..4545897 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -3,6 +3,10 @@ from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('exam.views', url(r'^$', 'index'), url(r'^login/$', 'user_login'), + url(r'^manage/$', 'prof_manage'), + url(r'^addquestion/$', 'add_question'), + url(r'^addquiz/$', 'add_quiz'), + url(r'^grade_user/$', 'show_all_users'), url(r'^register/$', 'user_register'), url(r'^start/$', 'start'), url(r'^quit/$', 'quit'), diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 05b69d1..aed45d5 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -90,6 +90,15 @@ def user_register(request): {'form':form}, context_instance=RequestContext(request)) +def add_question(request): + return render_to_response('exam/add_question.html',{}) + +def add_quiz(request): + return render_to_response('exam/add_quiz.html',{}) + +def prof_manage(request): + return render_to_response('manage.html',{}) + def user_login(request): """Take the credentials of the user and log the user in.""" @@ -309,6 +318,12 @@ def get_user_data(username): data['papers'] = papers return data +def show_all_users(request): + user = User.objects.filter(username__contains="") + context = { 'user':user } + print context + return my_render_to_response('exam/showusers.html',context,context_instance=RequestContext(request)) + def user_data(request, username): """Render user data.""" current_user = request.user @@ -342,10 +357,12 @@ def grade_user(request, username): paper.save() context = {'data': data} + print context return my_render_to_response('exam/user_data.html', context, context_instance=RequestContext(request)) else: context = {'data': data} + print context return my_render_to_response('exam/grade_user.html', context, context_instance=RequestContext(request)) |