Current Path : C:/xampp/htdocs/moodle/report/competency/amd/build/ |
Current File : C:/xampp/htdocs/moodle/report/competency/amd/build/grading_popup.min.js.map |
{"version":3,"sources":["../src/grading_popup.js"],"names":["define","$","notification","str","ajax","log","templates","Dialogue","GradingPopup","regionSelector","userCompetencySelector","_regionSelector","_userCompetencySelector","on","_handleClick","bind","prototype","e","cell","target","closest","competencyId","data","courseId","userId","debug","requests","call","methodname","args","userid","competencyid","courseid","when","then","_contextLoaded","catch","exception","context","displayuser","M","util","js_pending","get_string","render","title","templateData","runTemplateJS","js_complete","_refresh","region","moduleId","moduleid","done","_pageContextLoaded","fail","html","js","replaceNode"],"mappings":"AAuBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,UAAhC,CAA4C,WAA5C,CAAyD,UAAzD,CAAqE,gBAArE,CAAuF,kBAAvF,CAAD,CACC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAAqCC,CAArC,CAA0CC,CAA1C,CAAqDC,CAArD,CAA+D,CAQlE,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAyBC,CAAzB,CAAiD,CAChE,KAAKC,eAAL,CAAuBF,CAAvB,CACA,KAAKG,uBAAL,CAA+BF,CAA/B,CAEAT,CAAC,CAAC,KAAKU,eAAN,CAAD,CAAwBE,EAAxB,CAA2B,OAA3B,CAAoC,KAAKD,uBAAzC,CAAkE,KAAKE,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB,CAAlE,CACH,CALD,CAaAP,CAAY,CAACQ,SAAb,CAAuBF,YAAvB,CAAsC,SAASG,CAAT,CAAY,IAC1CC,CAAAA,CAAI,CAAGjB,CAAC,CAACgB,CAAC,CAACE,MAAH,CAAD,CAAYC,OAAZ,CAAoB,KAAKR,uBAAzB,CADmC,CAE1CS,CAAY,CAAGpB,CAAC,CAACiB,CAAD,CAAD,CAAQI,IAAR,CAAa,cAAb,CAF2B,CAG1CC,CAAQ,CAAGtB,CA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A3B,CAA4C6C,CAA5C,CAAkDC,CAAlD,CAGH,CAJK,CAIJ1C,IAJI,CAIC,IAJD,CADN,EAMCqB,KAND,CAMOlC,CAAY,CAACmC,SANpB,CAOH,CARD,CAWA7B,CAAY,CAACQ,SAAb,CAAuBL,eAAvB,CAAyC,IAAzC,CAEAH,CAAY,CAACQ,SAAb,CAAuBJ,uBAAvB,CAAiD,IAAjD,CAEA,MAA4DJ,CAAAA,CAE/D,CA1HK,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 report_competency\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'core/templates', 'tool_lp/dialogue'],\n function($, notification, str, ajax, log, templates, Dialogue) {\n\n /**\n * GradingPopup\n *\n * @param {String} regionSelector The regionSelector\n * @param {String} userCompetencySelector The userCompetencySelector\n */\n var GradingPopup = function(regionSelector, userCompetencySelector) {\n this._regionSelector = regionSelector;\n this._userCompetencySelector = userCompetencySelector;\n\n $(this._regionSelector).on('click', this._userCompetencySelector, this._handleClick.bind(this));\n };\n\n /**\n * Get the data from the clicked cell and open the popup.\n *\n * @method _handleClick\n * @param {Event} e The event\n */\n GradingPopup.prototype._handleClick = function(e) {\n var cell = $(e.target).closest(this._userCompetencySelector);\n var competencyId = $(cell).data('competencyid');\n var courseId = $(cell).data('courseid');\n var userId = $(cell).data('userid');\n\n log.debug('Clicked on cell: competencyId=' + competencyId + ', courseId=' + courseId + ', userId=' + userId);\n\n var requests = ajax.call([{\n methodname: 'tool_lp_data_for_user_competency_summary_in_course',\n args: {userid: userId, competencyid: competencyId, courseid: courseId},\n }, {\n methodname: 'core_competency_user_competency_viewed_in_course',\n args: {userid: userId, competencyid: competencyId, courseid: courseId},\n }]);\n\n $.when(requests[0], requests[1])\n .then(this._contextLoaded.bind(this))\n .catch(notification.exception);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _contextLoaded\n * @param {Object} context\n * @returns {Promise}\n */\n GradingPopup.prototype._contextLoaded = function(context) {\n // We have to display user info in popup.\n context.displayuser = true;\n\n M.util.js_pending('report_competency/grading_popup:_contextLoaded');\n\n return $.when(\n str.get_string('usercompetencysummary', 'report_competency'),\n templates.render('tool_lp/user_competency_summary_in_course', context)\n )\n .then(function(title, templateData) {\n return new Dialogue(\n title,\n templateData[0],\n function() {\n templates.runTemplateJS(templateData[1]);\n M.util.js_complete('report_competency/grading_popup:_contextLoaded');\n },\n this._refresh.bind(this),\n true\n );\n }.bind(this));\n };\n\n /**\n * Refresh the page.\n *\n * @method _refresh\n * @returns {Promise}\n */\n GradingPopup.prototype._refresh = function() {\n var region = $(this._regionSelector);\n var courseId = region.data('courseid');\n var moduleId = region.data('moduleid');\n var userId = region.data('userid');\n\n // The module id is expected to be an integer, so don't pass empty string.\n if (moduleId === '') {\n moduleId = 0;\n }\n\n return ajax.call([{\n methodname: 'report_competency_data_for_report',\n args: {courseid: courseId, userid: userId, moduleid: moduleId},\n done: this._pageContextLoaded.bind(this),\n fail: notification.exception\n }]);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _pageContextLoaded\n * @param {Object} context\n */\n GradingPopup.prototype._pageContextLoaded = function(context) {\n templates.render('report_competency/report', context)\n .then(function(html, js) {\n templates.replaceNode(this._regionSelector, html, js);\n\n return;\n }.bind(this))\n .catch(notification.exception);\n };\n\n /** @type {String} The selector for the region with the user competencies */\n GradingPopup.prototype._regionSelector = null;\n /** @type {String} The selector for the region with a single user competencies */\n GradingPopup.prototype._userCompetencySelector = null;\n\n return /** @alias module:report_competency/grading_popup */ GradingPopup;\n\n});\n"],"file":"grading_popup.min.js"}