From 88afe908cdc2cd584c551730a98d1b312df48958 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 6 Aug 2014 14:22:18 +0200 Subject: [PATCH] wlxml: isContextRoot for the reminder of edumed exercises (fixup) --- src/wlxml/extensions/edumed/edumed.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wlxml/extensions/edumed/edumed.js b/src/wlxml/extensions/edumed/edumed.js index 6e01d6e..ca29ad3 100644 --- a/src/wlxml/extensions/edumed/edumed.js +++ b/src/wlxml/extensions/edumed/edumed.js @@ -157,6 +157,9 @@ var extension = {wlxmlClass: {'exercise.order': { }}}; var choiceMethods = { + isContextRoot: function(node) { + return this.object.isChoiceList(node.parent()) || this.sameNode(node); + }, getChoiceList: function() { return this.contents() .filter(function(n) { return this.object.isChoiceList(n); }.bind(this))[0]; @@ -209,6 +212,14 @@ extension.wlxmlClass['exercise.choice.true-or-false'] = { methods: choiceMethods }; +extension.wlxmlClass['exercise.gap'] = extension.wlxmlClass['exercise.replace'] = { + methods: { + isContextRoot: function(node) { + return this.sameNode(node); + } + } +}; + extension.document = { methods: { edumedCreateExerciseNode: function(klass) { -- 2.20.1