summaryrefslogtreecommitdiff
path: root/kpov_judge/web
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-xkpov_judge/web/kpov_judge/kpov_judge.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py
index 67a0d1c..aadec65 100755
--- a/kpov_judge/web/kpov_judge/kpov_judge.py
+++ b/kpov_judge/web/kpov_judge/kpov_judge.py
@@ -35,7 +35,8 @@ def before_request():
user = app.config['USERNAME']
password = app.config['PASSWORD']
g.db.authenticate(user, password)
- except:
+ except Exception, e:
+ # raise e
#no auth or auth config?
pass
@@ -43,7 +44,7 @@ def before_request():
def root():
student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody')
# env = flask.app.request.environ
- tasks = g.db.tasks.find(dict(), {'task_id':1})
+ tasks = g.db.tasks.find(dict(), {'task_id':1, }).sort('task_id')
if tasks is not None:
task_list = [i['task_id'] for i in tasks]
else:
@@ -99,7 +100,7 @@ def results_dict(task_id):
try:
entry = db.results.find_one(
{'$query': {'task_id': task_id, 'student_id': student_id},
- '$orderby': {'status': -1}},
+ '$orderby': {'time': -1}},
{'result': 1, 'status': 1, 'hints': 1, '_id': 0})
if entry is None:
return {'result': 'Naloga ni bila nikdar ocenjena', 'status': 'NOT OK'}