Refine survey editor workflow and publication handling

This commit is contained in:
Jürgen Mummert
2026-05-29 10:19:19 +02:00
parent 6bbded4181
commit 1174410c1b
40 changed files with 1121 additions and 335 deletions
+22
View File
@@ -63,6 +63,28 @@ final class SurveyFlowService
return null;
}
public function getFirstQuestion(SurveyModel $survey): ?SurveyContentModel
{
$questions = $this->getOrderedQuestions($survey);
return $questions[0] ?? null;
}
public function resolveQuestionById(SurveyModel $survey, int $questionId): ?SurveyContentModel
{
if ($questionId <= 0) {
return null;
}
foreach ($this->getOrderedQuestions($survey) as $question) {
if ((int) $question->id === $questionId) {
return $question;
}
}
return null;
}
/**
* @return array{current:int,total:int,percentage:int}
*/