wip: file upload exercise
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 31 Oct 2013 10:57:03 +0000 (11:57 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 15 Jan 2014 10:18:53 +0000 (11:18 +0100)
wtem/static/wtem/wtem.js
wtem/templates/wtem/exercises/file_upload.html [new file with mode: 0644]
wtem/templates/wtem/main.html

index f87ad42..f7dccdc 100644 (file)
@@ -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 (file)
index 0000000..44b78e6
--- /dev/null
@@ -0,0 +1,15 @@
+<div>
+
+    <h3>Zadanie {{no}}</h3>
+        
+    <div class="description">
+        {% for para in exercise.description %}
+            <p class="paragraph">
+                {{para}}
+            </p>
+        {% endfor %}
+    </div>
+
+    <input type="file"/>
+
+</div>
\ No newline at end of file
index ccb6023..e7ce29a 100644 (file)
@@ -9,6 +9,8 @@
 
 {% block body %}
 
+<form>
+
 {% 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 @@
 <hr/>
 <button style="display: block; margin: auto;" id="submit_answers">Wyślij moje odpowiedzi</button>
 
+</form>
+
 {% endblock %}
\ No newline at end of file