Commit c0375ba7 authored by Amaia's avatar Amaia
Browse files

MDL-66369 libraries: Remove [modname]_scale_used functions

These functions were only used by the deprecated function
which was deprecated in 3.1, and removed in 3.6.
parent 7e16c70b
......@@ -901,24 +901,11 @@ function assign_print_recent_mod_activity($activity, $courseid, $detail, $modnam
}
/**
* Checks if a scale is being used by an assignment.
*
* This is used by the backup code to decide whether to back up a scale
* @param int $assignmentid
* @param int $scaleid
* @return boolean True if the scale is used by the assignment
* @deprecated since Moodle 3.8
*/
function assign_scale_used($assignmentid, $scaleid) {
global $DB;
$return = false;
$rec = $DB->get_record('assign', array('id'=>$assignmentid, 'grade'=>-$scaleid));
if (!empty($rec) && !empty($scaleid)) {
$return = true;
}
return $return;
function assign_scale_used() {
throw new coding_exception('assign_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
......
This files describes API changes in the assign code.
=== 3.8 ===
* Webservice function mod_assign_get_submission_status, return value 'warnofungroupedusers', changed from PARAM_BOOL to PARAM_ALPHA. See the description for possible values.
* The following functions have been finally deprecated and can not be used anymore:
* assign_scale_used()
=== 3.7 ===
* Submissions plugins should implement the "remove" function to remove data when "Remove submission" is used.
......
......@@ -215,17 +215,11 @@ function book_grades($bookid) {
}
/**
* This function returns if a scale is being used by one book
* it it has support for grading and scales. Commented code should be
* modified if necessary. See book, glossary or journal modules
* as reference.
*
* @param int $bookid
* @param int $scaleid
* @return boolean True if the scale is used by any journal
* @deprecated since Moodle 3.8
*/
function book_scale_used($bookid, $scaleid) {
return false;
function book_scale_used() {
throw new coding_exception('book_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
......
This files describes API changes in the book code.
=== 3.8 ===
* The following functions have been finally deprecated and can not be used anymore:
* book_scale_used()
=== 3.7 ===
* book_export_contents() callback now returns tags information for every chapter.
......
......@@ -586,10 +586,11 @@ function feedback_cron () {
}
/**
* @return bool false
* @deprecated since Moodle 3.8
*/
function feedback_scale_used ($feedbackid, $scaleid) {
return false;
function feedback_scale_used() {
throw new coding_exception('feedback_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
......
=== 3.8 ===
* The following functions have been finally deprecated and can not be used anymore:
* feedback_scale_used()
=== 3.6 ===
* The following functions have been finally deprecated and can not be used anymore:
......
......@@ -1651,3 +1651,11 @@ function forum_count_replies($post, $children = true) {
true
);
}
/**
* @deprecated since Moodle 3.8
*/
function forum_scale_used() {
throw new coding_exception('forum_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
......@@ -804,28 +804,6 @@ function forum_grade_item_delete($forum) {
return grade_update('mod/forum', $forum->course, 'mod', 'forum', $forum->id, 0, NULL, array('deleted'=>1));
}
/**
* This function returns if a scale is being used by one forum
*
* @global object
* @param int $forumid
* @param int $scaleid negative number
* @return bool
*/
function forum_scale_used ($forumid,$scaleid) {
global $DB;
$return = false;
$rec = $DB->get_record("forum",array("id" => "$forumid","scale" => "-$scaleid"));
if (!empty($rec) && !empty($scaleid)) {
$return = true;
}
return $return;
}
/**
* Checks if scale is being used by any instance of forum
*
......
This files describes API changes in /mod/forum/*,
information provided here is intended especially for developers.
=== 3.8 ===
* The following functions have been finally deprecated and can not be used anymore:
* forum_scale_used()
=== 3.7 ===
* Changed the forum discussion rendering to use templates rather than print functions.
* Added new forum entities, factories, exporters, renderers, and vaults in the local namespace to better encapsulate the forum data.
......
......@@ -865,24 +865,11 @@ function glossary_grade_item_delete($glossary) {
}
/**
* @global object
* @param int $gloassryid
* @param int $scaleid
* @return bool
* @deprecated since Moodle 3.8
*/
function glossary_scale_used ($glossaryid,$scaleid) {
//This function returns if a scale is being used by one glossary
global $DB;
$return = false;
$rec = $DB->get_record("glossary", array("id"=>$glossaryid, "scale"=>-$scaleid));
if (!empty($rec) && !empty($scaleid)) {
$return = true;
}
return $return;
function glossary_scale_used() {
throw new coding_exception('glossary_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
......
This files describes API changes in /mod/glossary/*,
information provided here is intended especially for developers.
=== 3.8 ===
* The following functions have been finally deprecated and can not be used anymore:
* glossary_scale_used()
=== 3.7 ===
* External functions get_entries_by_* and get_entry now return an additional field "tags" containing the entry tags.
......
......@@ -363,26 +363,11 @@ function lti_grades($basicltiid) {
}
/**
* This function returns if a scale is being used by one basiclti
* it it has support for grading and scales. Commented code should be
* modified if necessary. See forum, glossary or journal modules
* as reference.
*
* @param int $basicltiid ID of an instance of this module
* @return mixed
*
* @TODO: implement this moodle function (if needed)
**/
function lti_scale_used ($basicltiid, $scaleid) {
$return = false;
// $rec = get_record("basiclti","id","$basicltiid","scale","-$scaleid");
//
// if (!empty($rec) && !empty($scaleid)) {
// $return = true;
// }
return $return;
* @deprecated since Moodle 3.8
*/
function lti_scale_used() {
throw new coding_exception('lti_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
......
This files describes API changes in the lti code.
=== 3.8 ===
* The following functions have been finally deprecated and can not be used anymore:
* lti_scale_used()
=== 3.7 ===
* Deprecated functions to add support for LTI 1 tools to access services:
......
......@@ -366,25 +366,11 @@ function wiki_grades($wikiid) {
}
/**
* This function returns if a scale is being used by one wiki
* it it has support for grading and scales. Commented code should be
* modified if necessary. See forum, glossary or journal modules
* as reference.
*
* @param int $wikiid ID of an instance of this module
* @return mixed
* @todo Finish documenting this function
**/
function wiki_scale_used($wikiid, $scaleid) {
$return = false;
//$rec = get_record("wiki","id","$wikiid","scale","-$scaleid");
//
//if (!empty($rec) && !empty($scaleid)) {
// $return = true;
//}
return $return;
* @deprecated since Moodle 3.8
*/
function wiki_scale_used() {
throw new coding_exception('wiki_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
......
This files describes API changes in /mod/wiki/*,
information provided here is intended especially for developers.
=== 3.8 ===
* The following functions have been finally deprecated and can not be used anymore:
* wiki_scale_used()
=== 3.7 ===
* External functions get_subwiki_pages and get_page_contents now return an additional field "tags" returning the entry tags.
......
......@@ -1057,37 +1057,11 @@ function workshop_print_recent_mod_activity($activity, $courseid, $detail, $modn
}
/**
* Is a given scale used by the instance of workshop?
*
* The function asks all installed grading strategy subplugins. The workshop
* core itself does not use scales. Both grade for submission and grade for
* assessments do not use scales.
*
* @param int $workshopid id of workshop instance
* @param int $scaleid id of the scale to check
* @return bool
* @deprecated since Moodle 3.8
*/
function workshop_scale_used($workshopid, $scaleid) {
global $CFG; // other files included from here
$strategies = core_component::get_plugin_list('workshopform');
foreach ($strategies as $strategy => $strategypath) {
$strategylib = $strategypath . '/lib.php';
if (is_readable($strategylib)) {
require_once($strategylib);
} else {
throw new coding_exception('the grading forms subplugin must contain library ' . $strategylib);
}
$classname = 'workshop_' . $strategy . '_strategy';
if (method_exists($classname, 'scale_used')) {
if (call_user_func_array(array($classname, 'scale_used'), array($scaleid, $workshopid))) {
// no need to include any other files - scale is used
return true;
}
}
}
return false;
function workshop_scale_used() {
throw new coding_exception('workshop_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
......
This files describes API changes in /mod/workshop - activity modules,
information provided here is intended especially for developers.
=== 3.8 ===
* The following functions have been finally deprecated and can not be used anymore:
* workshop_scale_used()
=== 3.7 ===
* workshop_cron() has been removed. Sub-plugins should now implement scheduled tasks.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment