From: moodler Date: Thu, 13 May 2004 08:46:25 +0000 (+0000) Subject: Fix for the way question texts were displayed bug 1381 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=35ebf5c09bf79409644424a879d5ecd53014faa8;p=moodle.git Fix for the way question texts were displayed bug 1381 --- diff --git a/mod/quiz/report/simplestat/report.php b/mod/quiz/report/simplestat/report.php index ce10b0f6b6..c1edd3522a 100644 --- a/mod/quiz/report/simplestat/report.php +++ b/mod/quiz/report/simplestat/report.php @@ -27,6 +27,12 @@ class quiz_report extends quiz_default_report { $data = array(); $questionorder = explode(',', $quiz->questions); + $count = 0; + foreach ($questionorder as $questionid) { + $count++; + $question[$count] = get_record("quiz_questions", "id", $questionid); + } + /// For each person in the class, get their best attempt /// and create a table listing results for each person if ($users) { @@ -55,7 +61,6 @@ class quiz_report extends quiz_default_report { foreach ($questionorder as $questionid) { $count++; $data[$user->id]->grades[$count] = $results->grades[$questionid]; - $question[$count] = $questions[$questionid]; } } } @@ -198,12 +203,15 @@ class quiz_report extends quiz_default_report { /// Otherwise, display the table as HTML - echo ""; echo ""; echo ""; for ($i=1; $i<=$count; $i++) { - echo ""; + $title = ''; + if (!empty($question[$i]->questiontext)) { + $title = strip_tags($question[$i]->questiontext); + } + echo ""; } echo "";
 questiontext)."\">$i$i