Index: mod/quiz/report/statistics/statistics_table.php =================================================================== --- mod/quiz/report/statistics/Copy of statistics_table.php Tue Oct 07 15:30:01 2008 +++ mod/quiz/report/statistics/statistics_table.php Tue Oct 07 15:30:42 2008 @@ -167,7 +167,7 @@ } function col_sd($question){ - if (!is_null($question->_stats->sd)){ + if (!is_null($question->_stats->sd) && $question->_stats->maxgrade){ return number_format($question->_stats->sd*100 / $question->_stats->maxgrade, 2).'%'; } else { return ''; @@ -181,7 +181,11 @@ } } function col_facility($question){ - return number_format($question->_stats->facility*100, 2).'%'; + if (!is_null($question->_stats->facility)){ + return number_format($question->_stats->facility*100, 2).'%'; + } else { + return ''; + } } // ou-specific ends - whole file is local until Moodle 2.0 } Index: mod/quiz/report/statistics/qstats.php =================================================================== --- mod/quiz/report/statistics/Copy of qstats.php Tue Oct 07 15:31:43 2008 +++ mod/quiz/report/statistics/qstats.php Tue Oct 07 15:32:05 2008 @@ -137,7 +137,11 @@ function _initial_question_walker(&$stats){ $stats->gradeaverage = $stats->totalgrades / $stats->s; - $stats->facility = $stats->gradeaverage / $stats->maxgrade; + if ($stats->maxgrade){ + $stats->facility = $stats->gradeaverage / $stats->maxgrade; + } else { + $stats->facility = null; + } $stats->othergradeaverage = $stats->totalothergrades / $stats->s; sort($stats->gradearray, SORT_NUMERIC); sort($stats->othergradesarray, SORT_NUMERIC);