fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
720b406
)
Sending exercise ids when submitting the contest form
author
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 6 Nov 2013 09:53:32 +0000
(10:53 +0100)
committer
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 15 Jan 2014 10:18:54 +0000
(11:18 +0100)
wtem/static/wtem/wtem.js
patch
|
blob
|
history
wtem/templates/wtem/exercises/edumed_prawdafalsz.html
patch
|
blob
|
history
wtem/templates/wtem/exercises/edumed_przyporzadkuj.html
patch
|
blob
|
history
wtem/templates/wtem/exercises/edumed_uporzadkuj.html
patch
|
blob
|
history
wtem/templates/wtem/exercises/edumed_wybor.html
patch
|
blob
|
history
wtem/templates/wtem/exercises/file_upload.html
patch
|
blob
|
history
wtem/templates/wtem/exercises/open.html
patch
|
blob
|
history
diff --git
a/wtem/static/wtem/wtem.js
b/wtem/static/wtem/wtem.js
index
3f9bfad
..
5056b73
100644
(file)
--- a/
wtem/static/wtem/wtem.js
+++ b/
wtem/static/wtem/wtem.js
@@
-4,7
+4,7
@@
$(function() {
$('#submit_answers').click(function(e) {
//e.preventDefault();
$('#submit_answers').click(function(e) {
//e.preventDefault();
- to_submit =
[]
;
+ to_submit =
{}
;
$('.exercise-wtem').each(function() {
var el = $(this);
$('.exercise-wtem').each(function() {
var el = $(this);
@@
-21,16
+21,20
@@
$(function() {
$('input[name=answers]').val(JSON.stringify(to_submit));
});
$('input[name=answers]').val(JSON.stringify(to_submit));
});
+ var push_answer = function(el, answer) {
+ to_submit[el.attr('data-id')] = answer
+ };
+
var handlers = {
edumed: function(el) {
var exercise = el.data('exercise');
if(exercise.get_answers) {
var handlers = {
edumed: function(el) {
var exercise = el.data('exercise');
if(exercise.get_answers) {
-
to_submit.push(
exercise.get_answers()[0]);
+
push_answer(el,
exercise.get_answers()[0]);
}
},
open: function(el) {
}
},
open: function(el) {
-
to_submit.push(
el.find('textarea').val());
+
push_answer(el,
el.find('textarea').val());
}
}
}
}
diff --git
a/wtem/templates/wtem/exercises/edumed_prawdafalsz.html
b/wtem/templates/wtem/exercises/edumed_prawdafalsz.html
index
b5b7c3f
..
9ea5a5a
100644
(file)
--- a/
wtem/templates/wtem/exercises/edumed_prawdafalsz.html
+++ b/
wtem/templates/wtem/exercises/edumed_prawdafalsz.html
@@
-1,4
+1,4
@@
-<div class="exercise exercise-wtem prawdafalsz" data-type="prawdafalsz">
+<div class="exercise exercise-wtem prawdafalsz" data-type="prawdafalsz"
data-id="{{exercise.id}}"
>
<h3>Zadanie {{no}}</h3>
<h3>Zadanie {{no}}</h3>
diff --git
a/wtem/templates/wtem/exercises/edumed_przyporzadkuj.html
b/wtem/templates/wtem/exercises/edumed_przyporzadkuj.html
index
b5a1a3d
..
3fb9517
100644
(file)
--- a/
wtem/templates/wtem/exercises/edumed_przyporzadkuj.html
+++ b/
wtem/templates/wtem/exercises/edumed_przyporzadkuj.html
@@
-1,4
+1,4
@@
-<div class="exercise exercise-wtem przyporzadkuj" data-type="przyporzadkuj">
+<div class="exercise exercise-wtem przyporzadkuj" data-type="przyporzadkuj"
data-id="{{exercise.id}}"
>
<h3>Zadanie {{no}}</h3>
<h3>Zadanie {{no}}</h3>
diff --git
a/wtem/templates/wtem/exercises/edumed_uporzadkuj.html
b/wtem/templates/wtem/exercises/edumed_uporzadkuj.html
index
082ae49
..
5da6053
100644
(file)
--- a/
wtem/templates/wtem/exercises/edumed_uporzadkuj.html
+++ b/
wtem/templates/wtem/exercises/edumed_uporzadkuj.html
@@
-1,4
+1,4
@@
-<div class="exercise exercise-wtem uporzadkuj" data-type="uporzadkuj">
+<div class="exercise exercise-wtem uporzadkuj" data-type="uporzadkuj"
data-id="{{exercise.id}}"
>
<h3>Zadanie {{no}}</h3>
<h3>Zadanie {{no}}</h3>
diff --git
a/wtem/templates/wtem/exercises/edumed_wybor.html
b/wtem/templates/wtem/exercises/edumed_wybor.html
index
3fdb80a
..
031c718
100644
(file)
--- a/
wtem/templates/wtem/exercises/edumed_wybor.html
+++ b/
wtem/templates/wtem/exercises/edumed_wybor.html
@@
-1,4
+1,4
@@
-<div class="exercise exercise-wtem wybor" data-type="wybor">
+<div class="exercise exercise-wtem wybor" data-type="wybor"
data-id="{{exercise.id}}"
>
<h3>Zadanie {{no}}</h3>
<h3>Zadanie {{no}}</h3>
diff --git
a/wtem/templates/wtem/exercises/file_upload.html
b/wtem/templates/wtem/exercises/file_upload.html
index
df6f64b
..
e74e373
100644
(file)
--- a/
wtem/templates/wtem/exercises/file_upload.html
+++ b/
wtem/templates/wtem/exercises/file_upload.html
@@
-1,4
+1,4
@@
-<div class="exercise-wtem" data-type="file">
+<div class="exercise-wtem" data-type="file"
data-id="{{exercise.id}}"
>
<h3>Zadanie {{no}}</h3>
<h3>Zadanie {{no}}</h3>
diff --git
a/wtem/templates/wtem/exercises/open.html
b/wtem/templates/wtem/exercises/open.html
index
dbb3f53
..
4d2c782
100644
(file)
--- a/
wtem/templates/wtem/exercises/open.html
+++ b/
wtem/templates/wtem/exercises/open.html
@@
-1,4
+1,4
@@
-<div class="exercise-wtem" data-type="open">
+<div class="exercise-wtem" data-type="open"
data-id="{{exercise.id}}"
>
<h3>Zadanie {{no}}</h3>
<h3>Zadanie {{no}}</h3>