diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2019-02-19 02:25:26 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2019-02-19 14:30:01 +0100 |
commit | 6063a9c657a0adcd99bfcd6d5c2a457ae154caed (patch) | |
tree | 7f1e9bbe2fd06e2a8786c8a32f2d6f83c9ca1f07 /kpov_judge/web | |
parent | ee6530f2cdaed693cd0725590acbda82f6dba1e5 (diff) |
Web: remove unused functions
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-x | kpov_judge/web/kpov_judge/kpov_judge.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index 9e4e24a..95d7199 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -127,11 +127,6 @@ def results_json(class_id, task_id): return json.dumps(results_dict(class_id, task_id)) -@app.route('/tasks/<class_id>/<task_id>/<lang>/results.html') -def results_html(class_id, task_id, lang): - return render_template('results.html', results=results_dict(class_id, task_id)) - - @app.route('/tasks/<class_id>/<task_id>/<lang>/setup.<ending>', methods=['GET']) def setup_svg(class_id, task_id, lang, ending): db = g.db @@ -146,21 +141,6 @@ def setup_svg(class_id, task_id, lang, ending): mimetype=mimetype) -def public_meta(db, class_id, task_id): - shown = {} - try: - meta = db.task_params_meta.find_one({'class_id': class_id, 'task_id': task_id})['params'] - for k, v in meta.items(): - try: - if v['public']: - shown[k] = v - except Exception: - pass - except Exception: - shown = dummy_meta - return shown - - @app.route('/tasks/<class_id>/<task_id>/task.py') def task_source(class_id, task_id): db = g.db @@ -325,37 +305,5 @@ def params_json(class_id, task_id): return json.dumps(shown_params) -@app.route('/tasks/<class_id>/<task_id>/<lang>/params.html', methods=['GET', 'POST']) -def params_html(class_id, task_id, lang): - student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody') - db = g.db - params, meta = get_params(class_id, task_id, student_id, db) - shown_params = {} - for name, meta_param in meta.items(): - if meta_param.get('public', False): - shown_params[name] = params.get(name, '') - if flask.app.request.method == 'POST': - form = flask.app.request.form - new_params = {} - for k, v in meta.items(): - if v.get('w', False): - params[k] = flask.app.request.form[k] - if v.get('public', False): - shown_params[name] = params.get(name, '') - db.task_params.update({'class_id': class_id, 'task_id': task_id, 'student_id': student_id}, {'$set': {'params': params}}) - return render_template('params.html', params=shown_params, params_meta=meta) - - -@app.route('/tasks/<class_id>/<task_id>/params_meta.json') -def params_meta(class_id, task_id): - db = g.db - return json.dumps(public_meta(db, class_id, task_id)) - - -@app.route('/static/<path:filename>') -def send_foo(filename): - return send_from_directory(app.config.STATIC_FILES, filename) - - if __name__ == '__main__': app.run(host='0.0.0.0') |