summaryrefslogtreecommitdiff
path: root/kpov_judge/web
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-04-09 18:00:43 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-04-09 18:00:43 +0000
commitd3e8f24b4da66059058627168f3f71eaf7626a93 (patch)
treecf2f524d42af38ef0b5ea556f8bc41df4bf07779 /kpov_judge/web
parent54c45f7e5e85a088eeb301fb3677f9c743cccbb5 (diff)
fixed disk template names
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@298 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
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'}