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
@@ -0,0 +1,81 @@
YUI.add('moodle-question-chooser', function (Y, NAME) {
// 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/>.
/**
* JavaScript required by the question type chooser pop-up.
*
* @module moodle-question-chooser
*/
Y.log("The moodle-question-chooser module has been deprecated. " +
"Please use moodle-qbank_editquestion-chooser instead.", 'moodle-core-notification', 'warn');
var SELECTORS = {
CREATENEWQUESTION: 'div.createnewquestion',
CREATENEWQUESTIONFORM: 'div.createnewquestion form',
CHOOSERDIALOGUE: 'div.chooserdialoguebody',
CHOOSERHEADER: 'div.choosertitle'
};
function Chooser() {
Chooser.superclass.constructor.apply(this, arguments);
}
Y.extend(Chooser, M.core.chooserdialogue, {
initializer: function() {
Y.all('form').each(function(node) {
if (/question\/addquestion\.php/.test(node.getAttribute('action'))) {
node.on('submit', this.displayQuestionChooser, this);
}
}, this);
},
displayQuestionChooser: function(e) {
var dialogue = Y.one(SELECTORS.CREATENEWQUESTION + ' ' + SELECTORS.CHOOSERDIALOGUE),
header = Y.one(SELECTORS.CREATENEWQUESTION + ' ' + SELECTORS.CHOOSERHEADER);
if (this.container === null) {
// Setup the dialogue, and then prepare the chooser if it's not already been set up.
this.setup_chooser_dialogue(dialogue, header, {});
this.prepare_chooser();
}
// Update all of the hidden fields within the questionbank form.
var originForm = e.target.ancestor('form', true),
targetForm = this.container.one('form'),
hiddenElements = originForm.all('input[type="hidden"]');
targetForm.all('input.customfield').remove();
hiddenElements.each(function(field) {
targetForm.appendChild(field.cloneNode())
.removeAttribute('id')
.addClass('customfield');
});
// Display the chooser dialogue.
this.display_chooser(e);
}
}, {
NAME: 'questionChooser'
});
M.question = M.question || {};
M.question.init_chooser = function(config) {
return new Chooser(config);
};
}, '@VERSION@', {"requires": ["moodle-core-chooserdialogue"]});
@@ -0,0 +1 @@
YUI.add("moodle-question-chooser",function(n,o){var s="div.createnewquestion",r="div.chooserdialoguebody",u="div.choosertitle";function e(){e.superclass.constructor.apply(this,arguments)}n.extend(e,M.core.chooserdialogue,{initializer:function(){n.all("form").each(function(o){/question\/addquestion\.php/.test(o.getAttribute("action"))&&o.on("submit",this.displayQuestionChooser,this)},this)},displayQuestionChooser:function(o){var e,i=n.one(s+" "+r),t=n.one(s+" "+u);null===this.container&&(this.setup_chooser_dialogue(i,t,{}),this.prepare_chooser()),i=o.target.ancestor("form",!0),e=this.container.one("form"),t=i.all('input[type="hidden"]'),e.all("input.customfield").remove(),t.each(function(o){e.appendChild(o.cloneNode()).removeAttribute("id").addClass("customfield")}),this.display_chooser(o)}},{NAME:"questionChooser"}),M.question=M.question||{},M.question.init_chooser=function(o){return new e(o)}},"@VERSION@",{requires:["moodle-core-chooserdialogue"]});
@@ -0,0 +1,79 @@
YUI.add('moodle-question-chooser', function (Y, NAME) {
// 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/>.
/**
* JavaScript required by the question type chooser pop-up.
*
* @module moodle-question-chooser
*/
var SELECTORS = {
CREATENEWQUESTION: 'div.createnewquestion',
CREATENEWQUESTIONFORM: 'div.createnewquestion form',
CHOOSERDIALOGUE: 'div.chooserdialoguebody',
CHOOSERHEADER: 'div.choosertitle'
};
function Chooser() {
Chooser.superclass.constructor.apply(this, arguments);
}
Y.extend(Chooser, M.core.chooserdialogue, {
initializer: function() {
Y.all('form').each(function(node) {
if (/question\/addquestion\.php/.test(node.getAttribute('action'))) {
node.on('submit', this.displayQuestionChooser, this);
}
}, this);
},
displayQuestionChooser: function(e) {
var dialogue = Y.one(SELECTORS.CREATENEWQUESTION + ' ' + SELECTORS.CHOOSERDIALOGUE),
header = Y.one(SELECTORS.CREATENEWQUESTION + ' ' + SELECTORS.CHOOSERHEADER);
if (this.container === null) {
// Setup the dialogue, and then prepare the chooser if it's not already been set up.
this.setup_chooser_dialogue(dialogue, header, {});
this.prepare_chooser();
}
// Update all of the hidden fields within the questionbank form.
var originForm = e.target.ancestor('form', true),
targetForm = this.container.one('form'),
hiddenElements = originForm.all('input[type="hidden"]');
targetForm.all('input.customfield').remove();
hiddenElements.each(function(field) {
targetForm.appendChild(field.cloneNode())
.removeAttribute('id')
.addClass('customfield');
});
// Display the chooser dialogue.
this.display_chooser(e);
}
}, {
NAME: 'questionChooser'
});
M.question = M.question || {};
M.question.init_chooser = function(config) {
return new Chooser(config);
};
}, '@VERSION@', {"requires": ["moodle-core-chooserdialogue"]});
@@ -0,0 +1,22 @@
YUI.add('moodle-question-searchform', function (Y, NAME) {
var SELECTORS = {
OPTIONS: '.searchoptions'
},
NS;
M.question = M.question || {};
NS = M.question.searchform = {};
NS.init = function() {
Y.delegate('change', this.option_changed, Y.config.doc, SELECTORS.OPTIONS, this);
};
NS.option_changed = function(e) {
e.target.getDOMNode().form.submit();
};
}, '@VERSION@', {"requires": ["base", "node"]});
@@ -0,0 +1 @@
YUI.add("moodle-question-searchform",function(o,e){var n=".searchoptions";M.question=M.question||{},M.question.searchform={init:function(){o.delegate("change",this.option_changed,o.config.doc,n,this)},option_changed:function(o){o.target.getDOMNode().form.submit()}}},"@VERSION@",{requires:["base","node"]});
@@ -0,0 +1,22 @@
YUI.add('moodle-question-searchform', function (Y, NAME) {
var SELECTORS = {
OPTIONS: '.searchoptions'
},
NS;
M.question = M.question || {};
NS = M.question.searchform = {};
NS.init = function() {
Y.delegate('change', this.option_changed, Y.config.doc, SELECTORS.OPTIONS, this);
};
NS.option_changed = function(e) {
e.target.getDOMNode().form.submit();
};
}, '@VERSION@', {"requires": ["base", "node"]});
+10
View File
@@ -0,0 +1,10 @@
{
"name": "moodle-question-chooser",
"builds": {
"moodle-question-chooser": {
"jsfiles": [
"chooser.js"
]
}
}
}
+76
View File
@@ -0,0 +1,76 @@
// 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/>.
/**
* JavaScript required by the question type chooser pop-up.
*
* @module moodle-question-chooser
*/
Y.log("The moodle-question-chooser module has been deprecated. " +
"Please use moodle-qbank_editquestion-chooser instead.", 'moodle-core-notification', 'warn');
var SELECTORS = {
CREATENEWQUESTION: 'div.createnewquestion',
CREATENEWQUESTIONFORM: 'div.createnewquestion form',
CHOOSERDIALOGUE: 'div.chooserdialoguebody',
CHOOSERHEADER: 'div.choosertitle'
};
function Chooser() {
Chooser.superclass.constructor.apply(this, arguments);
}
Y.extend(Chooser, M.core.chooserdialogue, {
initializer: function() {
Y.all('form').each(function(node) {
if (/question\/addquestion\.php/.test(node.getAttribute('action'))) {
node.on('submit', this.displayQuestionChooser, this);
}
}, this);
},
displayQuestionChooser: function(e) {
var dialogue = Y.one(SELECTORS.CREATENEWQUESTION + ' ' + SELECTORS.CHOOSERDIALOGUE),
header = Y.one(SELECTORS.CREATENEWQUESTION + ' ' + SELECTORS.CHOOSERHEADER);
if (this.container === null) {
// Setup the dialogue, and then prepare the chooser if it's not already been set up.
this.setup_chooser_dialogue(dialogue, header, {});
this.prepare_chooser();
}
// Update all of the hidden fields within the questionbank form.
var originForm = e.target.ancestor('form', true),
targetForm = this.container.one('form'),
hiddenElements = originForm.all('input[type="hidden"]');
targetForm.all('input.customfield').remove();
hiddenElements.each(function(field) {
targetForm.appendChild(field.cloneNode())
.removeAttribute('id')
.addClass('customfield');
});
// Display the chooser dialogue.
this.display_chooser(e);
}
}, {
NAME: 'questionChooser'
});
M.question = M.question || {};
M.question.init_chooser = function(config) {
return new Chooser(config);
};
@@ -0,0 +1,7 @@
{
"moodle-question-chooser": {
"requires": [
"moodle-core-chooserdialogue"
]
}
}
+10
View File
@@ -0,0 +1,10 @@
{
"name": "moodle-question-searchform",
"builds": {
"moodle-question-searchform": {
"jsfiles": [
"searchform.js"
]
}
}
}
+17
View File
@@ -0,0 +1,17 @@
var SELECTORS = {
OPTIONS: '.searchoptions'
},
NS;
M.question = M.question || {};
NS = M.question.searchform = {};
NS.init = function() {
Y.delegate('change', this.option_changed, Y.config.doc, SELECTORS.OPTIONS, this);
};
NS.option_changed = function(e) {
e.target.getDOMNode().form.submit();
};
@@ -0,0 +1,8 @@
{
"moodle-question-searchform": {
"requires": [
"base",
"node"
]
}
}