X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/3268c2681874b53c1a9fbda5f7ab1388d62226b4..90654be51d9c0fe797340fe1c39ffcca3665d780:/catalogue/static/catalogue/js/edumed.js diff --git a/catalogue/static/catalogue/js/edumed.js b/catalogue/static/catalogue/js/edumed.js index f720aca..b05cc9c 100644 --- a/catalogue/static/catalogue/js/edumed.js +++ b/catalogue/static/catalogue/js/edumed.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.3.3 (function() { var $, Binding, EduModule, Exercise, Luki, PrawdaFalsz, Przyporzadkuj, Uporzadkuj, Wybor, Zastap, exercise, __hasProp = {}.hasOwnProperty, @@ -40,8 +40,8 @@ $(this.element).data("exercise-html", $(this.element).html()); $(".check", this.element).click(function(ev) { _this.check(); - $(ev.target).next(".retry").show(); - return $(ev.target).hide(); + $(".retry", _this.element).show(); + return $(".check", _this.element).hide(); }); $(".retry", this.element).click(function(ev) { return _this.retry(); @@ -364,18 +364,17 @@ Luki.prototype.check = function() { var all, correct, _this = this; - all = 0; + all = $(".placeholder", this.element).length; correct = 0; $(".placeholder + .question-piece", this.element).each(function(i, qpiece) { var $placeholder; $placeholder = $(qpiece).prev(".placeholder"); if ($placeholder.data('solution') === $(qpiece).data('no')) { _this.piece_correct(qpiece); - correct += 1; + return correct += 1; } else { - _this.piece_incorrect(qpiece); + return _this.piece_incorrect(qpiece); } - return all += 1; }); return this.show_score([correct, all]); };