orderExerciseElement = require('./order/element'),
gapsExerciseElement = require('./gaps/element'),
replaceExerciseElement = require('./replace/element'),
- choiceExerciseElements = require('./choice/element');
+ choiceExerciseElements = require('./choice/element'),
+ matchExerciseElement = require('./match/element');
return {
actions: actions.concat(gapsActions).concat(replaceActions),
- canvasElements: [orderExerciseElement, gapsExerciseElement, replaceExerciseElement].concat(choiceExerciseElements)
+ canvasElements: [orderExerciseElement, gapsExerciseElement, replaceExerciseElement, matchExerciseElement]
+ .concat(choiceExerciseElements)
};
});
\ No newline at end of file
--- /dev/null
+define(function(require) {
+
+'use strict';
+
+
+var $ = require('libs/jquery'),
+ _ = require('libs/underscore'),
+ elementBase = require('plugins/core/edumed/elementBase'),
+ viewTemplate = require('libs/text!./view.html');
+
+var MatchExerciseElement = Object.create(elementBase);
+_.extend(MatchExerciseElement, {
+ init: function() {
+ elementBase.init.call(this);
+ var view = $(_.template(viewTemplate)());
+ this._container().append(view);
+
+ this.createContainer(this.wlxmlNode.contents(), {
+ resetBackground: true,
+ manages: function() {
+ return true;
+ }
+ });
+ }
+});
+
+return {tag: 'div', klass: 'exercise.match', prototype: MatchExerciseElement};
+
+});
--- /dev/null
+<div class="edumed-exercise exercise-match">
+ <div class="header"><%= gettext('Exercise') %>: <%= gettext('Match') %></div>
+</div>
\ No newline at end of file
'choice.single': require('libs/text!./choiceSingle.xml'),
'choice.true-or-false': require('libs/text!./choiceTrueOrFalse.xml'),
gap: require('libs/text!./gaps.xml'),
- replace: require('libs/text!./replace.xml')
+ replace: require('libs/text!./replace.xml'),
+ match: require('libs/text!./match.xml')
};
var Item = function(node, exerciseNode) {
methods: choiceMethods
};
-extension.wlxmlClass['exercise.gap'] = extension.wlxmlClass['exercise.replace'] = {
+extension.wlxmlClass['exercise.gap'] = extension.wlxmlClass['exercise.replace'] = extension.wlxmlClass['exercise.match'] = {
methods: {
isContextRoot: function(node) {
return this.sameNode(node);
--- /dev/null
+<div class="exercise.match">
+ <div class="p">[polecenie]</div>
+ <div class="list" name="kategorie">
+ <div class="item.category" name="1">a</div>
+ </div>
+ <div class="p">nagłówek:</div>
+ <div class="list" dest="kategorie">
+ <div class="item.answer" answer="1">alina</div>
+ </div>
+</div>
\ No newline at end of file