Current Path : C:/xampp/htdocs/moodle/mod/assign/amd/build/ |
Current File : C:/xampp/htdocs/moodle/mod/assign/amd/build/participant_selector.min.js.map |
{"version":3,"sources":["../src/participant_selector.js"],"names":["define","ajax","$","templates","processResults","selector","data","transport","query","success","failure","assignmentid","attr","groupid","filters","filterstrings","each","index","element","prop","call","methodname","args","assignid","filter","limit","includeenrolments","tablesort","then","results","promises","identityfields","split","user","ctx","identity","show","filter_submitted","submitted","filter_notsubmitted","filter_requiregrading","requiregrading","filter_grantedextension","grantedextension","i","k","hasidentity","push","join","render","html","value","id","label","when","apply","users","arguments","Array","prototype","slice","catch"],"mappings":"AAsBAA,OAAM,mCAAC,CAAC,WAAD,CAAc,QAAd,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAeC,CAAf,CAAkBC,CAAlB,CAA6B,CAG3E,MAA6D,CAWzDC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAAyB,CACrC,MAAOA,CAAAA,CACV,CAbwD,CAwBzDC,SAAS,CAAE,mBAASF,CAAT,CAAmBG,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAAY,CAAGT,CAAC,CAACG,CAAD,CAAD,CAAYO,IAAZ,CAAiB,mBAAjB,CADgC,CAE/CC,CAAO,CAAGX,CAAC,CAACG,CAAD,CAAD,CAAYO,IAAZ,CAAiB,cAAjB,CAFqC,CAG/CE,CAAO,CAAGZ,CAAC,CAAC,8DAAD,CAHoC,CAI/Ca,CAAa,CAAG,EAJ+B,CAMnDD,CAAO,CAACE,IAAR,CAAa,SAASC,CAAT,CAAgBC,CAAhB,CAAyB,CAClCH,CAAa,CAACb,CAAC,CAACgB,CAAD,CAAD,CAAWN,IAAX,CAAgB,MAAhB,CAAD,CAAb,CAAyCV,CAAC,CAACgB,CAAD,CAAD,CAAWC,IAAX,CAAgB,SAAhB,CAC5C,CAFD,EAIAlB,CAAI,CAACmB,IAAL,CAAU,CAAC,CACPC,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D,CAAlB,CACH,CACJ,CALD,EAMAX,CAAG,CAACC,QAAJ,CAAeA,CAAQ,CAACa,IAAT,CAAc,IAAd,CAAf,CACAlB,CAAQ,CAACiB,IAAT,CAAc5C,CAAS,CAAC8C,MAAV,CAAiB,0CAAjB,CAA6Df,CAA7D,EAAkEN,IAAlE,CAAuE,SAASsB,CAAT,CAAe,CAChG,MAAO,CAACC,KAAK,CAAElB,CAAI,CAACmB,EAAb,CAAiBC,KAAK,CAAEH,CAAxB,CACV,CAFa,CAAd,CAGH,CACJ,CA7BD,EA+BA,MAAOhD,CAAAA,CAAC,CAACoD,IAAF,CAAOC,KAAP,CAAarD,CAAb,CAAgB4B,CAAhB,CACV,CA/CD,EA+CGF,IA/CH,CA+CQ,UAAW,CACf,GAAI4B,CAAAA,CAAK,CAAG,EAAZ,CAGA,GAAIC,SAAS,CAAC,CAAD,CAAb,CAAkB,CAEdD,CAAK,CAAGE,KAAK,CAACC,SAAN,CAAgBC,KAAhB,CAAsBxC,IAAtB,CAA2BqC,SAA3B,CACX,CAEDhD,CAAO,CAAC+C,CAAD,CAEV,CA1DD,EA0DGK,KA1DH,CA0DSnD,CA1DT,CA2DH,CA7FwD,CA+FhE,CAlGK,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 * Custom auto-complete adapter to load users from the assignment list_participants webservice.\n *\n * @module mod_assign/participants_selector\n * @copyright 2015 Damyon Wiese <damyon@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/ajax', 'jquery', 'core/templates'], function(ajax, $, templates) {\n\n\n return /** @alias module:mod_assign/participants_selector */ {\n\n // Public variables and functions.\n /**\n * Process the results returned from transport (convert to value + label)\n *\n * @method processResults\n * @param {String} selector\n * @param {Array} data\n * @return {Array}\n */\n processResults: function(selector, data) {\n return data;\n },\n\n /**\n * Fetch results based on the current query. This also renders each result from a template before returning them.\n *\n * @method transport\n * @param {String} selector Selector for the original select element\n * @param {String} query Current search string\n * @param {Function} success Success handler\n * @param {Function} failure Failure handler\n */\n transport: function(selector, query, success, failure) {\n var assignmentid = $(selector).attr('data-assignmentid');\n var groupid = $(selector).attr('data-groupid');\n var filters = $('[data-region=\"configure-filters\"] input[type=\"checkbox\"]');\n var filterstrings = [];\n\n filters.each(function(index, element) {\n filterstrings[$(element).attr('name')] = $(element).prop('checked');\n });\n\n ajax.call([{\n methodname: 'mod_assign_list_participants',\n args: {\n assignid: assignmentid,\n groupid: groupid,\n filter: query,\n limit: 30,\n includeenrolments: false,\n tablesort: true\n }\n }])[0].then(function(results) {\n var promises = [];\n var identityfields = $('[data-showuseridentity]').data('showuseridentity').split(',');\n\n // We got the results, now we loop over them and render each one from a template.\n $.each(results, function(index, user) {\n var ctx = user,\n identity = [],\n show = true;\n\n if (filterstrings.filter_submitted && !user.submitted) {\n show = false;\n }\n if (filterstrings.filter_notsubmitted && user.submitted) {\n show = false;\n }\n if (filterstrings.filter_requiregrading && !user.requiregrading) {\n show = false;\n }\n if (filterstrings.filter_grantedextension && !user.grantedextension) {\n show = false;\n }\n if (show) {\n $.each(identityfields, function(i, k) {\n if (typeof user[k] !== 'undefined' && user[k] !== '') {\n ctx.hasidentity = true;\n identity.push(user[k]);\n }\n });\n ctx.identity = identity.join(', ');\n promises.push(templates.render('mod_assign/list_participant_user_summary', ctx).then(function(html) {\n return {value: user.id, label: html};\n }));\n }\n });\n // Do the dance for $.when()\n return $.when.apply($, promises);\n }).then(function() {\n var users = [];\n\n // Determine if we've been passed any arguments..\n if (arguments[0]) {\n // Undo the $.when() dance from arguments object into an array..\n users = Array.prototype.slice.call(arguments);\n }\n\n success(users);\n return;\n }).catch(failure);\n }\n };\n});\n"],"file":"participant_selector.min.js"}