Unverified Commit 488b3568 authored by Jonas Rittershofer's avatar Jonas Rittershofer
Browse files

Fix export multiple answers


Signed-off-by: default avatarJonas Rittershofer <jotoeri@users.noreply.github.com>
parent e80b8ae3
......@@ -186,7 +186,14 @@ class SubmissionService {
// Answers, make sure we keep the question order
$answers = array_reduce($this->answerMapper->findBySubmission($submission->getId()), function (array $carry, Answer $answer) {
$carry[$answer->getQuestionId()] = $answer->getText();
$questionId = $answer->getQuestionId();
// If key exists, insert separator
if (key_exists($questionId, $carry)) {
$carry[$questionId] .= '; ';
}
$carry[$questionId] .= $answer->getText();
return $carry;
}, []);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment