From 760aa21ec2f7dddd8932c51ee2a6c8f0b608eff0 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 3 Jan 2025 17:11:39 +0200 Subject: [PATCH] Test: Always Calculate Time Per Question as Int See: https://mantis.ilias.de/view.php?id=43421 --- components/ILIAS/Test/src/ExportImport/ResultsExportExcel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ILIAS/Test/src/ExportImport/ResultsExportExcel.php b/components/ILIAS/Test/src/ExportImport/ResultsExportExcel.php index b10014b4cca7..710c6a034229 100755 --- a/components/ILIAS/Test/src/ExportImport/ResultsExportExcel.php +++ b/components/ILIAS/Test/src/ExportImport/ResultsExportExcel.php @@ -322,7 +322,7 @@ private function addResultsContent(array $cols_for_question_ids): void $this->worksheet->setCell($current_row, $col++, $this->convertToUserDateFormat($user_data->getFirstVisit())); $this->worksheet->setCell($current_row, $col++, $this->convertToUserDateFormat($user_data->getLastVisit())); $this->worksheet->setCell($current_row, $col++, $this->secondsToHoursMinutesSecondsString( - $user_data->getQuestionsWorkedThrough() ? $user_data->getTimeOnTask() / $user_data->getQuestionsWorkedThrough() : 0 + $user_data->getQuestionsWorkedThrough() !== 0 ? intdiv($user_data->getTimeOnTask(), $user_data->getQuestionsWorkedThrough()) : 0 )); if ($this->test_obj->isShowExamIdInTestResultsEnabled()) { @@ -337,7 +337,7 @@ private function addResultsContent(array $cols_for_question_ids): void $this->worksheet->setCell($current_row, $col++, $test_attempt_data->getReachedPointsInPercent()); $this->worksheet->setCell($current_row, $col++, $this->secondsToHoursMinutesSecondsString($test_attempt_data->getWorkingTime())); $this->worksheet->setCell($current_row, $col++, $this->secondsToHoursMinutesSecondsString( - $test_attempt_data->getAnsweredQuestionCount() ? $test_attempt_data->getWorkingTime() / $test_attempt_data->getAnsweredQuestionCount() : 0 + $test_attempt_data->getAnsweredQuestionCount() !== 0 ? intdiv($test_attempt_data->getWorkingTime(), $test_attempt_data->getAnsweredQuestionCount()) : 0 )); $this->worksheet->setCell(