diff --git a/components/ILIAS/Test/src/Results/Data/Factory.php b/components/ILIAS/Test/src/Results/Data/Factory.php index d92991816861..d965810e36c9 100644 --- a/components/ILIAS/Test/src/Results/Data/Factory.php +++ b/components/ILIAS/Test/src/Results/Data/Factory.php @@ -284,10 +284,9 @@ private function buildAttemptResults( $feedback = $question_gui->getGenericFeedbackOutput($active_id, $attempt_id); - $recapitulation = null; - if ($is_user_output && $settings->getShowRecapitulation()) { - $recapitulation = $question_gui->getObject()->getSuggestedSolutionOutput(); - } + $recapitulation = $is_user_output && $settings->getShowRecapitulation() + ? $question->getSuggestedSolutionOutput() + : null; $question_results[] = new QuestionResult( $qid, diff --git a/components/ILIAS/TestQuestionPool/classes/class.assQuestion.php b/components/ILIAS/TestQuestionPool/classes/class.assQuestion.php index e6686b4d3d6a..8a8cf44b2daf 100755 --- a/components/ILIAS/TestQuestionPool/classes/class.assQuestion.php +++ b/components/ILIAS/TestQuestionPool/classes/class.assQuestion.php @@ -491,7 +491,7 @@ public function getSuggestedSolutionOutput(): string ); ilWACSignedPath::setTokenMaxLifetimeInSeconds(60); - $path_to_solution = $this->getSuggestedSolutionPathWeb() . $solution->getFilename(); + $path_to_solution = "{$this->getSuggestedSolutionPath()}{$solution->getFilename()}"; if (!file_exists($path_to_solution)) { break; } @@ -2845,8 +2845,7 @@ protected function getSuggestedSolutionsRepo(): SuggestedSolutionsDatabaseReposi protected function loadSuggestedSolutions(): array { - $question_id = $this->getId(); - return $this->getSuggestedSolutionsRepo()->selectFor($question_id); + return $this->getSuggestedSolutionsRepo()->selectFor($this->getId()); } /**