From f4261559961b8b314fd94e126261ee988c5cb0aa Mon Sep 17 00:00:00 2001 From: Amaia Anabitarte Date: Thu, 9 Aug 2018 15:12:52 +0100 Subject: [PATCH] MDL-58781 mod_feedback: Inconsistency in analysis exported to excel --- mod/feedback/analysis_to_excel.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/mod/feedback/analysis_to_excel.php b/mod/feedback/analysis_to_excel.php index b5762f6e801..aafcda049b6 100644 --- a/mod/feedback/analysis_to_excel.php +++ b/mod/feedback/analysis_to_excel.php @@ -80,15 +80,14 @@ $rowoffset1 = 0; $worksheet1->write_string($rowoffset1, 0, userdate(time()), $xlsformats->head1); // Get the completeds. -$completedscount = feedback_get_completeds_group_count($feedback, $mygroupid, $courseid); -if ($completedscount > 0) { - // Write the count of completeds. - $rowoffset1++; - $worksheet1->write_string($rowoffset1, - 0, - $cm->get_module_type_name(true).': '.strval($completedscount), - $xlsformats->head1); -} +$completedscount = $feedbackstructure->count_completed_responses($mygroupid); +// Write the count of completeds. +// Keep consistency and write count of completeds even when they are 0. +$rowoffset1++; +$worksheet1->write_string($rowoffset1, + 0, + get_string('completed_feedbacks', 'feedback').': '.strval($completedscount), + $xlsformats->head1); $rowoffset1++; $worksheet1->write_string($rowoffset1,