+ Przyporzadkuj.prototype.check_question = function(question) {
+ var all, all_multiple, count, mandatory, optional, pn, pred, qp, v, _i, _j, _len, _len2, _ref, _ref2;
+ count = 0;
+ all = 0;
+ all_multiple = 0;
+ _ref = $(".predicate .question-piece", question);
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ qp = _ref[_i];
+ pred = $(qp).closest("[data-predicate]");
+ v = this.get_value_optional_list(qp, 'solution');
+ mandatory = v[0];
+ optional = v[1];
+ all_multiple += mandatory.length + optional.length;
+ pn = pred.data('predicate');
+ if (mandatory.indexOf(pn) >= 0 || optional.indexOf(pn) >= 0) {
+ count += 1;
+ this.piece_correct(qp);
+ } else {
+ this.piece_incorrect(qp);
+ }
+ all += 1;
+ }
+ if (this.multiple) {
+ _ref2 = $(".subject .question-piece", question);
+ for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
+ qp = _ref2[_j];
+ v = this.get_value_optional_list(qp, 'solution');
+ mandatory = v[0];
+ optional = v[1];
+ all_multiple += mandatory.length + optional.length;
+ }
+ return [count, all_multiple];
+ } else {
+ return [count, all];
+ }
+ };
+