Skip to content

Commit

Permalink
small fix for ApiController
Browse files Browse the repository at this point in the history
Signed-off-by: Timotheus Pokorra <timotheus.pokorra@solidcharity.com>
  • Loading branch information
tpokorra committed Jan 5, 2024
1 parent 0dc0f79 commit cd1eafa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -982,8 +982,8 @@ private function storeAnswersForQuestion($submissionId, array $question, array $
$storedAnswers = $this->answerMapper->findBySubmissionAndQuestion($submissionId, $question['id']);
}

// Are we using answer ids as values
if (in_array($question['type'], Constants::ANSWER_TYPES_PREDEFINED)) {
$answerText = "";

$newAnswerTexts = array();

Expand All @@ -996,7 +996,7 @@ private function storeAnswersForQuestion($submissionId, array $question, array $
$optionIndex = array_search($answer, array_column($question['options'], 'id'));
if ($optionIndex !== false) {
$answerText = $question['options'][$optionIndex]['text'];
} elseif (!empty($question['extraSettings']->allowOtherAnswer) && strpos($answer, Constants::QUESTION_EXTRASETTINGS_OTHER_PREFIX) === 0) {
} elseif (!empty($question['extraSettings']['allowOtherAnswer']) && strpos($answer, Constants::QUESTION_EXTRASETTINGS_OTHER_PREFIX) === 0) {
$answerText = str_replace(Constants::QUESTION_EXTRASETTINGS_OTHER_PREFIX, "", $answer);
}

Expand Down

0 comments on commit cd1eafa

Please sign in to comment.