diff options
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-x | kpov_judge/web/kpov_judge/kpov_judge.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index 1085b9b..5aa0606 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -36,9 +36,9 @@ def before_request(): @app.route('/') -def root(): +@app.route('/classes/') +def index(): student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody') - # env = flask.app.request.environ classes = g.db.classes.find({}, {'class_id': 1, 'name': 1}).sort('class_id') return render_template('index.html', student_id=student_id, classes=classes) @@ -46,7 +46,6 @@ def root(): @app.route('/classes/<class_id>/') def class_tasks(class_id): student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody') - # env = flask.app.request.environ clas = g.db.classes.find_one({'class_id': class_id}) tasks = g.db.tasks.find({'class_id': class_id}, {'task_id': 1}).sort('task_id') if tasks is not None: @@ -56,14 +55,6 @@ def class_tasks(class_id): return render_template('class_tasks.html', student_id=student_id, tasks=task_list, clas=clas) -@app.route('/classes/') -def class_list(): - student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody') - # env = flask.app.request.environ - classes = g.db.classes.find({}, {'class_id': 1, 'name': 1,}).sort('name') - return render_template('class_list.html', student_id=student_id, classes=classes) - - def results_post(class_id, task_id, results): student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody') db = g.db |