From: jamiesensei Date: Tue, 21 Oct 2008 09:32:24 +0000 (+0000) Subject: MDL-16952 "after DB field type changes standard deviation and facility index show... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=047c0f78aa90a3d478f17b437fa34740c9c00342;p=moodle.git MDL-16952 "after DB field type changes standard deviation and facility index show up as 0% instead of blank" Problem is that question->maxgrade is now 0.0000 and not 0 and $maxgrade now does not evaluate as false, need to use $maxgade!=0 which evaluates as before. --- diff --git a/mod/quiz/report/statistics/qstats.php b/mod/quiz/report/statistics/qstats.php index 7935df3f85..4f00b88223 100644 --- a/mod/quiz/report/statistics/qstats.php +++ b/mod/quiz/report/statistics/qstats.php @@ -135,7 +135,7 @@ class qstats{ function _initial_question_walker(&$stats){ $stats->gradeaverage = $stats->totalgrades / $stats->s; - if ($stats->maxgrade){ + if ($stats->maxgrade!=0){ $stats->facility = $stats->gradeaverage / $stats->maxgrade; } else { $stats->facility = null; diff --git a/mod/quiz/report/statistics/statistics_table.php b/mod/quiz/report/statistics/statistics_table.php index e4681b4393..694fd06d6e 100644 --- a/mod/quiz/report/statistics/statistics_table.php +++ b/mod/quiz/report/statistics/statistics_table.php @@ -171,7 +171,7 @@ class quiz_report_statistics_table extends flexible_table { } function col_sd($question){ - if (!is_null($question->_stats->sd) && $question->_stats->maxgrade){ + if (!is_null($question->_stats->sd) && ($question->_stats->maxgrade!=0)){ return number_format($question->_stats->sd*100 / $question->_stats->maxgrade, 2).'%'; } else { return '';