fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wip: showing first couple of questions
[edumed.git]
/
wtem
/
static
/
wtem
/
edumed.coffee
diff --git
a/wtem/static/wtem/edumed.coffee
b/wtem/static/wtem/edumed.coffee
index
fb8ea87
..
baae08e
100644
(file)
--- a/
wtem/static/wtem/edumed.coffee
+++ b/
wtem/static/wtem/edumed.coffee
@@
-67,6
+67,12
@@
class Exercise extends Binding
$(".question", @element).each (i, question) =>
@solve_question question
$(".question", @element).each (i, question) =>
@solve_question question
+ get_answers: ->
+ answers = []
+ $('.question', @element).each (i, question) =>
+ answers.push(@get_answer question)
+ return answers
+
# Parses a list of values, separated by space or comma.
# The list is read from data attribute of elem using data_key
# Returns a list with elements
# Parses a list of values, separated by space or comma.
# The list is read from data attribute of elem using data_key
# Returns a list with elements
@@
-243,6
+249,13
@@
class Wybor extends Exercise
console.log("check " + $("input[type=checkbox]", qpiece).attr("id") + " -> " + should_be_checked)
$("input[type=checkbox],input[type=radio]", qpiece).prop 'checked', should_be_checked
console.log("check " + $("input[type=checkbox]", qpiece).attr("id") + " -> " + should_be_checked)
$("input[type=checkbox],input[type=radio]", qpiece).prop 'checked', should_be_checked
+ get_answer: (question) ->
+ answer = []
+ $('.question-piece', question).each (i, qpiece) =>
+ $qpiece = $(qpiece)
+ if $("input[type=checkbox],input[type=radio]", qpiece).is(':checked')
+ answer.push($qpiece.attr('data-name'))
+ return answer
class Uporzadkuj extends Exercise
class Uporzadkuj extends Exercise