summaryrefslogtreecommitdiff
path: root/kpov_judge/web
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-xkpov_judge/web/kpov_judge/kpov_judge.py12
-rw-r--r--kpov_judge/web/kpov_judge/templates/class_tasks.html2
-rw-r--r--kpov_judge/web/kpov_judge/templates/task_greeting.html3
3 files changed, 9 insertions, 8 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py
index 5aa0606..4dfed7b 100755
--- a/kpov_judge/web/kpov_judge/kpov_judge.py
+++ b/kpov_judge/web/kpov_judge/kpov_judge.py
@@ -235,10 +235,6 @@ def task_greeting(class_id, task_id, lang):
for k, v in meta.items():
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 = list(db.student_computers.find({'class_id': class_id, 'task_id': task_id, 'student_id': student_id}))
@@ -258,11 +254,15 @@ def task_greeting(class_id, task_id, lang):
openstackCreated = False
return render_template('task_greeting.html',
disk_base_url='/'.join([app.config['STUDENT_DISK_URL'], student_id, class_id, task_id, '']),
+ class_id=class_id,
+ task_id=task_id,
computers=computer_list,
backing_images=sorted(backing_images),
- lang=lang,
+ lang='sl' if lang == 'si' else lang, # TODO s/si/sl in all tasks (and maybe elsewhere)
openstack=openstackCreated,
- instructions=instructions)
+ instructions=jinja2.Template(instructions),
+ **public_params,
+ )
@app.route('/tasks/<class_id>/<task_id>/params.json', methods=['GET', 'POST'])
diff --git a/kpov_judge/web/kpov_judge/templates/class_tasks.html b/kpov_judge/web/kpov_judge/templates/class_tasks.html
index 5a29ae7..050874b 100644
--- a/kpov_judge/web/kpov_judge/templates/class_tasks.html
+++ b/kpov_judge/web/kpov_judge/templates/class_tasks.html
@@ -11,6 +11,6 @@ Trenutno so na voljo naloge:
<ul>
{% for t in tasks %}
-<li><a href="{{url_for('task_lang_redirect', class_id=clas.class_id, task_id=t)}}">{{t}}</a>
+ <li><a href="{{url_for('task_lang_redirect', class_id=clas.class_id, task_id=t)}}">{{t}}</a>
{% endfor %}
</ul>
diff --git a/kpov_judge/web/kpov_judge/templates/task_greeting.html b/kpov_judge/web/kpov_judge/templates/task_greeting.html
index 20da231..5a59fe0 100644
--- a/kpov_judge/web/kpov_judge/templates/task_greeting.html
+++ b/kpov_judge/web/kpov_judge/templates/task_greeting.html
@@ -33,7 +33,8 @@ section > ul {
<section>
<a href="setup.png"><img src="setup.png" class="setup"></a>
-{{instructions}}
+
+{% include instructions %}
<p>
<a href="howto/">Podrobna navodila (HOWTO)</a>