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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 '';
|
||||
|
||||
Reference in New Issue
Block a user