for p in pkts
parent.prepend(p)
+ get_answer: (question) ->
+ answer = []
+ $(".question-piece", @element).each (i, qpiece) =>
+ answer.push($(qpiece).attr('data-pos'))
+ return answer
+
# XXX propozycje="1/0"
class Luki extends Exercise
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);
--- /dev/null
+<div class="exercise uporzadkuj" data-type="uporzadkuj">
+
+ <h3>Zadanie {{no}}</h3>
+
+ <div class="question" data-no="1">
+ <div class="description">
+ {% for para in exercise.description %}
+ <p class="paragraph">
+ {{para}}
+ </p>
+ {% endfor %}
+ </div>
+
+ <ol class="lista num ui-sortable">
+ {% for item in exercise.items %}
+ <li class="question-piece" data-pos="{{item.id}}">{{item.text}}</li>
+ {% endfor %}
+ </ol>
+
+ </div>
+</div>
+