From: Aleksander Ɓukasz Date: Thu, 31 Oct 2013 12:08:55 +0000 (+0100) Subject: Exercise of type uporzadkuj X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/dea159c4f345f5525760ee0b2519ef00afda5023 Exercise of type uporzadkuj --- diff --git a/wtem/static/wtem/edumed.coffee b/wtem/static/wtem/edumed.coffee index cb1920b..f4c5c28 100644 --- a/wtem/static/wtem/edumed.coffee +++ b/wtem/static/wtem/edumed.coffee @@ -297,6 +297,12 @@ class Uporzadkuj extends Exercise 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 diff --git a/wtem/static/wtem/edumed.js b/wtem/static/wtem/edumed.js index 18ed499..df98753 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); diff --git a/wtem/templates/wtem/exercises/edumed_uporzadkuj.html b/wtem/templates/wtem/exercises/edumed_uporzadkuj.html new file mode 100644 index 0000000..dad28f3 --- /dev/null +++ b/wtem/templates/wtem/exercises/edumed_uporzadkuj.html @@ -0,0 +1,22 @@ +
+ +

Zadanie {{no}}

+ +
+
+ {% for para in exercise.description %} +

+ {{para}} +

+ {% endfor %} +
+ +
    + {% for item in exercise.items %} +
  1. {{item.text}}
  2. + {% endfor %} +
+ +
+
+