From dea159c4f345f5525760ee0b2519ef00afda5023 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 31 Oct 2013 13:08:55 +0100 Subject: [PATCH 1/1] Exercise of type uporzadkuj --- wtem/static/wtem/edumed.coffee | 6 +++++ wtem/static/wtem/edumed.js | 10 +++++++++ .../wtem/exercises/edumed_uporzadkuj.html | 22 +++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 wtem/templates/wtem/exercises/edumed_uporzadkuj.html 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 %} +
+ +
+
+ -- 2.20.1