From 81554b2f8bc56a58fc1e71481caedd6f408cf949 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Fri, 5 Jan 2024 08:07:07 +0100 Subject: [PATCH] fix for passing the question to storeAnswersForQuestion --- lib/Controller/ApiController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 3d8ab8faa..eba607f04 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -966,8 +966,6 @@ public function getSubmissions(string $hash): DataResponse { * @param array $answerArray [arrayOfString] */ private function storeAnswersForQuestion($submissionId, array $question, array $answerArray) { - $question = $questions[$questionIndex]; - foreach ($answerArray as $answer) { $answerText = ''; @@ -1092,6 +1090,8 @@ public function insertSubmission(int $formId, array $answers, string $shareHash continue; } + $question = $questions[$questionIndex]; + $this->storeAnswersForQuestion($submission->getId(), $question, $answerArray); }