fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow for only one item in a bucket in questions of type "przyporzadkuj"
[edumed.git]
/
wtem
/
static
/
wtem
/
edumed.coffee
diff --git
a/wtem/static/wtem/edumed.coffee
b/wtem/static/wtem/edumed.coffee
index
cb1920b
..
ae7aea9
100644
(file)
--- a/
wtem/static/wtem/edumed.coffee
+++ b/
wtem/static/wtem/edumed.coffee
@@
-297,6
+297,12
@@
class Uporzadkuj extends Exercise
for p in pkts
parent.prepend(p)
for p in pkts
parent.prepend(p)
+ get_answer: (question) ->
+ answer = []
+ $(".question-piece", @element).each (i, qpiece) =>
+ answer.push($(qpiece).attr('data-pos'))
+ return answer
+
# XXX propozycje="1/0"
class Luki extends Exercise
# XXX propozycje="1/0"
class Luki extends Exercise
@@
-409,6
+415,9
@@
class Przyporzadkuj extends Exercise
draggable_equal: (d1, d2) ->
return d1.data("no") == d2.data("no")
draggable_equal: (d1, d2) ->
return d1.data("no") == d2.data("no")
+ draggable_accept: ($draggable, $droppable) ->
+ dropped = $droppable.closest("ul, ol").find(".draggable")
+ return (super $draggable, $droppable) && dropped.length == 0
check_question: (question) ->
# subjects placed in predicates
check_question: (question) ->
# subjects placed in predicates