X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a980dc9ed36f367a04dfdc56e277375d9cca1bd1..59f6e6616b1b01350f1eaa97ed026e8a8524da1f:/redakcja/static/edumed/js/edumed.js diff --git a/redakcja/static/edumed/js/edumed.js b/redakcja/static/edumed/js/edumed.js index a99377de..f720aca1 100644 --- a/redakcja/static/edumed/js/edumed.js +++ b/redakcja/static/edumed/js/edumed.js @@ -125,7 +125,14 @@ }; Exercise.prototype.show_score = function(score) { - return $(".message", this.element).text("Wynik: " + score[0] + " / " + score[1]); + var $msg; + $msg = $(".message", this.element); + $msg.text("Wynik: " + score[0] + " / " + score[1]); + if (score[0] === score[1]) { + return $msg.addClass("maxscore"); + } else { + return $msg.removeClass("maxscore"); + } }; Exercise.prototype.draggable_equal = function($draggable1, $draggable2) { @@ -486,7 +493,7 @@ _ref = $(".question-piece", this.element); for (_i = 0, _len = _ref.length; _i < _len; _i++) { qp = _ref[_i]; - if ($(qp).data('solution').split(/[ ,]+/).length > 1) { + if ($(qp).attr('data-solution').split(/[ ,]+/).length > 1) { return true; } } @@ -509,7 +516,7 @@ count = 0; all = 0; if (!minimum) { - all = $(".subjects .question-piece", question).length; + all = $(".subject .question-piece", question).length; } _ref = $(".predicate [data-predicate]", question); for (_i = 0, _len = _ref.length; _i < _len; _i++) {