diff --git a/admin/tool/lp/amd/build/competencyruleconfig.min.js b/admin/tool/lp/amd/build/competencyruleconfig.min.js
index 11b49530409..cae8de7fa76 100644
--- a/admin/tool/lp/amd/build/competencyruleconfig.min.js
+++ b/admin/tool/lp/amd/build/competencyruleconfig.min.js
@@ -5,6 +5,6 @@
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-define("tool_lp/competencyruleconfig",["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/competency_outcomes","core/str"],(function($,Notification,Templates,Dialogue,Outcomes,Str){var RuleConfig=function(tree,rulesModules){this._eventNode=$("
"),this._tree=tree,this._rulesModules=rulesModules,this._setUp()};return RuleConfig.prototype._competency=null,RuleConfig.prototype._eventNode=null,RuleConfig.prototype._outcomesOption=null,RuleConfig.prototype._popup=null,RuleConfig.prototype._ready=null,RuleConfig.prototype._rules=null,RuleConfig.prototype._rulesModules=null,RuleConfig.prototype._tree=null,RuleConfig.prototype._afterChange=function(){this._isValid()?this._find('[data-action="save"]').prop("disabled",!1):this._find('[data-action="save"]').prop("disabled",!0)},RuleConfig.prototype._afterRuleConfigChange=function(e,rule){rule==this._getRule()&&this._afterChange()},RuleConfig.prototype._afterRender=function(){var self=this;self._find('[name="outcome"]').on("change",(function(){self._switchedOutcome()})).trigger("change"),self._find('[name="rule"]').on("change",(function(){self._switchedRule()})).trigger("change"),self._find('[data-action="save"]').on("click",(function(){self._trigger("save",self._getConfig()),self.close()})),self._find('[data-action="cancel"]').on("click",(function(){self.close()}))},RuleConfig.prototype.canBeConfigured=function(){var can=!1;return $.each(this._rules,(function(index,rule){rule.canConfig()&&(can=!0)})),can},RuleConfig.prototype.close=function(){this._popup.close(),this._popup=null},RuleConfig.prototype.display=function(){var self=this;return!!self._competency&&$.when(Str.get_string("competencyrule","tool_lp"),self._render()).then((function(title,render){self._popup=new Dialogue(title,render[0],self._afterRender.bind(self))})).fail(Notification.exception)},RuleConfig.prototype._find=function(selector){return $(this._popup.getContent()).find(selector)},RuleConfig.prototype._getApplicableOutcomesOptions=function(){var self=this,options=[];return $.each(self._outcomesOption,(function(index,outcome){options.push({code:outcome.code,name:outcome.name,selected:outcome.code==self._competency.ruleoutcome})})),options},RuleConfig.prototype._getApplicableRulesOptions=function(){var self=this,options=[];return $.each(self._rules,(function(index,rule){rule.canConfig()&&options.push({name:self._getRuleName(rule.getType()),type:rule.getType(),selected:rule.getType()==self._competency.ruletype})})),options},RuleConfig.prototype._getConfig=function(){var rule=this._getRule();return{ruletype:rule?rule.getType():null,ruleconfig:rule?rule.getConfig():null,ruleoutcome:this._getOutcome()}},RuleConfig.prototype._getOutcome=function(){return this._find('[name="outcome"]').val()},RuleConfig.prototype._getRule=function(){var result,type=this._find('[name="rule"]').val();return $.each(this._rules,(function(index,rule){rule.getType()!=type||(result=rule)})),result},RuleConfig.prototype._getRuleName=function(type){var name;return $.each(this._rulesModules,(function(index,modInfo){modInfo.type!=type||(name=modInfo.name)})),name},RuleConfig.prototype._initOutcomes=function(){var self=this;return Outcomes.getAll().then((function(outcomes){self._outcomesOption=outcomes}))},RuleConfig.prototype._initRules=function(){var self=this,promises=[];return $.each(self._rules,(function(index,rule){var promise=rule.init().then((function(){rule.setTargetCompetency(self._competency),rule.on("change",self._afterRuleConfigChange.bind(self))}),(function(){return self._rules.splice(index,1),$.when()}));promises.push(promise)})),$.when.apply($.when,promises)},RuleConfig.prototype._isValid=function(){var outcome=this._getOutcome(),rule=this._getRule();return outcome==Outcomes.NONE||!!rule&&rule.isValid()},RuleConfig.prototype.on=function(type,handler){this._eventNode.on(type,handler)},RuleConfig.prototype._preRender=function(){return this.ready()},RuleConfig.prototype.ready=function(){return this._ready.promise()},RuleConfig.prototype._render=function(){var self=this;return this._preRender().then((function(){var config;self.canBeConfigured()?((config={}).outcomes=self._getApplicableOutcomesOptions(),config.rules=self._getApplicableRulesOptions()):config=!1;var context={competencyshortname:self._competency.shortname,config:config};return Templates.render("tool_lp/competency_rule_config",context)}))},RuleConfig.prototype.setTargetCompetencyId=function(competencyId){var self=this;self._competency=self._tree.getCompetency(competencyId),$.each(self._rules,(function(index,rule){rule.setTargetCompetency(self._competency)}))},RuleConfig.prototype._setUp=function(){var self=this,promises=[],modules=[];self._ready=$.Deferred(),self._rules=[],$.each(self._rulesModules,(function(index,rule){modules.push(rule.amd)})),require(modules,(function(){$.each(arguments,(function(index,Module){var rule=new Module(self._tree);self._rules.push(rule)})),promises.push(self._initRules()),promises.push(self._initOutcomes()),$.when.apply($.when,promises).always((function(){self._ready.resolve()}))}))},RuleConfig.prototype._switchedOutcome=function(){if(this._getOutcome()==Outcomes.NONE)return this._find('[data-region="rule-type"]').hide().find('[name="rule"]').val(-1),this._find('[data-region="rule-config"]').empty().hide(),void this._afterChange();this._find('[data-region="rule-type"]').show(),this._find('[data-region="rule-config"]').show(),this._afterChange()},RuleConfig.prototype._switchedRule=function(){var self=this,container=self._find('[data-region="rule-config"]'),rule=self._getRule();if(!rule)return container.empty().hide(),void self._afterChange();rule.injectTemplate(container).then((function(){container.show()})).always((function(){self._afterChange()})).catch((function(){container.empty().hide()}))},RuleConfig.prototype._trigger=function(type,data){this._eventNode.trigger(type,[data])},RuleConfig}));
+define("tool_lp/competencyruleconfig",["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/competency_outcomes","core/str"],(function($,Notification,Templates,Dialogue,Outcomes,Str){var RuleConfig=function(tree,rulesModules){this._eventNode=$(""),this._tree=tree,this._rulesModules=rulesModules,this._setUp()};return RuleConfig.prototype._competency=null,RuleConfig.prototype._eventNode=null,RuleConfig.prototype._outcomesOption=null,RuleConfig.prototype._popup=null,RuleConfig.prototype._ready=null,RuleConfig.prototype._rules=null,RuleConfig.prototype._rulesModules=null,RuleConfig.prototype._tree=null,RuleConfig.prototype._afterChange=function(){this._isValid()?this._find('[data-action="save"]').prop("disabled",!1):this._find('[data-action="save"]').prop("disabled",!0)},RuleConfig.prototype._afterRuleConfigChange=function(e,rule){rule==this._getRule()&&this._afterChange()},RuleConfig.prototype._afterRender=function(){var self=this;self._find('[name="outcome"]').on("change",(function(){self._switchedOutcome()})).trigger("change"),self._find('[name="rule"]').on("change",(function(){self._switchedRule()})).trigger("change"),self._find('[data-action="save"]').on("click",(function(){self._trigger("save",self._getConfig()),self.close()})),self._find('[data-action="cancel"]').on("click",(function(){self.close()}))},RuleConfig.prototype.canBeConfigured=function(){var can=!1;return $.each(this._rules,(function(index,rule){rule.canConfig()&&(can=!0)})),can},RuleConfig.prototype.close=function(){this._popup.close(),this._popup=null},RuleConfig.prototype.display=function(){var self=this;return!!self._competency&&$.when(Str.get_string("competencyrule","tool_lp"),self._render()).then((function(title,render){self._popup=new Dialogue(title,render[0],self._afterRender.bind(self),null,!1,"515px")})).fail(Notification.exception)},RuleConfig.prototype._find=function(selector){return $(this._popup.getContent()).find(selector)},RuleConfig.prototype._getApplicableOutcomesOptions=function(){var self=this,options=[];return $.each(self._outcomesOption,(function(index,outcome){options.push({code:outcome.code,name:outcome.name,selected:outcome.code==self._competency.ruleoutcome})})),options},RuleConfig.prototype._getApplicableRulesOptions=function(){var self=this,options=[];return $.each(self._rules,(function(index,rule){rule.canConfig()&&options.push({name:self._getRuleName(rule.getType()),type:rule.getType(),selected:rule.getType()==self._competency.ruletype})})),options},RuleConfig.prototype._getConfig=function(){var rule=this._getRule();return{ruletype:rule?rule.getType():null,ruleconfig:rule?rule.getConfig():null,ruleoutcome:this._getOutcome()}},RuleConfig.prototype._getOutcome=function(){return this._find('[name="outcome"]').val()},RuleConfig.prototype._getRule=function(){var result,type=this._find('[name="rule"]').val();return $.each(this._rules,(function(index,rule){rule.getType()!=type||(result=rule)})),result},RuleConfig.prototype._getRuleName=function(type){var name;return $.each(this._rulesModules,(function(index,modInfo){modInfo.type!=type||(name=modInfo.name)})),name},RuleConfig.prototype._initOutcomes=function(){var self=this;return Outcomes.getAll().then((function(outcomes){self._outcomesOption=outcomes}))},RuleConfig.prototype._initRules=function(){var self=this,promises=[];return $.each(self._rules,(function(index,rule){var promise=rule.init().then((function(){rule.setTargetCompetency(self._competency),rule.on("change",self._afterRuleConfigChange.bind(self))}),(function(){return self._rules.splice(index,1),$.when()}));promises.push(promise)})),$.when.apply($.when,promises)},RuleConfig.prototype._isValid=function(){var outcome=this._getOutcome(),rule=this._getRule();return outcome==Outcomes.NONE||!!rule&&rule.isValid()},RuleConfig.prototype.on=function(type,handler){this._eventNode.on(type,handler)},RuleConfig.prototype._preRender=function(){return this.ready()},RuleConfig.prototype.ready=function(){return this._ready.promise()},RuleConfig.prototype._render=function(){var self=this;return this._preRender().then((function(){var config;self.canBeConfigured()?((config={}).outcomes=self._getApplicableOutcomesOptions(),config.rules=self._getApplicableRulesOptions()):config=!1;var context={competencyshortname:self._competency.shortname,config:config};return Templates.render("tool_lp/competency_rule_config",context)}))},RuleConfig.prototype.setTargetCompetencyId=function(competencyId){var self=this;self._competency=self._tree.getCompetency(competencyId),$.each(self._rules,(function(index,rule){rule.setTargetCompetency(self._competency)}))},RuleConfig.prototype._setUp=function(){var self=this,promises=[],modules=[];self._ready=$.Deferred(),self._rules=[],$.each(self._rulesModules,(function(index,rule){modules.push(rule.amd)})),require(modules,(function(){$.each(arguments,(function(index,Module){var rule=new Module(self._tree);self._rules.push(rule)})),promises.push(self._initRules()),promises.push(self._initOutcomes()),$.when.apply($.when,promises).always((function(){self._ready.resolve()}))}))},RuleConfig.prototype._switchedOutcome=function(){if(this._getOutcome()==Outcomes.NONE)return this._find('[data-region="rule-type"]').hide().find('[name="rule"]').val(-1),this._find('[data-region="rule-config"]').empty().hide(),void this._afterChange();this._find('[data-region="rule-type"]').show(),this._find('[data-region="rule-config"]').show(),this._afterChange()},RuleConfig.prototype._switchedRule=function(){var self=this,container=self._find('[data-region="rule-config"]'),rule=self._getRule();if(!rule)return container.empty().hide(),void self._afterChange();rule.injectTemplate(container).then((function(){container.show()})).always((function(){self._afterChange()})).catch((function(){container.empty().hide()}))},RuleConfig.prototype._trigger=function(type,data){this._eventNode.trigger(type,[data])},RuleConfig}));
//# sourceMappingURL=competencyruleconfig.min.js.map
\ No newline at end of file
diff --git a/admin/tool/lp/amd/build/competencyruleconfig.min.js.map b/admin/tool/lp/amd/build/competencyruleconfig.min.js.map
index abb941a1722..b288205ebb3 100644
--- a/admin/tool/lp/amd/build/competencyruleconfig.min.js.map
+++ b/admin/tool/lp/amd/build/competencyruleconfig.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"competencyruleconfig.min.js","sources":["../src/competencyruleconfig.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule config.\n *\n * @module tool_lp/competencyruleconfig\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/templates',\n 'tool_lp/dialogue',\n 'tool_lp/competency_outcomes',\n 'core/str'],\n function($, Notification, Templates, Dialogue, Outcomes, Str) {\n\n /**\n * Competency rule class.\n *\n * When implementing this you should attach a listener to the event 'save'\n * on the instance. E.g.\n *\n * var config = new RuleConfig(tree, modules);\n * config.on('save', function(e, config) { ... });\n *\n * @param {competencytree} tree The competency tree.\n * @param {Array} rulesModules The modules containing the rules: [{ typeName: { amd: amdModule, name: ruleName }}].\n */\n var RuleConfig = function(tree, rulesModules) {\n this._eventNode = $('');\n this._tree = tree;\n this._rulesModules = rulesModules;\n this._setUp();\n };\n\n /** @property {Object} The current competency. */\n RuleConfig.prototype._competency = null;\n /** @property {Node} The node we attach the events to. */\n RuleConfig.prototype._eventNode = null;\n /** @property {Array} Outcomes options. */\n RuleConfig.prototype._outcomesOption = null;\n /** @property {Dialogue} The dialogue. */\n RuleConfig.prototype._popup = null;\n /** @property {Promise} Resolved when the module is ready. */\n RuleConfig.prototype._ready = null;\n /** @property {Array} The rules. */\n RuleConfig.prototype._rules = null;\n /** @property {Array} The rules modules. */\n RuleConfig.prototype._rulesModules = null;\n /** @property {competencytree} The competency tree. */\n RuleConfig.prototype._tree = null;\n\n /**\n * After change.\n *\n * Triggered when a change occured.\n *\n * @method _afterChange\n * @protected\n */\n RuleConfig.prototype._afterChange = function() {\n if (!this._isValid()) {\n this._find('[data-action=\"save\"]').prop('disabled', true);\n } else {\n this._find('[data-action=\"save\"]').prop('disabled', false);\n }\n };\n\n /**\n * After change in rule's config.\n *\n * Triggered when a change occured in a specific rule config.\n *\n * @method _afterRuleConfigChange\n * @protected\n * @param {Event} e\n * @param {Rule} rule\n */\n RuleConfig.prototype._afterRuleConfigChange = function(e, rule) {\n if (rule != this._getRule()) {\n // This rule is not the current one any more, we can ignore.\n return;\n }\n this._afterChange();\n };\n\n /**\n * After render hook.\n *\n * @method _afterRender\n * @protected\n */\n RuleConfig.prototype._afterRender = function() {\n var self = this;\n\n self._find('[name=\"outcome\"]').on('change', function() {\n self._switchedOutcome();\n }).trigger('change');\n\n self._find('[name=\"rule\"]').on('change', function() {\n self._switchedRule();\n }).trigger('change');\n\n self._find('[data-action=\"save\"]').on('click', function() {\n self._trigger('save', self._getConfig());\n self.close();\n });\n\n self._find('[data-action=\"cancel\"]').on('click', function() {\n self.close();\n });\n };\n\n /**\n * Whether the current competency can be configured.\n *\n * @return {Boolean}\n * @method canBeConfigured\n */\n RuleConfig.prototype.canBeConfigured = function() {\n var can = false;\n $.each(this._rules, function(index, rule) {\n if (rule.canConfig()) {\n can = true;\n return;\n }\n });\n return can;\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n RuleConfig.prototype.close = function() {\n this._popup.close();\n this._popup = null;\n };\n\n /**\n * Opens the picker.\n *\n * @method display\n * @returns {Promise}\n */\n RuleConfig.prototype.display = function() {\n var self = this;\n if (!self._competency) {\n return false;\n }\n return $.when(Str.get_string('competencyrule', 'tool_lp'), self._render())\n .then(function(title, render) {\n self._popup = new Dialogue(\n title,\n render[0],\n self._afterRender.bind(self)\n );\n return;\n }).fail(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @return {JQuery}\n * @method _find\n * @protected\n */\n RuleConfig.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Get the applicable outcome options.\n *\n * @return {Array}\n * @method _getApplicableOutcomesOptions\n * @protected\n */\n RuleConfig.prototype._getApplicableOutcomesOptions = function() {\n var self = this,\n options = [];\n\n $.each(self._outcomesOption, function(index, outcome) {\n options.push({\n code: outcome.code,\n name: outcome.name,\n selected: (outcome.code == self._competency.ruleoutcome) ? true : false,\n });\n });\n\n return options;\n };\n\n /**\n * Get the applicable rules options.\n *\n * @return {Array}\n * @method _getApplicableRulesOptions\n * @protected\n */\n RuleConfig.prototype._getApplicableRulesOptions = function() {\n var self = this,\n options = [];\n\n $.each(self._rules, function(index, rule) {\n if (!rule.canConfig()) {\n return;\n }\n options.push({\n name: self._getRuleName(rule.getType()),\n type: rule.getType(),\n selected: (rule.getType() == self._competency.ruletype) ? true : false,\n });\n });\n\n return options;\n };\n\n /**\n * Get the full config for the competency.\n *\n * @return {Object} Contains rule, ruleoutcome and ruleconfig.\n * @method _getConfig\n * @protected\n */\n RuleConfig.prototype._getConfig = function() {\n var rule = this._getRule();\n return {\n ruletype: rule ? rule.getType() : null,\n ruleconfig: rule ? rule.getConfig() : null,\n ruleoutcome: this._getOutcome()\n };\n };\n\n /**\n * Get the selected outcome code.\n *\n * @return {String}\n * @method _getOutcome\n * @protected\n */\n RuleConfig.prototype._getOutcome = function() {\n return this._find('[name=\"outcome\"]').val();\n };\n\n /**\n * Get the selected rule.\n *\n * @return {null|Rule}\n * @method _getRule\n * @protected\n */\n RuleConfig.prototype._getRule = function() {\n var result,\n type = this._find('[name=\"rule\"]').val();\n\n $.each(this._rules, function(index, rule) {\n if (rule.getType() == type) {\n result = rule;\n return;\n }\n });\n\n return result;\n };\n\n /**\n * Return the name of a rule.\n *\n * @param {String} type The type of a rule.\n * @return {String}\n * @method _getRuleName\n * @protected\n */\n RuleConfig.prototype._getRuleName = function(type) {\n var self = this,\n name;\n $.each(self._rulesModules, function(index, modInfo) {\n if (modInfo.type == type) {\n name = modInfo.name;\n return;\n }\n });\n return name;\n };\n\n /**\n * Initialise the outcomes.\n *\n * @return {Promise}\n * @method _initOutcomes\n * @protected\n */\n RuleConfig.prototype._initOutcomes = function() {\n var self = this;\n return Outcomes.getAll().then(function(outcomes) {\n self._outcomesOption = outcomes;\n return;\n });\n };\n\n /**\n * Initialise the rules.\n *\n * @return {Promise}\n * @method _initRules\n * @protected\n */\n RuleConfig.prototype._initRules = function() {\n var self = this,\n promises = [];\n $.each(self._rules, function(index, rule) {\n var promise = rule.init().then(function() {\n rule.setTargetCompetency(self._competency);\n rule.on('change', self._afterRuleConfigChange.bind(self));\n return;\n }, function() {\n // Upon failure remove the rule, and resolve the promise.\n self._rules.splice(index, 1);\n return $.when();\n });\n promises.push(promise);\n });\n\n return $.when.apply($.when, promises);\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method _isValid\n * @protected\n */\n RuleConfig.prototype._isValid = function() {\n var outcome = this._getOutcome(),\n rule = this._getRule();\n\n if (outcome == Outcomes.NONE) {\n return true;\n } else if (!rule) {\n return false;\n }\n\n return rule.isValid();\n };\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n RuleConfig.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Hook to executed before render.\n *\n * @method _preRender\n * @protected\n * @return {Promise}\n */\n RuleConfig.prototype._preRender = function() {\n // We need to have all the information about the rule plugins first.\n return this.ready();\n };\n\n /**\n * Returns a promise that is resolved when the module is ready.\n *\n * @return {Promise}\n * @method ready\n * @protected\n */\n RuleConfig.prototype.ready = function() {\n return this._ready.promise();\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @protected\n * @return {Promise}\n */\n RuleConfig.prototype._render = function() {\n var self = this;\n return this._preRender().then(function() {\n var config;\n\n if (!self.canBeConfigured()) {\n config = false;\n } else {\n config = {};\n config.outcomes = self._getApplicableOutcomesOptions();\n config.rules = self._getApplicableRulesOptions();\n }\n\n var context = {\n competencyshortname: self._competency.shortname,\n config: config\n };\n\n return Templates.render('tool_lp/competency_rule_config', context);\n });\n };\n\n /**\n * Set the target competency.\n *\n * @param {Number} competencyId The target competency Id.\n * @method setTargetCompetencyId\n */\n RuleConfig.prototype.setTargetCompetencyId = function(competencyId) {\n var self = this;\n self._competency = self._tree.getCompetency(competencyId);\n $.each(self._rules, function(index, rule) {\n rule.setTargetCompetency(self._competency);\n });\n };\n\n /**\n * Set up the instance.\n *\n * @method _setUp\n * @protected\n */\n RuleConfig.prototype._setUp = function() {\n var self = this,\n promises = [],\n modules = [];\n\n self._ready = $.Deferred();\n self._rules = [];\n\n $.each(self._rulesModules, function(index, rule) {\n modules.push(rule.amd);\n });\n\n // Load all the modules.\n require(modules, function() {\n $.each(arguments, function(index, Module) {\n // Instantiate the rule and listen to it.\n var rule = new Module(self._tree);\n self._rules.push(rule);\n });\n\n // Load all the option values.\n promises.push(self._initRules());\n promises.push(self._initOutcomes());\n\n // Ready when everything is done.\n $.when.apply($.when, promises).always(function() {\n self._ready.resolve();\n });\n });\n };\n\n /**\n * Called when the user switches outcome.\n *\n * @method _switchedOutcome\n * @protected\n */\n RuleConfig.prototype._switchedOutcome = function() {\n var self = this,\n type = self._getOutcome();\n\n if (type == Outcomes.NONE) {\n // Reset to defaults.\n self._find('[data-region=\"rule-type\"]').hide()\n .find('[name=\"rule\"]').val(-1);\n self._find('[data-region=\"rule-config\"]').empty().hide();\n self._afterChange();\n return;\n }\n\n self._find('[data-region=\"rule-type\"]').show();\n self._find('[data-region=\"rule-config\"]').show();\n self._afterChange();\n };\n\n /**\n * Called when the user switches rule.\n *\n * @method _switchedRule\n * @protected\n */\n RuleConfig.prototype._switchedRule = function() {\n var self = this,\n container = self._find('[data-region=\"rule-config\"]'),\n rule = self._getRule();\n\n if (!rule) {\n container.empty().hide();\n self._afterChange();\n return;\n }\n rule.injectTemplate(container).then(function() {\n container.show();\n return;\n }).always(function() {\n self._afterChange();\n }).catch(function() {\n container.empty().hide();\n });\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _trigger\n * @protected\n */\n RuleConfig.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n return /** @alias module:tool_lp/competencyruleconfig */ RuleConfig;\n\n});\n"],"names":["define","$","Notification","Templates","Dialogue","Outcomes","Str","RuleConfig","tree","rulesModules","_eventNode","_tree","_rulesModules","_setUp","prototype","_competency","_outcomesOption","_popup","_ready","_rules","_afterChange","this","_isValid","_find","prop","_afterRuleConfigChange","e","rule","_getRule","_afterRender","self","on","_switchedOutcome","trigger","_switchedRule","_trigger","_getConfig","close","canBeConfigured","can","each","index","canConfig","display","when","get_string","_render","then","title","render","bind","fail","exception","selector","getContent","find","_getApplicableOutcomesOptions","options","outcome","push","code","name","selected","ruleoutcome","_getApplicableRulesOptions","_getRuleName","getType","type","ruletype","ruleconfig","getConfig","_getOutcome","val","result","modInfo","_initOutcomes","getAll","outcomes","_initRules","promises","promise","init","setTargetCompetency","splice","apply","NONE","isValid","handler","_preRender","ready","config","rules","context","competencyshortname","shortname","setTargetCompetencyId","competencyId","getCompetency","modules","Deferred","amd","require","arguments","Module","always","resolve","hide","empty","show","container","injectTemplate","catch","data"],"mappings":";;;;;;;AAuBAA,sCAAO,CAAC,SACA,oBACA,iBACA,mBACA,8BACA,aACA,SAASC,EAAGC,aAAcC,UAAWC,SAAUC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../src/competencyruleconfig.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule config.\n *\n * @module tool_lp/competencyruleconfig\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/templates',\n 'tool_lp/dialogue',\n 'tool_lp/competency_outcomes',\n 'core/str'],\n function($, Notification, Templates, Dialogue, Outcomes, Str) {\n\n /**\n * Competency rule class.\n *\n * When implementing this you should attach a listener to the event 'save'\n * on the instance. E.g.\n *\n * var config = new RuleConfig(tree, modules);\n * config.on('save', function(e, config) { ... });\n *\n * @param {competencytree} tree The competency tree.\n * @param {Array} rulesModules The modules containing the rules: [{ typeName: { amd: amdModule, name: ruleName }}].\n */\n var RuleConfig = function(tree, rulesModules) {\n this._eventNode = $('');\n this._tree = tree;\n this._rulesModules = rulesModules;\n this._setUp();\n };\n\n /** @property {Object} The current competency. */\n RuleConfig.prototype._competency = null;\n /** @property {Node} The node we attach the events to. */\n RuleConfig.prototype._eventNode = null;\n /** @property {Array} Outcomes options. */\n RuleConfig.prototype._outcomesOption = null;\n /** @property {Dialogue} The dialogue. */\n RuleConfig.prototype._popup = null;\n /** @property {Promise} Resolved when the module is ready. */\n RuleConfig.prototype._ready = null;\n /** @property {Array} The rules. */\n RuleConfig.prototype._rules = null;\n /** @property {Array} The rules modules. */\n RuleConfig.prototype._rulesModules = null;\n /** @property {competencytree} The competency tree. */\n RuleConfig.prototype._tree = null;\n\n /**\n * After change.\n *\n * Triggered when a change occured.\n *\n * @method _afterChange\n * @protected\n */\n RuleConfig.prototype._afterChange = function() {\n if (!this._isValid()) {\n this._find('[data-action=\"save\"]').prop('disabled', true);\n } else {\n this._find('[data-action=\"save\"]').prop('disabled', false);\n }\n };\n\n /**\n * After change in rule's config.\n *\n * Triggered when a change occured in a specific rule config.\n *\n * @method _afterRuleConfigChange\n * @protected\n * @param {Event} e\n * @param {Rule} rule\n */\n RuleConfig.prototype._afterRuleConfigChange = function(e, rule) {\n if (rule != this._getRule()) {\n // This rule is not the current one any more, we can ignore.\n return;\n }\n this._afterChange();\n };\n\n /**\n * After render hook.\n *\n * @method _afterRender\n * @protected\n */\n RuleConfig.prototype._afterRender = function() {\n var self = this;\n\n self._find('[name=\"outcome\"]').on('change', function() {\n self._switchedOutcome();\n }).trigger('change');\n\n self._find('[name=\"rule\"]').on('change', function() {\n self._switchedRule();\n }).trigger('change');\n\n self._find('[data-action=\"save\"]').on('click', function() {\n self._trigger('save', self._getConfig());\n self.close();\n });\n\n self._find('[data-action=\"cancel\"]').on('click', function() {\n self.close();\n });\n };\n\n /**\n * Whether the current competency can be configured.\n *\n * @return {Boolean}\n * @method canBeConfigured\n */\n RuleConfig.prototype.canBeConfigured = function() {\n var can = false;\n $.each(this._rules, function(index, rule) {\n if (rule.canConfig()) {\n can = true;\n return;\n }\n });\n return can;\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n RuleConfig.prototype.close = function() {\n this._popup.close();\n this._popup = null;\n };\n\n /**\n * Opens the picker.\n *\n * @method display\n * @returns {Promise}\n */\n RuleConfig.prototype.display = function() {\n var self = this;\n if (!self._competency) {\n return false;\n }\n return $.when(Str.get_string('competencyrule', 'tool_lp'), self._render())\n .then(function(title, render) {\n self._popup = new Dialogue(\n title,\n render[0],\n self._afterRender.bind(self),\n null,\n false,\n '515px'\n );\n return;\n }).fail(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @return {JQuery}\n * @method _find\n * @protected\n */\n RuleConfig.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Get the applicable outcome options.\n *\n * @return {Array}\n * @method _getApplicableOutcomesOptions\n * @protected\n */\n RuleConfig.prototype._getApplicableOutcomesOptions = function() {\n var self = this,\n options = [];\n\n $.each(self._outcomesOption, function(index, outcome) {\n options.push({\n code: outcome.code,\n name: outcome.name,\n selected: (outcome.code == self._competency.ruleoutcome) ? true : false,\n });\n });\n\n return options;\n };\n\n /**\n * Get the applicable rules options.\n *\n * @return {Array}\n * @method _getApplicableRulesOptions\n * @protected\n */\n RuleConfig.prototype._getApplicableRulesOptions = function() {\n var self = this,\n options = [];\n\n $.each(self._rules, function(index, rule) {\n if (!rule.canConfig()) {\n return;\n }\n options.push({\n name: self._getRuleName(rule.getType()),\n type: rule.getType(),\n selected: (rule.getType() == self._competency.ruletype) ? true : false,\n });\n });\n\n return options;\n };\n\n /**\n * Get the full config for the competency.\n *\n * @return {Object} Contains rule, ruleoutcome and ruleconfig.\n * @method _getConfig\n * @protected\n */\n RuleConfig.prototype._getConfig = function() {\n var rule = this._getRule();\n return {\n ruletype: rule ? rule.getType() : null,\n ruleconfig: rule ? rule.getConfig() : null,\n ruleoutcome: this._getOutcome()\n };\n };\n\n /**\n * Get the selected outcome code.\n *\n * @return {String}\n * @method _getOutcome\n * @protected\n */\n RuleConfig.prototype._getOutcome = function() {\n return this._find('[name=\"outcome\"]').val();\n };\n\n /**\n * Get the selected rule.\n *\n * @return {null|Rule}\n * @method _getRule\n * @protected\n */\n RuleConfig.prototype._getRule = function() {\n var result,\n type = this._find('[name=\"rule\"]').val();\n\n $.each(this._rules, function(index, rule) {\n if (rule.getType() == type) {\n result = rule;\n return;\n }\n });\n\n return result;\n };\n\n /**\n * Return the name of a rule.\n *\n * @param {String} type The type of a rule.\n * @return {String}\n * @method _getRuleName\n * @protected\n */\n RuleConfig.prototype._getRuleName = function(type) {\n var self = this,\n name;\n $.each(self._rulesModules, function(index, modInfo) {\n if (modInfo.type == type) {\n name = modInfo.name;\n return;\n }\n });\n return name;\n };\n\n /**\n * Initialise the outcomes.\n *\n * @return {Promise}\n * @method _initOutcomes\n * @protected\n */\n RuleConfig.prototype._initOutcomes = function() {\n var self = this;\n return Outcomes.getAll().then(function(outcomes) {\n self._outcomesOption = outcomes;\n return;\n });\n };\n\n /**\n * Initialise the rules.\n *\n * @return {Promise}\n * @method _initRules\n * @protected\n */\n RuleConfig.prototype._initRules = function() {\n var self = this,\n promises = [];\n $.each(self._rules, function(index, rule) {\n var promise = rule.init().then(function() {\n rule.setTargetCompetency(self._competency);\n rule.on('change', self._afterRuleConfigChange.bind(self));\n return;\n }, function() {\n // Upon failure remove the rule, and resolve the promise.\n self._rules.splice(index, 1);\n return $.when();\n });\n promises.push(promise);\n });\n\n return $.when.apply($.when, promises);\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method _isValid\n * @protected\n */\n RuleConfig.prototype._isValid = function() {\n var outcome = this._getOutcome(),\n rule = this._getRule();\n\n if (outcome == Outcomes.NONE) {\n return true;\n } else if (!rule) {\n return false;\n }\n\n return rule.isValid();\n };\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n RuleConfig.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Hook to executed before render.\n *\n * @method _preRender\n * @protected\n * @return {Promise}\n */\n RuleConfig.prototype._preRender = function() {\n // We need to have all the information about the rule plugins first.\n return this.ready();\n };\n\n /**\n * Returns a promise that is resolved when the module is ready.\n *\n * @return {Promise}\n * @method ready\n * @protected\n */\n RuleConfig.prototype.ready = function() {\n return this._ready.promise();\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @protected\n * @return {Promise}\n */\n RuleConfig.prototype._render = function() {\n var self = this;\n return this._preRender().then(function() {\n var config;\n\n if (!self.canBeConfigured()) {\n config = false;\n } else {\n config = {};\n config.outcomes = self._getApplicableOutcomesOptions();\n config.rules = self._getApplicableRulesOptions();\n }\n\n var context = {\n competencyshortname: self._competency.shortname,\n config: config\n };\n\n return Templates.render('tool_lp/competency_rule_config', context);\n });\n };\n\n /**\n * Set the target competency.\n *\n * @param {Number} competencyId The target competency Id.\n * @method setTargetCompetencyId\n */\n RuleConfig.prototype.setTargetCompetencyId = function(competencyId) {\n var self = this;\n self._competency = self._tree.getCompetency(competencyId);\n $.each(self._rules, function(index, rule) {\n rule.setTargetCompetency(self._competency);\n });\n };\n\n /**\n * Set up the instance.\n *\n * @method _setUp\n * @protected\n */\n RuleConfig.prototype._setUp = function() {\n var self = this,\n promises = [],\n modules = [];\n\n self._ready = $.Deferred();\n self._rules = [];\n\n $.each(self._rulesModules, function(index, rule) {\n modules.push(rule.amd);\n });\n\n // Load all the modules.\n require(modules, function() {\n $.each(arguments, function(index, Module) {\n // Instantiate the rule and listen to it.\n var rule = new Module(self._tree);\n self._rules.push(rule);\n });\n\n // Load all the option values.\n promises.push(self._initRules());\n promises.push(self._initOutcomes());\n\n // Ready when everything is done.\n $.when.apply($.when, promises).always(function() {\n self._ready.resolve();\n });\n });\n };\n\n /**\n * Called when the user switches outcome.\n *\n * @method _switchedOutcome\n * @protected\n */\n RuleConfig.prototype._switchedOutcome = function() {\n var self = this,\n type = self._getOutcome();\n\n if (type == Outcomes.NONE) {\n // Reset to defaults.\n self._find('[data-region=\"rule-type\"]').hide()\n .find('[name=\"rule\"]').val(-1);\n self._find('[data-region=\"rule-config\"]').empty().hide();\n self._afterChange();\n return;\n }\n\n self._find('[data-region=\"rule-type\"]').show();\n self._find('[data-region=\"rule-config\"]').show();\n self._afterChange();\n };\n\n /**\n * Called when the user switches rule.\n *\n * @method _switchedRule\n * @protected\n */\n RuleConfig.prototype._switchedRule = function() {\n var self = this,\n container = self._find('[data-region=\"rule-config\"]'),\n rule = self._getRule();\n\n if (!rule) {\n container.empty().hide();\n self._afterChange();\n return;\n }\n rule.injectTemplate(container).then(function() {\n container.show();\n return;\n }).always(function() {\n self._afterChange();\n }).catch(function() {\n container.empty().hide();\n });\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _trigger\n * @protected\n */\n RuleConfig.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n return /** @alias module:tool_lp/competencyruleconfig */ RuleConfig;\n\n});\n"],"names":["define","$","Notification","Templates","Dialogue","Outcomes","Str","RuleConfig","tree","rulesModules","_eventNode","_tree","_rulesModules","_setUp","prototype","_competency","_outcomesOption","_popup","_ready","_rules","_afterChange","this","_isValid","_find","prop","_afterRuleConfigChange","e","rule","_getRule","_afterRender","self","on","_switchedOutcome","trigger","_switchedRule","_trigger","_getConfig","close","canBeConfigured","can","each","index","canConfig","display","when","get_string","_render","then","title","render","bind","fail","exception","selector","getContent","find","_getApplicableOutcomesOptions","options","outcome","push","code","name","selected","ruleoutcome","_getApplicableRulesOptions","_getRuleName","getType","type","ruletype","ruleconfig","getConfig","_getOutcome","val","result","modInfo","_initOutcomes","getAll","outcomes","_initRules","promises","promise","init","setTargetCompetency","splice","apply","NONE","isValid","handler","_preRender","ready","config","rules","context","competencyshortname","shortname","setTargetCompetencyId","competencyId","getCompetency","modules","Deferred","amd","require","arguments","Module","always","resolve","hide","empty","show","container","injectTemplate","catch","data"],"mappings":";;;;;;;AAuBAA,sCAAO,CAAC,SACA,oBACA,iBACA,mBACA,8BACA,aACA,SAASC,EAAGC,aAAcC,UAAWC,SAAUC,SAAUC,SAczDC,WAAa,SAASC,KAAMC,mBACvBC,WAAaT,EAAE,oBACfU,MAAQH,UACRI,cAAgBH,kBAChBI,iBAITN,WAAWO,UAAUC,YAAc,KAEnCR,WAAWO,UAAUJ,WAAa,KAElCH,WAAWO,UAAUE,gBAAkB,KAEvCT,WAAWO,UAAUG,OAAS,KAE9BV,WAAWO,UAAUI,OAAS,KAE9BX,WAAWO,UAAUK,OAAS,KAE9BZ,WAAWO,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AAQH,SAAS,WACbjG,EAAEuC,KAAK8D,WAAW,SAAS7D,MAAO8D,YAE1B5E,KAAO,IAAI4E,OAAOzE,KAAKnB,OAC3BmB,KAAKX,OAAOwC,KAAKhC,SAIrBoD,SAASpB,KAAK7B,KAAKgD,cACnBC,SAASpB,KAAK7B,KAAK6C,iBAGnB1E,EAAE2C,KAAKwC,MAAMnF,EAAE2C,KAAMmC,UAAUyB,QAAO,WAClC1E,KAAKZ,OAAOuF,iBAWxBlG,WAAWO,UAAUkB,iBAAmB,cACzBX,KACKkD,eAEJlE,SAASgF,YAHVhE,KAKFE,MAAM,6BAA6BmF,OACnCnD,KAAK,iBAAiBiB,KAAK,GANzBnD,KAOFE,MAAM,+BAA+BoF,QAAQD,YAP3CrF,KAQFD,eAREC,KAYNE,MAAM,6BAA6BqF,OAZ7BvF,KAaNE,MAAM,+BAA+BqF,OAb/BvF,KAcND,gBASTb,WAAWO,UAAUoB,cAAgB,eAC7BJ,KAAOT,KACPwF,UAAY/E,KAAKP,MAAM,+BACvBI,KAAOG,KAAKF,eAEXD,YACDkF,UAAUF,QAAQD,YAClB5E,KAAKV,eAGTO,KAAKmF,eAAeD,WAAW9D,MAAK,WAChC8D,UAAUD,UAEXJ,QAAO,WACN1E,KAAKV,kBACN2F,OAAM,WACLF,UAAUF,QAAQD,WAY1BnG,WAAWO,UAAUqB,SAAW,SAASgC,KAAM6C,WACtCtG,WAAWuB,QAAQkC,KAAM,CAAC6C,QAGsBzG"}
\ No newline at end of file
diff --git a/admin/tool/lp/amd/build/dialogue.min.js b/admin/tool/lp/amd/build/dialogue.min.js
index 21d72a304b2..877b87ab07b 100644
--- a/admin/tool/lp/amd/build/dialogue.min.js
+++ b/admin/tool/lp/amd/build/dialogue.min.js
@@ -6,6 +6,6 @@
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-define("tool_lp/dialogue",["core/yui"],(function(Y){var dialogue=function(title,content,afterShow,afterHide,wide){M.util.js_pending("tool_lp/dialogue:dialogue"),this.yuiDialogue=null;var parent=this;void 0===wide&&(wide=!1),Y.use("moodle-core-notification","timers",(function(){var width="480px";wide&&(width="800px"),parent.yuiDialogue=new M.core.dialogue({headerContent:title,bodyContent:content,draggable:!0,visible:!1,center:!0,modal:!0,width:width}),parent.yuiDialogue.before("visibleChange",(function(){M.util.js_pending("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.after("visibleChange",(function(e){e.newVal?void 0!==afterShow?Y.soon((function(){afterShow(parent),parent.yuiDialogue.centerDialogue(),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange"):void 0!==afterHide?Y.soon((function(){afterHide(parent),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.show(),M.util.js_complete("tool_lp/dialogue:dialogue")}))};return dialogue.prototype.close=function(){this.yuiDialogue.hide(),this.yuiDialogue.destroy()},dialogue.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()},dialogue}));
+define("tool_lp/dialogue",["core/yui"],(function(Y){var dialogue=function(title,content,afterShow,afterHide,wide,height){M.util.js_pending("tool_lp/dialogue:dialogue"),this.yuiDialogue=null;var parent=this;void 0===wide&&(wide=!1),Y.use("moodle-core-notification","timers",(function(){var width="480px";wide&&(width="800px"),height||(height="auto"),parent.yuiDialogue=new M.core.dialogue({headerContent:title,bodyContent:content,draggable:!0,visible:!1,center:!0,modal:!0,width:width,height:height}),parent.yuiDialogue.before("visibleChange",(function(){M.util.js_pending("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.after("visibleChange",(function(e){e.newVal?void 0!==afterShow?Y.soon((function(){afterShow(parent),parent.yuiDialogue.centerDialogue(),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange"):void 0!==afterHide?Y.soon((function(){afterHide(parent),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.show(),M.util.js_complete("tool_lp/dialogue:dialogue")}))};return dialogue.prototype.close=function(){this.yuiDialogue.hide(),this.yuiDialogue.destroy()},dialogue.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()},dialogue}));
//# sourceMappingURL=dialogue.min.js.map
\ No newline at end of file
diff --git a/admin/tool/lp/amd/build/dialogue.min.js.map b/admin/tool/lp/amd/build/dialogue.min.js.map
index 97577b8780a..67352fce7b2 100644
--- a/admin/tool/lp/amd/build/dialogue.min.js.map
+++ b/admin/tool/lp/amd/build/dialogue.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"dialogue.min.js","sources":["../src/dialogue.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Wrapper for the YUI M.core.notification class. Allows us to\n * use the YUI version in AMD code until it is replaced.\n *\n * @module tool_lp/dialogue\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/yui'], function(Y) {\n\n // Private variables and functions.\n /**\n * Constructor\n *\n * @param {String} title Title for the window.\n * @param {String} content The content for the window.\n * @param {function} afterShow Callback executed after the window is opened.\n * @param {function} afterHide Callback executed after the window is closed.\n * @param {Boolean} wide Specify we want an extra wide dialogue (the size is standard, but wider than the default).\n */\n var dialogue = function(title, content, afterShow, afterHide, wide) {\n M.util.js_pending('tool_lp/dialogue:dialogue');\n\n this.yuiDialogue = null;\n var parent = this;\n\n // Default for wide is false.\n if (typeof wide == 'undefined') {\n wide = false;\n }\n\n Y.use('moodle-core-notification', 'timers', function() {\n var width = '480px';\n if (wide) {\n width = '800px';\n }\n\n parent.yuiDialogue = new M.core.dialogue({\n headerContent: title,\n bodyContent: content,\n draggable: true,\n visible: false,\n center: true,\n modal: true,\n width: width\n });\n\n parent.yuiDialogue.before('visibleChange', function() {\n M.util.js_pending('tool_lp/dialogue:before:visibleChange');\n });\n\n parent.yuiDialogue.after('visibleChange', function(e) {\n if (e.newVal) {\n // Delay the callback call to the next tick, otherwise it can happen that it is\n // executed before the dialogue constructor returns.\n if ((typeof afterShow !== 'undefined')) {\n Y.soon(function() {\n afterShow(parent);\n parent.yuiDialogue.centerDialogue();\n M.util.js_complete('tool_lp/dialogue:before:visibleChange');\n });\n } else {\n M.util.js_complete('tool_lp/dialogue:before:visibleChange');\n }\n } else {\n if ((typeof afterHide !== 'undefined')) {\n Y.soon(function() {\n afterHide(parent);\n M.util.js_complete('tool_lp/dialogue:before:visibleChange');\n });\n } else {\n M.util.js_complete('tool_lp/dialogue:before:visibleChange');\n }\n }\n });\n\n parent.yuiDialogue.show();\n M.util.js_complete('tool_lp/dialogue:dialogue');\n });\n };\n\n /**\n * Close this window.\n */\n dialogue.prototype.close = function() {\n this.yuiDialogue.hide();\n this.yuiDialogue.destroy();\n };\n\n /**\n * Get content.\n * @return {node}\n */\n dialogue.prototype.getContent = function() {\n return this.yuiDialogue.bodyNode.getDOMNode();\n };\n\n return /** @alias module:tool_lp/dialogue */ dialogue;\n});\n"],"names":["define","Y","dialogue","title","content","afterShow","afterHide","wide","M","util","js_pending","yuiDialogue","parent","this","use","width","core","headerContent","bodyContent","draggable","visible","center","modal","before","after","e","newVal","soon","centerDialogue","js_complete","show","prototype","close","hide","destroy","getContent","bodyNode","getDOMNode"],"mappings":";;;;;;;;AAuBAA,0BAAO,CAAC,aAAa,SAASC,OAYtBC,SAAW,SAASC,MAAOC,QAASC,UAAWC,UAAWC,MAC1DC,EAAEC,KAAKC,WAAW,kCAEbC,YAAc,SACfC,OAASC,UAGM,IAARN,OACPA,MAAO,GAGXN,EAAEa,IAAI,2BAA4B,UAAU,eACpCC,MAAQ,QACRR,OACAQ,MAAQ,SAGZH,OAAOD,YAAc,IAAIH,EAAEQ,KAAKd,SAAS,CACrCe,cAAed,MACfe,YAAad,QACbe,WAAW,EACXC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACPP,MAAOA,QAGXH,OAAOD,YAAYY,OAAO,iBAAiB,WACvCf,EAAEC,KAAKC,WAAW,4CAGtBE,OAAOD,YAAYa,MAAM,iBAAiB,SAASC,GAC3CA,EAAEC,YAGwB,IAAdrB,UACRJ,EAAE0B,MAAK,WACHtB,UAAUO,QACVA,OAAOD,YAAYiB,iBACnBpB,EAAEC,KAAKoB,YAAY,4CAGvBrB,EAAEC,KAAKoB,YAAY,8CAGG,IAAdvB,UACRL,EAAE0B,MAAK,WACHrB,UAAUM,QACVJ,EAAEC,KAAKoB,YAAY,4CAGvBrB,EAAEC,KAAKoB,YAAY,4CAK/BjB,OAAOD,YAAYmB,OACnBtB,EAAEC,KAAKoB,YAAY,wCAO3B3B,SAAS6B,UAAUC,MAAQ,gBAClBrB,YAAYsB,YACZtB,YAAYuB,WAOrBhC,SAAS6B,UAAUI,WAAa,kBACrBtB,KAAKF,YAAYyB,SAASC,cAGQnC"}
\ No newline at end of file
+{"version":3,"file":"dialogue.min.js","sources":["../src/dialogue.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Wrapper for the YUI M.core.notification class. Allows us to\n * use the YUI version in AMD code until it is replaced.\n *\n * @module tool_lp/dialogue\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/yui'], function(Y) {\n\n // Private variables and functions.\n /**\n * Constructor\n *\n * @param {String} title Title for the window.\n * @param {String} content The content for the window.\n * @param {function} afterShow Callback executed after the window is opened.\n * @param {function} afterHide Callback executed after the window is closed.\n * @param {Boolean} wide Specify we want an extra wide dialogue (the size is standard, but wider than the default).\n * @param {String} height The height of the dialogue.\n */\n var dialogue = function(title, content, afterShow, afterHide, wide, height) {\n M.util.js_pending('tool_lp/dialogue:dialogue');\n\n this.yuiDialogue = null;\n var parent = this;\n\n // Default for wide is false.\n if (typeof wide == 'undefined') {\n wide = false;\n }\n\n Y.use('moodle-core-notification', 'timers', function() {\n var width = '480px';\n if (wide) {\n width = '800px';\n }\n\n if (!height) {\n height = 'auto';\n }\n\n parent.yuiDialogue = new M.core.dialogue({\n headerContent: title,\n bodyContent: content,\n draggable: true,\n visible: false,\n center: true,\n modal: true,\n width: width,\n height: height\n });\n\n parent.yuiDialogue.before('visibleChange', function() {\n M.util.js_pending('tool_lp/dialogue:before:visibleChange');\n });\n\n parent.yuiDialogue.after('visibleChange', function(e) {\n if (e.newVal) {\n // Delay the callback call to the next tick, otherwise it can happen that it is\n // executed before the dialogue constructor returns.\n if ((typeof afterShow !== 'undefined')) {\n Y.soon(function() {\n afterShow(parent);\n parent.yuiDialogue.centerDialogue();\n M.util.js_complete('tool_lp/dialogue:before:visibleChange');\n });\n } else {\n M.util.js_complete('tool_lp/dialogue:before:visibleChange');\n }\n } else {\n if ((typeof afterHide !== 'undefined')) {\n Y.soon(function() {\n afterHide(parent);\n M.util.js_complete('tool_lp/dialogue:before:visibleChange');\n });\n } else {\n M.util.js_complete('tool_lp/dialogue:before:visibleChange');\n }\n }\n });\n\n parent.yuiDialogue.show();\n M.util.js_complete('tool_lp/dialogue:dialogue');\n });\n };\n\n /**\n * Close this window.\n */\n dialogue.prototype.close = function() {\n this.yuiDialogue.hide();\n this.yuiDialogue.destroy();\n };\n\n /**\n * Get content.\n * @return {node}\n */\n dialogue.prototype.getContent = function() {\n return this.yuiDialogue.bodyNode.getDOMNode();\n };\n\n return /** @alias module:tool_lp/dialogue */ dialogue;\n});\n"],"names":["define","Y","dialogue","title","content","afterShow","afterHide","wide","height","M","util","js_pending","yuiDialogue","parent","this","use","width","core","headerContent","bodyContent","draggable","visible","center","modal","before","after","e","newVal","soon","centerDialogue","js_complete","show","prototype","close","hide","destroy","getContent","bodyNode","getDOMNode"],"mappings":";;;;;;;;AAuBAA,0BAAO,CAAC,aAAa,SAASC,OAatBC,SAAW,SAASC,MAAOC,QAASC,UAAWC,UAAWC,KAAMC,QAChEC,EAAEC,KAAKC,WAAW,kCAEbC,YAAc,SACfC,OAASC,UAGM,IAARP,OACPA,MAAO,GAGXN,EAAEc,IAAI,2BAA4B,UAAU,eACpCC,MAAQ,QACRT,OACAS,MAAQ,SAGPR,SACDA,OAAS,QAGbK,OAAOD,YAAc,IAAIH,EAAEQ,KAAKf,SAAS,CACrCgB,cAAef,MACfgB,YAAaf,QACbgB,WAAW,EACXC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACPP,MAAOA,MACPR,OAAQA,SAGZK,OAAOD,YAAYY,OAAO,iBAAiB,WACvCf,EAAEC,KAAKC,WAAW,4CAGtBE,OAAOD,YAAYa,MAAM,iBAAiB,SAASC,GAC3CA,EAAEC,YAGwB,IAAdtB,UACRJ,EAAE2B,MAAK,WACHvB,UAAUQ,QACVA,OAAOD,YAAYiB,iBACnBpB,EAAEC,KAAKoB,YAAY,4CAGvBrB,EAAEC,KAAKoB,YAAY,8CAGG,IAAdxB,UACRL,EAAE2B,MAAK,WACHtB,UAAUO,QACVJ,EAAEC,KAAKoB,YAAY,4CAGvBrB,EAAEC,KAAKoB,YAAY,4CAK/BjB,OAAOD,YAAYmB,OACnBtB,EAAEC,KAAKoB,YAAY,wCAO3B5B,SAAS8B,UAAUC,MAAQ,gBAClBrB,YAAYsB,YACZtB,YAAYuB,WAOrBjC,SAAS8B,UAAUI,WAAa,kBACrBtB,KAAKF,YAAYyB,SAASC,cAGQpC"}
\ No newline at end of file
diff --git a/admin/tool/lp/amd/src/competencyruleconfig.js b/admin/tool/lp/amd/src/competencyruleconfig.js
index fac99a8d0ec..34b525655ea 100644
--- a/admin/tool/lp/amd/src/competencyruleconfig.js
+++ b/admin/tool/lp/amd/src/competencyruleconfig.js
@@ -169,7 +169,10 @@ define(['jquery',
self._popup = new Dialogue(
title,
render[0],
- self._afterRender.bind(self)
+ self._afterRender.bind(self),
+ null,
+ false,
+ '515px'
);
return;
}).fail(Notification.exception);
diff --git a/admin/tool/lp/amd/src/dialogue.js b/admin/tool/lp/amd/src/dialogue.js
index 1b5db04685c..9371701a5dd 100644
--- a/admin/tool/lp/amd/src/dialogue.js
+++ b/admin/tool/lp/amd/src/dialogue.js
@@ -32,8 +32,9 @@ define(['core/yui'], function(Y) {
* @param {function} afterShow Callback executed after the window is opened.
* @param {function} afterHide Callback executed after the window is closed.
* @param {Boolean} wide Specify we want an extra wide dialogue (the size is standard, but wider than the default).
+ * @param {String} height The height of the dialogue.
*/
- var dialogue = function(title, content, afterShow, afterHide, wide) {
+ var dialogue = function(title, content, afterShow, afterHide, wide, height) {
M.util.js_pending('tool_lp/dialogue:dialogue');
this.yuiDialogue = null;
@@ -50,6 +51,10 @@ define(['core/yui'], function(Y) {
width = '800px';
}
+ if (!height) {
+ height = 'auto';
+ }
+
parent.yuiDialogue = new M.core.dialogue({
headerContent: title,
bodyContent: content,
@@ -57,7 +62,8 @@ define(['core/yui'], function(Y) {
visible: false,
center: true,
modal: true,
- width: width
+ width: width,
+ height: height
});
parent.yuiDialogue.before('visibleChange', function() {
diff --git a/admin/tool/lp/styles.css b/admin/tool/lp/styles.css
index 6e1bb1eea69..bfc7d6d1c88 100644
--- a/admin/tool/lp/styles.css
+++ b/admin/tool/lp/styles.css
@@ -130,6 +130,8 @@
.path-admin-tool-lp .competency-rule-points {
margin-top: 10px;
+ max-height: 300px;
+ overflow-y: auto;
}
.path-admin-tool-lp .competency-rule-points table input {