summaryrefslogtreecommitdiff
path: root/kpov_judge
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge')
-rwxr-xr-xkpov_judge/web/kpov_judge/kpov_judge.py52
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')