From dd0b1138bec01e917fb3105be5ba41325370aa41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 31 Oct 2013 11:57:03 +0100 Subject: [PATCH 1/1] wip: file upload exercise --- wtem/static/wtem/wtem.js | 3 ++- wtem/templates/wtem/exercises/file_upload.html | 15 +++++++++++++++ wtem/templates/wtem/main.html | 4 ++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 wtem/templates/wtem/exercises/file_upload.html diff --git a/wtem/static/wtem/wtem.js b/wtem/static/wtem/wtem.js index f87ad42..f7dccdc 100644 --- a/wtem/static/wtem/wtem.js +++ b/wtem/static/wtem/wtem.js @@ -1,6 +1,7 @@ $(function() { - $('#submit_answers').click(function() { + $('#submit_answers').click(function(e) { + e.preventDefault(); var to_submit = []; $('.exercise').each(function() { var exercise = $(this).data('exercise'); diff --git a/wtem/templates/wtem/exercises/file_upload.html b/wtem/templates/wtem/exercises/file_upload.html new file mode 100644 index 0000000..44b78e6 --- /dev/null +++ b/wtem/templates/wtem/exercises/file_upload.html @@ -0,0 +1,15 @@ +
+ +

Zadanie {{no}}

+ +
+ {% for para in exercise.description %} +

+ {{para}} +

+ {% endfor %} +
+ + + +
\ No newline at end of file diff --git a/wtem/templates/wtem/main.html b/wtem/templates/wtem/main.html index ccb6023..e7ce29a 100644 --- a/wtem/templates/wtem/main.html +++ b/wtem/templates/wtem/main.html @@ -9,6 +9,8 @@ {% block body %} +
+ {% for exercise in exercises %} {% with 'wtem/exercises/'|add:exercise.type|add:'.html' as template_name %} {% include template_name with exercise=exercise no=forloop.counter %} @@ -19,4 +21,6 @@
+
+ {% endblock %} \ No newline at end of file -- 2.20.1