+ PrawdaFalsz = (function(_super) {
+
+ __extends(PrawdaFalsz, _super);
+
+ function PrawdaFalsz(element) {
+ var qp, _i, _len, _ref;
+ PrawdaFalsz.__super__.constructor.call(this, element);
+ _ref = $(".question-piece", this.element);
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ qp = _ref[_i];
+ $(".true", qp).click(function(ev) {
+ ev.preventDefault();
+ $(this).closest(".question-piece").data("value", "true");
+ return $(this).addClass('chosen').siblings('a').removeClass('chosen');
+ });
+ $(".false", qp).click(function(ev) {
+ ev.preventDefault();
+ $(this).closest(".question-piece").data("value", "false");
+ return $(this).addClass('chosen').siblings('a').removeClass('chosen');
+ });
+ }
+ }
+
+ PrawdaFalsz.prototype.check_question = function() {
+ var all, good, qp, _i, _len, _ref;
+ all = 0;
+ good = 0;
+ _ref = $(".question-piece", this.element);
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ qp = _ref[_i];
+ if ($(qp).data("solution").toString() === $(qp).data("value")) {
+ good += 1;
+ this.piece_correct(qp);
+ } else {
+ this.piece_incorrect(qp);
+ }
+ all += 1;
+ }
+ return [good, all];
+ };
+
+ return PrawdaFalsz;
+
+ })(Excercise);
+