diff options
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-x | kpov_judge/web/kpov_judge/kpov_judge.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index 6302c3a..26d3b1d 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -190,21 +190,24 @@ def task_greeting(task_id, lang): instr_ok = True try: instructions = db.task_instructions.find({'task_id': task_id})[0] - instructions = instructions.get(lang, - app.config['DEFAULT_LANG']) + instructions = instructions.get(lang, instructions[app.config['DEFAULT_LANG']]) except Exception: try: instructions = instructions.values()[0] except Exception as e: instructions = str(e) instr_ok = False + instructions = instructions if instr_ok: try: public_params = {} for k, v in meta.iteritems(): if v.get('public', False): public_params[k] = params.get(k, "???") + # instructions = instructions.format(**public_params).decode('utf8') instructions = instructions.format(**public_params) + + # instructions = instructions.format(**public_params).encode('utf8') except Exception as e: instructions = str(e) computer_list = db.student_computers.find({'task_id': task_id, 'student_id': student_id}) |