From c1e850f778303e1910d982ac56d29e7cb528c845 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 5 Dec 2011 15:39:55 +0000 Subject: [PATCH] MDL-29579 quiz statistics, include qtext in full XHTML export. --- mod/quiz/report/statistics/report.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/mod/quiz/report/statistics/report.php b/mod/quiz/report/statistics/report.php index 6b692804f37..54725fb8508 100644 --- a/mod/quiz/report/statistics/report.php +++ b/mod/quiz/report/statistics/report.php @@ -312,15 +312,22 @@ class quiz_statistics_report extends quiz_default_report { // Display the various bits. echo $OUTPUT->heading(get_string('questioninformation', 'quiz_statistics')); echo html_writer::table($questioninfotable); - - echo $OUTPUT->box(format_text($question->questiontext, $question->questiontextformat, - array('overflowdiv' => true)) . $actions, - 'questiontext boxaligncenter generalbox boxwidthnormal mdl-align'); - + echo $this->render_question_text($question); echo $OUTPUT->heading(get_string('questionstatistics', 'quiz_statistics')); echo html_writer::table($questionstatstable); } + /** + * @param object $question question data. + * @return string HTML of question text, ready for display. + */ + protected function render_question_text($question){ + global $OUTPUT; + return $OUTPUT->box(format_text($question->questiontext, $question->questiontextformat, + array('overflowdiv' => true)), + 'questiontext boxaligncenter generalbox boxwidthnormal mdl-align'); + } + /** * Display the response analysis for a question. * @param object $question the question to report on. @@ -355,6 +362,10 @@ class quiz_statistics_report extends quiz_default_report { // Set up the table. $exportclass->start_table($questiontabletitle); + + if ($this->table->is_downloading() == 'xhtml') { + echo $this->render_question_text($question); + } } $responesstats = new quiz_statistics_response_analyser($question);