diff options
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-x | kpov_judge/web/kpov_judge/kpov_judge.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index 7415724..47e413e 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -30,21 +30,6 @@ def get_locale(): return 'sl' return request.accept_languages.best_match(['sl', 'en']) -dummy_task = """ -def task(neznano_ime_naloge): - print "Ta naloga ne obstaja!" - return {'odgovor': 'neznana naloga'} - -def task_check(results, params): - raise Exception("neznana naloga?") - return "Manjka preverjalnik naloge (neznana naloga?)" - -def gen_params(user_id, meta): - return dict() - -params_meta = {'neznano_ime_naloge': {'opis':'NEZNANA NALOGA', 'w': False}} -""" - @app.before_request def before_request(): @@ -89,10 +74,9 @@ def setup_svg(class_id, task_id, lang, ending): def task_source(class_id, task_id): db = g.db try: - task_str = db.tasks.find_one({'class_id': class_id, 'task_id': task_id})['source'] - except Exception: - return dummy_task - return task_str + return db.tasks.find_one({'class_id': class_id, 'task_id': task_id})['source'] + except: + return '' @app.route('/tasks/<class_id>/<task_id>/task.html') |