first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
/**
* Module to enable inline editing of a comptency grade.
*
* @module report_competency/grading_popup
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("report_competency/grading_popup",["jquery","core/notification","core/str","core/ajax","core/log","core/templates","tool_lp/dialogue"],(function($,notification,str,ajax,log,templates,Dialogue){var GradingPopup=function(regionSelector,userCompetencySelector){this._regionSelector=regionSelector,this._userCompetencySelector=userCompetencySelector,$(this._regionSelector).on("click",this._userCompetencySelector,this._handleClick.bind(this))};return GradingPopup.prototype._handleClick=function(e){var cell=$(e.target).closest(this._userCompetencySelector),competencyId=$(cell).data("competencyid"),courseId=$(cell).data("courseid"),userId=$(cell).data("userid");log.debug("Clicked on cell: competencyId="+competencyId+", courseId="+courseId+", userId="+userId);var requests=ajax.call([{methodname:"tool_lp_data_for_user_competency_summary_in_course",args:{userid:userId,competencyid:competencyId,courseid:courseId}},{methodname:"core_competency_user_competency_viewed_in_course",args:{userid:userId,competencyid:competencyId,courseid:courseId}}]);$.when(requests[0],requests[1]).then(this._contextLoaded.bind(this)).catch(notification.exception)},GradingPopup.prototype._contextLoaded=function(context){return context.displayuser=!0,M.util.js_pending("report_competency/grading_popup:_contextLoaded"),$.when(str.get_string("usercompetencysummary","report_competency"),templates.render("tool_lp/user_competency_summary_in_course",context)).then(function(title,templateData){return new Dialogue(title,templateData[0],(function(){templates.runTemplateJS(templateData[1]),M.util.js_complete("report_competency/grading_popup:_contextLoaded")}),this._refresh.bind(this),!0)}.bind(this))},GradingPopup.prototype._refresh=function(){var region=$(this._regionSelector),courseId=region.data("courseid"),moduleId=region.data("moduleid"),userId=region.data("userid");return""===moduleId&&(moduleId=0),ajax.call([{methodname:"report_competency_data_for_report",args:{courseid:courseId,userid:userId,moduleid:moduleId},done:this._pageContextLoaded.bind(this),fail:notification.exception}])},GradingPopup.prototype._pageContextLoaded=function(context){templates.render("report_competency/report",context).then(function(html,js){templates.replaceNode(this._regionSelector,html,js)}.bind(this)).catch(notification.exception)},GradingPopup.prototype._regionSelector=null,GradingPopup.prototype._userCompetencySelector=null,GradingPopup}));
//# sourceMappingURL=grading_popup.min.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
/**
* Module to navigation between users in a course.
*
* @module report_competency/user_course_navigation
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("report_competency/user_course_navigation",["jquery"],(function($){var UserCourseNavigation=function(userSelector,moduleSelector,baseUrl,userId,courseId,moduleId){this._baseUrl=baseUrl,this._userId=userId+"",this._courseId=courseId,this._moduleId=moduleId,$(userSelector).on("change",this._userChanged.bind(this)),$(moduleSelector).on("change",this._moduleChanged.bind(this))};return UserCourseNavigation.prototype._userChanged=function(e){M.util.js_pending("report_competency/user_course_navigation:_userChanged");var queryStr="?user="+$(e.target).val()+"&id="+this._courseId+"&mod="+this._moduleId;document.location=this._baseUrl+queryStr},UserCourseNavigation.prototype._moduleChanged=function(e){M.util.js_pending("report_competency/user_course_navigation:_moduleChanged");var queryStr="?mod="+$(e.target).val()+"&id="+this._courseId+"&user="+this._userId;document.location=this._baseUrl+queryStr},UserCourseNavigation.prototype._userId=null,UserCourseNavigation.prototype._moduleId=null,UserCourseNavigation.prototype._courseId=null,UserCourseNavigation.prototype._baseUrl=null,UserCourseNavigation}));
//# sourceMappingURL=user_course_navigation.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"user_course_navigation.min.js","sources":["../src/user_course_navigation.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 <http://www.gnu.org/licenses/>.\n\n/**\n * Module to navigation between users in a course.\n *\n * @module report_competency/user_course_navigation\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * UserCourseNavigation\n *\n * @class report_competency/user_course_navigation\n * @param {String} userSelector The selector of the user element.\n * @param {String} moduleSelector The selector of the module element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The course id\n * @param {Number} courseId The user id\n * @param {Number} moduleId The activity module (filter)\n */\n var UserCourseNavigation = function(userSelector, moduleSelector, baseUrl, userId, courseId, moduleId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._courseId = courseId;\n this._moduleId = moduleId;\n\n $(userSelector).on('change', this._userChanged.bind(this));\n $(moduleSelector).on('change', this._moduleChanged.bind(this));\n };\n\n /**\n * The user was changed in the select list.\n *\n * @method _userChanged\n * @param {Event} e the event\n */\n UserCourseNavigation.prototype._userChanged = function(e) {\n // Note: This change causes a page reload and is intentionally not paired with a js_complete call.\n M.util.js_pending('report_competency/user_course_navigation:_userChanged');\n var newUserId = $(e.target).val();\n var queryStr = '?user=' + newUserId + '&id=' + this._courseId + '&mod=' + this._moduleId;\n document.location = this._baseUrl + queryStr;\n };\n\n /**\n * The module was changed in the select list.\n *\n * @method _moduleChanged\n * @param {Event} e the event\n */\n UserCourseNavigation.prototype._moduleChanged = function(e) {\n // Note: This change causes a page reload and is intentionally not paired with a js_complete call.\n M.util.js_pending('report_competency/user_course_navigation:_moduleChanged');\n var newModuleId = $(e.target).val();\n var queryStr = '?mod=' + newModuleId + '&id=' + this._courseId + '&user=' + this._userId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the user. */\n UserCourseNavigation.prototype._userId = null;\n /** @property {Number} The id of the module. */\n UserCourseNavigation.prototype._moduleId = null;\n /** @property {Number} The id of the course. */\n UserCourseNavigation.prototype._courseId = null;\n /** @property {String} Plugin base url. */\n UserCourseNavigation.prototype._baseUrl = null;\n\n return UserCourseNavigation;\n});\n"],"names":["define","$","UserCourseNavigation","userSelector","moduleSelector","baseUrl","userId","courseId","moduleId","_baseUrl","_userId","_courseId","_moduleId","on","this","_userChanged","bind","_moduleChanged","prototype","e","M","util","js_pending","queryStr","target","val","document","location"],"mappings":";;;;;;;AAuBAA,kDAAO,CAAC,WAAW,SAASC,OAapBC,qBAAuB,SAASC,aAAcC,eAAgBC,QAASC,OAAQC,SAAUC,eACpFC,SAAWJ,aACXK,QAAUJ,OAAS,QACnBK,UAAYJ,cACZK,UAAYJ,SAEjBP,EAAEE,cAAcU,GAAG,SAAUC,KAAKC,aAAaC,KAAKF,OACpDb,EAAEG,gBAAgBS,GAAG,SAAUC,KAAKG,eAAeD,KAAKF,eAS5DZ,qBAAqBgB,UAAUH,aAAe,SAASI,GAEnDC,EAAEC,KAAKC,WAAW,6DAEdC,SAAW,SADCtB,EAAEkB,EAAEK,QAAQC,MACU,OAASX,KAAKH,UAAY,QAAUG,KAAKF,UAC/Ec,SAASC,SAAWb,KAAKL,SAAWc,UASxCrB,qBAAqBgB,UAAUD,eAAiB,SAASE,GAErDC,EAAEC,KAAKC,WAAW,+DAEdC,SAAW,QADGtB,EAAEkB,EAAEK,QAAQC,MACS,OAASX,KAAKH,UAAY,SAAWG,KAAKJ,QACjFgB,SAASC,SAAWb,KAAKL,SAAWc,UAIxCrB,qBAAqBgB,UAAUR,QAAU,KAEzCR,qBAAqBgB,UAAUN,UAAY,KAE3CV,qBAAqBgB,UAAUP,UAAY,KAE3CT,qBAAqBgB,UAAUT,SAAW,KAEnCP"}
+146
View File
@@ -0,0 +1,146 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Module to enable inline editing of a comptency grade.
*
* @module report_competency/grading_popup
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'core/templates', 'tool_lp/dialogue'],
function($, notification, str, ajax, log, templates, Dialogue) {
/**
* GradingPopup
*
* @class report_competency/grading_popup
* @param {String} regionSelector The regionSelector
* @param {String} userCompetencySelector The userCompetencySelector
*/
var GradingPopup = function(regionSelector, userCompetencySelector) {
this._regionSelector = regionSelector;
this._userCompetencySelector = userCompetencySelector;
$(this._regionSelector).on('click', this._userCompetencySelector, this._handleClick.bind(this));
};
/**
* Get the data from the clicked cell and open the popup.
*
* @method _handleClick
* @param {Event} e The event
*/
GradingPopup.prototype._handleClick = function(e) {
var cell = $(e.target).closest(this._userCompetencySelector);
var competencyId = $(cell).data('competencyid');
var courseId = $(cell).data('courseid');
var userId = $(cell).data('userid');
log.debug('Clicked on cell: competencyId=' + competencyId + ', courseId=' + courseId + ', userId=' + userId);
var requests = ajax.call([{
methodname: 'tool_lp_data_for_user_competency_summary_in_course',
args: {userid: userId, competencyid: competencyId, courseid: courseId},
}, {
methodname: 'core_competency_user_competency_viewed_in_course',
args: {userid: userId, competencyid: competencyId, courseid: courseId},
}]);
$.when(requests[0], requests[1])
.then(this._contextLoaded.bind(this))
.catch(notification.exception);
};
/**
* We loaded the context, now render the template.
*
* @method _contextLoaded
* @param {Object} context
* @returns {Promise}
*/
GradingPopup.prototype._contextLoaded = function(context) {
// We have to display user info in popup.
context.displayuser = true;
M.util.js_pending('report_competency/grading_popup:_contextLoaded');
return $.when(
str.get_string('usercompetencysummary', 'report_competency'),
templates.render('tool_lp/user_competency_summary_in_course', context)
)
.then(function(title, templateData) {
return new Dialogue(
title,
templateData[0],
function() {
templates.runTemplateJS(templateData[1]);
M.util.js_complete('report_competency/grading_popup:_contextLoaded');
},
this._refresh.bind(this),
true
);
}.bind(this));
};
/**
* Refresh the page.
*
* @method _refresh
* @returns {Promise}
*/
GradingPopup.prototype._refresh = function() {
var region = $(this._regionSelector);
var courseId = region.data('courseid');
var moduleId = region.data('moduleid');
var userId = region.data('userid');
// The module id is expected to be an integer, so don't pass empty string.
if (moduleId === '') {
moduleId = 0;
}
return ajax.call([{
methodname: 'report_competency_data_for_report',
args: {courseid: courseId, userid: userId, moduleid: moduleId},
done: this._pageContextLoaded.bind(this),
fail: notification.exception
}]);
};
/**
* We loaded the context, now render the template.
*
* @method _pageContextLoaded
* @param {Object} context
*/
GradingPopup.prototype._pageContextLoaded = function(context) {
templates.render('report_competency/report', context)
.then(function(html, js) {
templates.replaceNode(this._regionSelector, html, js);
return;
}.bind(this))
.catch(notification.exception);
};
/** @property {String} The selector for the region with the user competencies */
GradingPopup.prototype._regionSelector = null;
/** @property {String} The selector for the region with a single user competencies */
GradingPopup.prototype._userCompetencySelector = null;
return GradingPopup;
});
@@ -0,0 +1,85 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Module to navigation between users in a course.
*
* @module report_competency/user_course_navigation
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery'], function($) {
/**
* UserCourseNavigation
*
* @class report_competency/user_course_navigation
* @param {String} userSelector The selector of the user element.
* @param {String} moduleSelector The selector of the module element.
* @param {String} baseUrl The base url for the page (no params).
* @param {Number} userId The course id
* @param {Number} courseId The user id
* @param {Number} moduleId The activity module (filter)
*/
var UserCourseNavigation = function(userSelector, moduleSelector, baseUrl, userId, courseId, moduleId) {
this._baseUrl = baseUrl;
this._userId = userId + '';
this._courseId = courseId;
this._moduleId = moduleId;
$(userSelector).on('change', this._userChanged.bind(this));
$(moduleSelector).on('change', this._moduleChanged.bind(this));
};
/**
* The user was changed in the select list.
*
* @method _userChanged
* @param {Event} e the event
*/
UserCourseNavigation.prototype._userChanged = function(e) {
// Note: This change causes a page reload and is intentionally not paired with a js_complete call.
M.util.js_pending('report_competency/user_course_navigation:_userChanged');
var newUserId = $(e.target).val();
var queryStr = '?user=' + newUserId + '&id=' + this._courseId + '&mod=' + this._moduleId;
document.location = this._baseUrl + queryStr;
};
/**
* The module was changed in the select list.
*
* @method _moduleChanged
* @param {Event} e the event
*/
UserCourseNavigation.prototype._moduleChanged = function(e) {
// Note: This change causes a page reload and is intentionally not paired with a js_complete call.
M.util.js_pending('report_competency/user_course_navigation:_moduleChanged');
var newModuleId = $(e.target).val();
var queryStr = '?mod=' + newModuleId + '&id=' + this._courseId + '&user=' + this._userId;
document.location = this._baseUrl + queryStr;
};
/** @property {Number} The id of the user. */
UserCourseNavigation.prototype._userId = null;
/** @property {Number} The id of the module. */
UserCourseNavigation.prototype._moduleId = null;
/** @property {Number} The id of the course. */
UserCourseNavigation.prototype._courseId = null;
/** @property {String} Plugin base url. */
UserCourseNavigation.prototype._baseUrl = null;
return UserCourseNavigation;
});