summaryrefslogtreecommitdiff
path: root/exam/views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2011-11-21 13:39:00 +0530
committerPrabhu Ramachandran2011-11-21 13:39:00 +0530
commit948010603065f72c83dbbb871154f17da3332b4f (patch)
treedf308b088a6931e33561a5be79413886742f8561 /exam/views.py
parent49ce8322b9e9cc3104795510173ab484a3e6c593 (diff)
downloadonline_test-948010603065f72c83dbbb871154f17da3332b4f.tar.gz
online_test-948010603065f72c83dbbb871154f17da3332b4f.tar.bz2
online_test-948010603065f72c83dbbb871154f17da3332b4f.zip
ENH: Showing login and IP details of users.
Also cleaned up the dumping code to use templates.
Diffstat (limited to 'exam/views.py')
-rw-r--r--exam/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/exam/views.py b/exam/views.py
index 7c561a7..7157c45 100644
--- a/exam/views.py
+++ b/exam/views.py
@@ -343,6 +343,8 @@ def get_user_data(username):
data['email'] = user.email
data['rollno'] = profile.roll_number if profile else ''
data['name'] = user.get_full_name()
+ data['date_joined'] = str(user.date_joined)
+ data['last_login'] = str(user.last_login)
papers = []
for q_paper in q_papers:
paper = {}
@@ -353,6 +355,8 @@ def get_user_data(username):
paper['attempts'] = q_paper.answers.count()
total = sum( [marks[int(id)] for id in qa if id] )
paper['total'] = total
+ paper['user_ip'] = q_paper.user_ip
+ paper['start_time'] = str(q_paper.start_time)
answers = {}
for answer in q_paper.answers.all():
qs = answer.question.summary