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-03-31 15:19:26 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-03-31 15:19:26 +0000
commita0c78c82a5cb3a69f66a4ed631b555e3df54d6e5 (patch)
tree9ec5790f7ccb961bc242e8c4ae7490f668e66a49 /kpov_judge/web
parent57b460d77fc034ff00555bf674bae5de2a350c1c (diff)
Fixed generation of disk images
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@294 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-xkpov_judge/web/kpov_judge/kpov_judge.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py
index 7171c7f..ef7d542 100755
--- a/kpov_judge/web/kpov_judge/kpov_judge.py
+++ b/kpov_judge/web/kpov_judge/kpov_judge.py
@@ -199,18 +199,22 @@ def task_greeting(task_id, lang):
# generate the parameters as soon as the student visits
params, meta = get_params(task_id, student_id, db)
try:
- public_params = dict()
- for k, v in meta:
- if meta.get('public', False):
- public_params[k] = params.get(k, "???")
instructions = db.task_instructions.find({'task_id': task_id})[0]
instructions = instructions.get(lang,
- app.config['DEFAULT_LANG']).format(**public_params)
+ app.config['DEFAULT_LANG'])
except:
try:
instructions = instructions.values()[0]
except Exception, e:
instructions = str(e)
+ try:
+ public_params = dict()
+ for k, v in meta.iteritems():
+ if v.get('public', False):
+ public_params[k] = params.get(k, "???")
+ instructions = instructions.format(**public_params)
+ except Exception, e:
+ instructions = str(e)
computer_list = db.student_computers.find({'task_id':task_id, 'student_id': student_id})
if request.args.get('narediStack', 'false') == 'true':
#db.student_tasks.update({'task_id':task_id, 'student_id': student_id}, {'$set': {'create_openstack': True}}, upsert = True)