X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/cf8a573be6af7f94e71d336f3faca2a282614693..9bbe52622c560b271025eef19754c301f6a44c5b:/redakcja/static/edumed/js/edumed.coffee?ds=sidebyside diff --git a/redakcja/static/edumed/js/edumed.coffee b/redakcja/static/edumed/js/edumed.coffee index adc3ae56..8b02ae96 100644 --- a/redakcja/static/edumed/js/edumed.coffee +++ b/redakcja/static/edumed/js/edumed.coffee @@ -72,10 +72,14 @@ class Wybor extends Excercise check_question: (question) -> all = 0 good = 0 - solution = @get_value_list(question, 'solution', true) + solution = @get_value_list(question, 'solution') $(".question-piece", question).each (i, qpiece) => - piece_no = parseInt $(qpiece).attr 'data-no' - should_be_checked = solution.indexOf(piece_no) >= 0 + piece_no = $(qpiece).attr 'data-no' + piece_name = $(qpiece).attr 'data-name' + if piece_name + should_be_checked = solution.indexOf(piece_name) >= 0 + else + should_be_checked = solution.indexOf(piece_no) >= 0 is_checked = $("input", qpiece).is(":checked") if should_be_checked