MDL-81961 core_question: Final deprecation of moodle-question-chooser
Also includes removal of qbank_chooser template which was deprecated alongside it.
This commit is contained in:
committed by
stevandoMoodle
parent
dbf9b2bc1f
commit
4e6c379810
@@ -0,0 +1,12 @@
|
||||
issueNumber: MDL-81961
|
||||
notes:
|
||||
core_question:
|
||||
- message: |
|
||||
core_question:
|
||||
- message: |
|
||||
Final deprecation of `moodle-question-chooser` YUI module.
|
||||
type: removed
|
||||
- message: |
|
||||
Final deprecation of `core_question/qbank_chooser` template.
|
||||
type: removed
|
||||
type: removed
|
||||
@@ -1,29 +0,0 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
Question bank chooser.
|
||||
}}
|
||||
{{> core/chooser }}
|
||||
{{#js}}
|
||||
require([
|
||||
'core/yui'
|
||||
], function(Y) {
|
||||
Y.use('moodle-question-chooser', function() {
|
||||
M.question.init_chooser();
|
||||
});
|
||||
});
|
||||
{{/js}}
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
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"]});
|
||||
-1
@@ -1 +0,0 @@
|
||||
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"]});
|
||||
@@ -1,79 +0,0 @@
|
||||
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"]});
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"name": "moodle-question-chooser",
|
||||
"builds": {
|
||||
"moodle-question-chooser": {
|
||||
"jsfiles": [
|
||||
"chooser.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
// 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);
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"moodle-question-chooser": {
|
||||
"requires": [
|
||||
"moodle-core-chooserdialogue"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user