feat: keep questionnaires until submitted, remind teamers daily and take bus feedback per leg
This commit is contained in:
1 parent
abf9c1be0b
commit
e72616fdbf
37 files changed
+1119
-238
No files matched your search
@@ -42,9 +42,10 @@ class DetailController extends AbstractController
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
// the other questionnaire of the same placement, e.g. the bus feedback beside the teamer feedback
|
||||
// the other responses of the same placement, e.g. the bus feedback beside the teamer feedback,
|
||||
// or the other leg's
|
||||
$siblings = array_filter(
|
||||
$this->responseRepository->findByDisposition($response->getDisposition()),
|
||||
array_merge(...array_values($this->responseRepository->findByDisposition($response->getDisposition()))),
|
||||
static fn (QuestionnaireResponse $sibling): bool => $sibling !== $response && $sibling->isSubmitted(),
|
||||
);
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use App\Config\QuestionnaireCatalog;
|
||||
use App\Controller\Traits\ReturnUrlTrait;
|
||||
use App\Entity\Assignment;
|
||||
use App\Form\QuestionnaireType;
|
||||
use App\Model\Questionnaire\Definition;
|
||||
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -54,10 +53,11 @@ class TestController extends AbstractController
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
if (QuestionnaireType::isFinal($form)) {
|
||||
$submitted = array_map(static fn (Definition $definition): array => [
|
||||
'definition' => $definition,
|
||||
'answers' => $definition->withoutHiddenAnswers($form->getData()[$definition->key] ?? []),
|
||||
], $definitions);
|
||||
$submitted = array_map(static fn (array $set): array => [
|
||||
'definition' => $set['definition'],
|
||||
'leg' => $set['leg'],
|
||||
'answers' => $set['definition']->withoutHiddenAnswers($set['answers']),
|
||||
], QuestionnaireType::answerSets($form->getData(), $definitions));
|
||||
} else {
|
||||
$draft = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user