diff --git a/components/ILIAS/Test/src/Questions/Presentation/QuestionsTable.php b/components/ILIAS/Test/src/Questions/Presentation/QuestionsTable.php index 0b745a3793a5..568ce50da8a6 100644 --- a/components/ILIAS/Test/src/Questions/Presentation/QuestionsTable.php +++ b/components/ILIAS/Test/src/Questions/Presentation/QuestionsTable.php @@ -168,10 +168,5 @@ private function loadRecords(): void { $this->records = $this->questionrepository ->getQuestionPropertiesWithAggregatedResultsForTest($this->test_obj); - usort( - $this->records, - static fn(TestQuestionProperties $a, TestQuestionProperties $b): int => - $a->getSequenceInformation()?->getPlaceInSequence() <=> $b->getSequenceInformation()?->getPlaceInSequence() - ); } } diff --git a/components/ILIAS/Test/src/Questions/Properties/DatabaseRepository.php b/components/ILIAS/Test/src/Questions/Properties/DatabaseRepository.php index a08d559cdd65..c2343218f714 100644 --- a/components/ILIAS/Test/src/Questions/Properties/DatabaseRepository.php +++ b/components/ILIAS/Test/src/Questions/Properties/DatabaseRepository.php @@ -164,11 +164,19 @@ private function getQuestionIdsForRandomTest(int $test_id): array private function buildQuestionPropertiesForFixedTest(\ilObjTest $test): array { $general_question_properties = $this->question_properties_repo->getForParentObjectId($test->getId()); - return $this->buildQuestionPropertiesFromGeneralQuestionPropertiesAndSquenceProperties( + $question_properties = $this->buildQuestionPropertiesFromGeneralQuestionPropertiesAndSquenceProperties( $general_question_properties, $this->getSequencePropertiesForQuestionIds(array_keys($general_question_properties)), true ); + + uasort( + $question_properties, + static fn(Properties $a, Properties $b): int => + $a->getSequenceInformation()->getPlaceInSequence() <=> $b->getSequenceInformation()->getPlaceInSequence() + ); + + return $question_properties; } /** diff --git a/components/ILIAS/Test/src/Scoring/Manual/class.TestScoringByQuestionGUI.php b/components/ILIAS/Test/src/Scoring/Manual/class.TestScoringByQuestionGUI.php index 15e1578ed207..81eb2b13465c 100755 --- a/components/ILIAS/Test/src/Scoring/Manual/class.TestScoringByQuestionGUI.php +++ b/components/ILIAS/Test/src/Scoring/Manual/class.TestScoringByQuestionGUI.php @@ -94,12 +94,6 @@ protected function showManScoringByQuestionParticipantsTable( $test_question_properties = $this->testquestionsrepository ->getQuestionPropertiesForTest($this->object); - uasort( - $test_question_properties, - fn(TestQuestionProperties $a, TestQuestionProperties $b): int - => $a->getSequenceInformation()->getPlaceInSequence() <=> $b->getSequenceInformation()->getPlaceInSequence() - ); - if ($test_question_properties === []) { $this->tpl->setOnScreenMessage('info', $this->lng->txt('manscoring_questions_not_found')); return;