Effectively the only delete process that remains in question_showbank_actions (editlib.php) is the one related to the select button.
The url form the delete X
http://132.208.141.198/moodle_19/mod/quiz/edit.php?recurse=1&qpage=0&cat=2%2C8&cmid=5&deleteselected=1&q1=1
if (optional_param('deleteselected', false, PARAM_BOOL)) { // delete selected questions from the category
if (($confirm = optional_param('confirm', '', PARAM_ALPHANUM)) and confirm_sesskey()) { // teacher has already confirmed the action
$deleteselected = required_param('deleteselected');
if ($confirm == md5($deleteselected)) {
if ($questionlist = explode(',', $deleteselected)) {
// for each question either hide it if it is in use or delete it
foreach ($questionlist as $questionid) {
question_require_capability_on($questionid, 'edit');
if (record_exists('quiz_question_instances', 'question', $questionid)) {
if (!set_field('question', 'hidden', 1, 'id', $questionid)) {
question_require_capability_on($questionid, 'edit');
error('Was not able to hide question');
}
} else {
delete_question($questionid);
}
}
}
redirect($pageurl->out());
} else {
error("Confirmation string was incorrect");
}
}
}
The url should be changed to go to the confirm first as this question could be used in a quiz.
Tim, if you want that I continue on this, just reassign it.
Effectively the only delete process that remains in question_showbank_actions (editlib.php) is the one related to the select button.
The url form the delete X
http://132.208.141.198/moodle_19/mod/quiz/edit.php?recurse=1&qpage=0&cat=2%2C8&cmid=5&deleteselected=1&q1=1
if (optional_param('deleteselected', false, PARAM_BOOL)) { // delete selected questions from the category
if (($confirm = optional_param('confirm', '', PARAM_ALPHANUM)) and confirm_sesskey()) { // teacher has already confirmed the action
$deleteselected = required_param('deleteselected');
if ($confirm == md5($deleteselected)) {
if ($questionlist = explode(',', $deleteselected)) {
// for each question either hide it if it is in use or delete it
foreach ($questionlist as $questionid) {
question_require_capability_on($questionid, 'edit');
if (record_exists('quiz_question_instances', 'question', $questionid)) {
if (!set_field('question', 'hidden', 1, 'id', $questionid)) { question_require_capability_on($questionid, 'edit'); error('Was not able to hide question'); }
} else { delete_question($questionid); }
}
}
redirect($pageurl->out());
} else { error("Confirmation string was incorrect"); }
}
}
The url should be changed to go to the confirm first as this question could be used in a quiz.
Tim, if you want that I continue on this, just reassign it.