mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-1883 - /course/scales.php very slow. "Backported" the fix by Petr from 1.9 to 1.8. Not a direct merge as the code has been refactored.
This commit is contained in:
parent
f99ed7c86d
commit
186b0a1537
8 changed files with 129 additions and 41 deletions
|
@ -1980,6 +1980,16 @@ function assignment_scale_used ($assignmentid, $scaleid) {
|
|||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the scale is in use in the system.
|
||||
*
|
||||
* @param $scaleid int The scale to be counted.
|
||||
* @return boolean
|
||||
*/
|
||||
function assignment_scale_used_anywhere($scaleid) {
|
||||
return record_exists("assignment","grade","-$scaleid");
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure up-to-date events are created for all assignment instances
|
||||
*
|
||||
|
|
|
@ -1222,6 +1222,16 @@ function forum_scale_used ($forumid,$scaleid) {
|
|||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the scale is in use in the system.
|
||||
*
|
||||
* @param $scaleid int The scale to be counted.
|
||||
* @return boolean
|
||||
*/
|
||||
function forum_scale_used_anywhere($scaleid) {
|
||||
return record_exists("forum","scale","-$scaleid");
|
||||
}
|
||||
|
||||
// SQL FUNCTIONS ///////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
|
|
|
@ -401,6 +401,16 @@ function glossary_scale_used ($glossaryid,$scaleid) {
|
|||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the scale is in use in the system.
|
||||
*
|
||||
* @param $scaleid int The scale to be counted.
|
||||
* @return boolean
|
||||
*/
|
||||
function glossary_scale_used_anywhere($scaleid) {
|
||||
return record_exists("glossary","scale","-$scaleid");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Any other glossary functions go here. Each of them must have a name that
|
||||
/// starts with glossary_
|
||||
|
|
|
@ -1225,6 +1225,17 @@ function hotpot_scale_used ($hotpotid, $scaleid) {
|
|||
return $report;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the scale is in use in the system.
|
||||
*
|
||||
* @param $scaleid int The scale to be counted.
|
||||
* @return boolean
|
||||
*/
|
||||
function hotpot_scale_used_anywhere($scaleid) {
|
||||
// return record_exists("hotpot","scale","-$scaleid");
|
||||
return false; // Scales are not used by Hotpot module
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
/// Any other hotpot functions go here.
|
||||
/// Each of them must have a name that starts with hotpot
|
||||
|
|
|
@ -307,6 +307,16 @@ function journal_scale_used ($journalid,$scaleid) {
|
|||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the scale is in use in the system.
|
||||
*
|
||||
* @param $scaleid int The scale to be counted.
|
||||
* @return boolean
|
||||
*/
|
||||
function journal_scale_used_anywhere($scaleid) {
|
||||
return record_exists("journal","assessed","-$scaleid");
|
||||
}
|
||||
|
||||
// SQL FUNCTIONS ///////////////////////////////////////////////////////////////////
|
||||
|
||||
function journal_get_users_done($journal) {
|
||||
|
|
|
@ -140,6 +140,17 @@ function lams_scale_used ($lamsid,$scaleid) {
|
|||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the scale is in use in the system.
|
||||
*
|
||||
* @param $scaleid int The scale to be counted.
|
||||
* @return boolean
|
||||
*/
|
||||
function lams_scale_used_anywhere($scaleid) {
|
||||
// return record_exists("lams","scale","-$scaleid");
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Any other lams functions go here. Each of them must have a name that
|
||||
/// starts with lams_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue