From: tjhunt Date: Thu, 18 Sep 2008 12:47:12 +0000 (+0000) Subject: Nasty hack fix for MDL-16567 - I am hoping Jamie will come up with a proper fix soon... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a1f6db1775f1d1223d06720fa22ba10a14f3cfd1;p=moodle.git Nasty hack fix for MDL-16567 - I am hoping Jamie will come up with a proper fix soon, but I am about to demo this. --- diff --git a/mod/quiz/report/statistics/qstats.php b/mod/quiz/report/statistics/qstats.php index 15dfe71e98..07a00c5495 100644 --- a/mod/quiz/report/statistics/qstats.php +++ b/mod/quiz/report/statistics/qstats.php @@ -55,6 +55,12 @@ class qstats{ if ($this->states === false){ print_error('errorstatisticsquestions', 'quiz_statistics'); } + // Nasty hack fix for MDL-16567 - TODO a proper fix. + foreach ($this->states as $id => $state) { + if (!isset($this->questions[$state->question])) { + unset($this->states[$id]); + } + } } function _initial_states_walker($state, &$stats, $positionstat = true){