X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/2c29cc5cf878a27f7fd16f4ac2c10472263bcfc1..28e55ad9db74291ea3ca8380fb2bf96280336f55:/wtem/static/wtem/edumed.js diff --git a/wtem/static/wtem/edumed.js b/wtem/static/wtem/edumed.js index 2a6ddb0..940ca54 100644 --- a/wtem/static/wtem/edumed.js +++ b/wtem/static/wtem/edumed.js @@ -372,6 +372,16 @@ return _results; }; + Uporzadkuj.prototype.get_answer = function(question) { + var answer, + _this = this; + answer = []; + $(".question-piece", this.element).each(function(i, qpiece) { + return answer.push($(qpiece).attr('data-pos')); + }); + return answer; + }; + return Uporzadkuj; })(Exercise); @@ -533,6 +543,12 @@ return d1.data("no") === d2.data("no"); }; + Przyporzadkuj.prototype.draggable_accept = function($draggable, $droppable) { + var dropped; + dropped = $droppable.closest("ul, ol").find(".draggable"); + return (Przyporzadkuj.__super__.draggable_accept.call(this, $draggable, $droppable)) && dropped.length === 0; + }; + Przyporzadkuj.prototype.check_question = function(question) { var all, bad_count, count, mandatory, minimum, optional, pn, pred, qp, self, v, _i, _j, _len, _len1, _ref, _ref1; minimum = $(question).data("minimum"); @@ -682,6 +698,16 @@ return _results; }; + PrawdaFalsz.prototype.get_answer = function(question) { + var answer, + _this = this; + answer = []; + $(".question-piece", this.element).each(function(i, qpiece) { + return answer.push($(qpiece).data('value') || '-'); + }); + return answer; + }; + return PrawdaFalsz; })(Exercise);