mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'MDL-34589' of git://github.com/timhunt/moodle
This commit is contained in:
commit
82ee961aca
2 changed files with 9 additions and 2 deletions
|
@ -89,7 +89,9 @@ while ($bands > 20 || $bands <= 10) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$bands = ceil($bands);
|
// See MDL-34589. Using doubles as array keys causes problems in PHP 5.4,
|
||||||
|
// hence the explicit cast to int.
|
||||||
|
$bands = (int) ceil($bands);
|
||||||
$bandwidth = $quiz->grade / $bands;
|
$bandwidth = $quiz->grade / $bands;
|
||||||
$bandlabels = array();
|
$bandlabels = array();
|
||||||
for ($i = 1; $i <= $bands; $i++) {
|
for ($i = 1; $i <= $bands; $i++) {
|
||||||
|
|
|
@ -191,6 +191,11 @@ function quiz_report_qm_filter_select($quiz, $quizattemptsalias = 'quiza') {
|
||||||
*/
|
*/
|
||||||
function quiz_report_grade_bands($bandwidth, $bands, $quizid, $userids = array()) {
|
function quiz_report_grade_bands($bandwidth, $bands, $quizid, $userids = array()) {
|
||||||
global $DB;
|
global $DB;
|
||||||
|
if (!is_int($bands)) {
|
||||||
|
debugging('$bands passed to quiz_report_grade_bands must be an integer. (' .
|
||||||
|
gettype($bands) . ' passed.)', DEBUG_DEVELOPER);
|
||||||
|
$bands = (int) $bands;
|
||||||
|
}
|
||||||
|
|
||||||
if ($userids) {
|
if ($userids) {
|
||||||
list($usql, $params) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED, 'u');
|
list($usql, $params) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED, 'u');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue