+ })(Excercise);
+
+ Zastap = (function(_super) {
+
+ __extends(Zastap, _super);
+
+ function Zastap(element) {
+ var _this = this;
+ Zastap.__super__.constructor.call(this, element);
+ $(".paragraph", this.element).each(function(i, par) {
+ var spans;
+ _this.wrap_words($(par), $('<span class="zastap question-piece"/>'));
+ spans = $("> span", par).attr("contenteditable", "true");
+ return spans.click(function(ev) {
+ spans.filter(':not(:empty)').removeClass('editing');
+ return $(ev.target).addClass('editing');
+ });
+ });
+ }
+
+ Zastap.prototype.check = function() {
+ var all, correct,
+ _this = this;
+ all = 0;
+ correct = 0;
+ $(".question-piece", this.element).each(function(i, qpiece) {
+ var should_be_changed, txt;
+ txt = $(qpiece).data('original');
+ should_be_changed = false;
+ if (!(txt != null)) {
+ txt = $(qpiece).data('solution');
+ should_be_changed = true;
+ }
+ if (!(txt != null)) return;
+ if (should_be_changed) all += 1;
+ if (txt !== $(qpiece).text()) {
+ return _this.piece_incorrect(qpiece);
+ } else {
+ if (should_be_changed) {
+ _this.piece_correct(qpiece);
+ return correct += 1;
+ }
+ }
+ });
+ return this.show_score([correct, all]);