Current Path : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/ |
Current File : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/grade_user_competency_inline.min.js.map |
{"version":3,"sources":["../src/grade_user_competency_inline.js"],"names":["define","$","notification","ajax","log","GradeDialogue","EventBase","ScaleValues","InlineEditor","selector","scaleId","competencyId","userId","planId","courseId","chooseStr","prototype","constructor","apply","trigger","length","Error","_scaleId","_competencyId","_userId","_planId","_courseId","_chooseStr","_setUp","click","e","preventDefault","_dialogue","display","bind","_methodName","_args","competencyid","planid","courseid","userid","Object","create","options","self","M","util","js_pending","promise","get_values","then","scalevalues","push","value","name","i","optionConfig","id","dialogue","on","data","args","grade","rating","note","call","methodname","done","evidence","_trigger","fail","exception","js_complete"],"mappings":"AAuBAA,OAAM,wCAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,UAHD,CAIC,wBAJD,CAKC,oBALD,CAMC,qBAND,CAAD,CAOC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAAqCC,CAArC,CAAoDC,CAApD,CAA+DC,CAA/D,CAA4E,CAa/E,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAmBC,CAAnB,CAA4BC,CAA5B,CAA0CC,CAA1C,CAAkDC,CAAlD,CAA0DC,CAA1D,CAAoEC,CAApE,CAA+E,CAC9FT,CAAS,CAACU,SAAV,CAAoBC,WAApB,CAAgCC,KAAhC,CAAsC,IAAtC,CAA4C,EAA5C,EAEA,GAAIC,CAAAA,CAAO,CAAGlB,CAAC,CAACQ,CAAD,CAAf,CACA,GAAI,CAACU,CAAO,CAACC,MAAb,CAAqB,CACjB,KAAM,IAAIC,CAAAA,KAAJ,CAAU,4BAAV,CACT,CAED,KAAKC,QAAL,CAAgBZ,CAAhB,CACA,KAAKa,aAAL,CAAqBZ,CAArB,CACA,KAAKa,OAAL,CAAeZ,CAAf,CACA,KAAKa,OAAL,CAAeZ,CAAf,CACA,KAAKa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zCD,EA0CCF,IA1CD,CA0CMpE,CAAY,CAACqE,SA1CnB,CA2CH,CAjDD,CAoDA/D,CAAY,CAACQ,SAAb,CAAuBM,QAAvB,CAAkC,IAAlC,CAEAd,CAAY,CAACQ,SAAb,CAAuBO,aAAvB,CAAuC,IAAvC,CAEAf,CAAY,CAACQ,SAAb,CAAuBQ,OAAvB,CAAiC,IAAjC,CAEAhB,CAAY,CAACQ,SAAb,CAAuBS,OAAvB,CAAiC,IAAjC,CAEAjB,CAAY,CAACQ,SAAb,CAAuBU,SAAvB,CAAmC,IAAnC,CAEAlB,CAAY,CAACQ,SAAb,CAAuBW,UAAvB,CAAoC,IAApC,CAEAnB,CAAY,CAACQ,SAAb,CAAuBgB,SAAvB,CAAmC,IAAnC,CAEA,MAAiExB,CAAAA,CAEpE,CAzIK,CAAN","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 <http://www.gnu.org/licenses/>.\n\n/**\n * Module to enable inline editing of a comptency grade.\n *\n * @package tool_lp\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/log',\n 'tool_lp/grade_dialogue',\n 'tool_lp/event_base',\n 'tool_lp/scalevalues',\n ], function($, notification, ajax, log, GradeDialogue, EventBase, ScaleValues) {\n\n /**\n * InlineEditor\n *\n * @param {String} selector The selector to trigger the grading.\n * @param {Number} scaleId The id of the scale for this competency.\n * @param {Number} competencyId The id of the competency.\n * @param {Number} userId The id of the user.\n * @param {Number} planId The id of the plan.\n * @param {Number} courseId The id of the course.\n * @param {String} chooseStr Language string for choose a rating.\n */\n var InlineEditor = function(selector, scaleId, competencyId, userId, planId, courseId, chooseStr) {\n EventBase.prototype.constructor.apply(this, []);\n\n var trigger = $(selector);\n if (!trigger.length) {\n throw new Error('Could not find the trigger');\n }\n\n this._scaleId = scaleId;\n this._competencyId = competencyId;\n this._userId = userId;\n this._planId = planId;\n this._courseId = courseId;\n this._chooseStr = chooseStr;\n this._setUp();\n\n trigger.click(function(e) {\n e.preventDefault();\n this._dialogue.display();\n }.bind(this));\n\n if (this._planId) {\n this._methodName = 'core_competency_grade_competency_in_plan';\n this._args = {\n competencyid: this._competencyId,\n planid: this._planId\n };\n } else if (this._courseId) {\n this._methodName = 'core_competency_grade_competency_in_course';\n this._args = {\n competencyid: this._competencyId,\n courseid: this._courseId,\n userid: this._userId\n };\n } else {\n this._methodName = 'core_competency_grade_competency';\n this._args = {\n userid: this._userId,\n competencyid: this._competencyId\n };\n }\n };\n InlineEditor.prototype = Object.create(EventBase.prototype);\n\n /**\n * Setup.\n *\n * @method _setUp\n */\n InlineEditor.prototype._setUp = function() {\n var options = [],\n self = this;\n\n M.util.js_pending('tool_lp/grade_user_competency_inline:_setUp');\n var promise = ScaleValues.get_values(self._scaleId);\n promise.then(function(scalevalues) {\n options.push({\n value: '',\n name: self._chooseStr\n });\n\n for (var i = 0; i < scalevalues.length; i++) {\n var optionConfig = scalevalues[i];\n options.push({\n value: optionConfig.id,\n name: optionConfig.name\n });\n }\n\n return options;\n })\n .then(function(options) {\n return new GradeDialogue(options);\n })\n .then(function(dialogue) {\n dialogue.on('rated', function(e, data) {\n var args = self._args;\n args.grade = data.rating;\n args.note = data.note;\n ajax.call([{\n methodname: self._methodName,\n args: args,\n done: function(evidence) {\n self._trigger('competencyupdated', {args: args, evidence: evidence});\n },\n fail: notification.exception\n }]);\n });\n\n return dialogue;\n })\n .then(function(dialogue) {\n self._dialogue = dialogue;\n\n M.util.js_complete('tool_lp/grade_user_competency_inline:_setUp');\n return;\n })\n .fail(notification.exception);\n };\n\n /** @type {Number} The scale id for this competency. */\n InlineEditor.prototype._scaleId = null;\n /** @type {Number} The id of the competency. */\n InlineEditor.prototype._competencyId = null;\n /** @type {Number} The id of the user. */\n InlineEditor.prototype._userId = null;\n /** @type {Number} The id of the plan. */\n InlineEditor.prototype._planId = null;\n /** @type {Number} The id of the course. */\n InlineEditor.prototype._courseId = null;\n /** @type {String} The text for Choose rating. */\n InlineEditor.prototype._chooseStr = null;\n /** @type {GradeDialogue} The grading dialogue. */\n InlineEditor.prototype._dialogue = null;\n\n return /** @alias module:tool_lp/grade_user_competency_inline */ InlineEditor;\n\n});\n"],"file":"grade_user_competency_inline.min.js"}