diff --git a/.idea/db-forest-config.xml b/.idea/db-forest-config.xml
new file mode 100644
index 0000000..97ceafb
--- /dev/null
+++ b/.idea/db-forest-config.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/packages/maker.yaml b/config/packages/maker.yaml
new file mode 100644
index 0000000..aebcc27
--- /dev/null
+++ b/config/packages/maker.yaml
@@ -0,0 +1,6 @@
+# yaml-language-server: $schema=../../vendor/symfony/dependency-injection/Loader/schema/services.schema.json
+when@dev:
+ maker:
+ root_namespace: 'Tvdt'
+ generate_final_classes: true
+ generate_final_entities: false
diff --git a/src/Controller/Backoffice/QuizController.php b/src/Controller/Backoffice/QuizController.php
index c54c872..bc0dd7a 100644
--- a/src/Controller/Backoffice/QuizController.php
+++ b/src/Controller/Backoffice/QuizController.php
@@ -76,7 +76,7 @@ class QuizController extends AbstractController
{
try {
$this->quizRepository->clearQuiz($quiz);
- $this->addFlash('success', $this->translator->trans('Quiz cleared'));
+ $this->addFlash('success', $this->translator->trans('quiz cleared'));
} catch (ErrorClearingQuizException) {
$this->addFlash('error', $this->translator->trans('Error clearing quiz'));
}
@@ -94,7 +94,7 @@ class QuizController extends AbstractController
{
$this->quizRepository->deleteQuiz($quiz);
- $this->addFlash('success', $this->translator->trans('Quiz deleted'));
+ $this->addFlash('success', $this->translator->trans('quiz deleted'));
return $this->redirectToRoute('tvdt_backoffice_season', ['seasonCode' => $quiz->season->seasonCode]);
}
diff --git a/src/Controller/Backoffice/SeasonController.php b/src/Controller/Backoffice/SeasonController.php
index 198ca9a..0e76b52 100644
--- a/src/Controller/Backoffice/SeasonController.php
+++ b/src/Controller/Backoffice/SeasonController.php
@@ -105,7 +105,7 @@ class SeasonController extends AbstractController
$this->em->persist($quiz);
$this->em->flush();
- $this->addFlash(FlashType::Success, $this->translator->trans('Quiz Added!'));
+ $this->addFlash(FlashType::Success, $this->translator->trans('quiz Added!'));
return $this->redirectToRoute('tvdt_backoffice_season', ['seasonCode' => $season->seasonCode]);
}
diff --git a/src/Controller/QuizController.php b/src/Controller/QuizController.php
index 07412bf..d23d903 100644
--- a/src/Controller/QuizController.php
+++ b/src/Controller/QuizController.php
@@ -118,7 +118,7 @@ final class QuizController extends AbstractController
// Keep creating flash here based on the return type of service call
if (!$question instanceof Question) {
- $this->addFlash(FlashType::Success, $this->translator->trans('Quiz completed'));
+ $this->addFlash(FlashType::Success, $this->translator->trans('quiz completed'));
return $this->redirectToRoute('tvdt_quiz_enter_name', ['seasonCode' => $season->seasonCode]);
}
diff --git a/src/DataFixtures/KrtekFixtures.php b/src/DataFixtures/KrtekFixtures.php
index 29cfb9c..7442e5f 100644
--- a/src/DataFixtures/KrtekFixtures.php
+++ b/src/DataFixtures/KrtekFixtures.php
@@ -56,7 +56,7 @@ final class KrtekFixtures extends Fixture implements FixtureGroupInterface
private function createQuiz1(Season $season): Quiz
{
$quiz = new Quiz();
- $quiz->name = 'Quiz 1';
+ $quiz->name = 'quiz 1';
$quiz->season = $season;
$q = new Question();
@@ -223,7 +223,7 @@ final class KrtekFixtures extends Fixture implements FixtureGroupInterface
private function createQuiz2(Season $season): Quiz
{
$quiz = new Quiz();
- $quiz->name = 'Quiz 2';
+ $quiz->name = 'quiz 2';
$quiz->season = $season;
$q = new Question();
diff --git a/src/Form/UploadQuizFormType.php b/src/Form/UploadQuizFormType.php
index 71a163f..6408ab5 100644
--- a/src/Form/UploadQuizFormType.php
+++ b/src/Form/UploadQuizFormType.php
@@ -22,11 +22,11 @@ class UploadQuizFormType extends AbstractType
{
$builder
->add('name', TextType::class, [
- 'label' => $this->translator->trans('Quiz name'),
+ 'label' => $this->translator->trans('quiz name'),
'translation_domain' => false,
])
->add('sheet', FileType::class, [
- 'label' => $this->translator->trans('Quiz (xlsx)'),
+ 'label' => $this->translator->trans('quiz (xlsx)'),
'mapped' => false,
'required' => true,
'translation_domain' => false,
diff --git a/src/Repository/QuizCandidateRepository.php b/src/Repository/QuizCandidateRepository.php
index da50c62..9cb335f 100644
--- a/src/Repository/QuizCandidateRepository.php
+++ b/src/Repository/QuizCandidateRepository.php
@@ -38,7 +38,7 @@ class QuizCandidateRepository extends ServiceEntityRepository
{
$quizCandidate = $this->findOneBy(['candidate' => $candidate, 'quiz' => $quiz]);
if (!$quizCandidate instanceof QuizCandidate) {
- throw new \InvalidArgumentException('Quiz candidate not found');
+ throw new \InvalidArgumentException('quiz candidate not found');
}
$quizCandidate->corrections = $corrections;
@@ -49,7 +49,7 @@ class QuizCandidateRepository extends ServiceEntityRepository
{
$quizCandidate = $this->findOneBy(['candidate' => $candidate, 'quiz' => $quiz]);
if (!$quizCandidate instanceof QuizCandidate) {
- throw new \InvalidArgumentException('Quiz candidate not found');
+ throw new \InvalidArgumentException('quiz candidate not found');
}
$quizCandidate->penaltySeconds = $penalty;
diff --git a/templates/backoffice/index.html.twig b/templates/backoffice/index.html.twig
index 43afa5b..2ef1bfe 100644
--- a/templates/backoffice/index.html.twig
+++ b/templates/backoffice/index.html.twig
@@ -19,7 +19,7 @@
{{ 'Owner(s)'|trans }} |
{% endif %}
{{ 'Name'|trans }} |
- {{ 'Active Quiz'|trans }} |
+ {{ 'Active quiz'|trans }} |
{{ 'Season Code'|trans }} |
{{ 'Manage'|trans }} |
diff --git a/templates/backoffice/quiz.html.twig b/templates/backoffice/quiz.html.twig
index 4e7cc2e..f3cbc99 100644
--- a/templates/backoffice/quiz.html.twig
+++ b/templates/backoffice/quiz.html.twig
@@ -4,179 +4,38 @@
{% block body %}
{{ 'Quiz'|trans }}: {{ quiz.season.name }} - {{ quiz.name }}
-
-
-
-
{{ 'Questions'|trans }}
-
- {%~ for question in quiz.questions ~%}
-
-
-
-
-
- {%~ for answer in question.answers %}
- - {{ answer.text -}}
- {%~ else %}
- {{ 'There are no answers for this question'|trans -}}
- {%~ endfor %}
-
-
-
-
- {% else %}
- {{ 'EMPTY'|trans }}
- {% endfor %}
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ {% include 'backoffice/quiz/tab_overview.html.twig' %}
-
-
-
{{ 'Score'|trans }}
-
-
- {# Modal Clear #}
-
-
-
-
-
- {{ 'Are you sure you want to clear all the results? This will also delete al the eliminations.'|trans }}
-
-
-
-
-
-
- {# Modal Delete #}
-
-
-
-
-
- {{ 'Are you sure you want to delete this quiz?'|trans }}
-
-
-
+
+ {% include 'backoffice/quiz/tab_candidates.html.twig' %}
{% endblock %}
diff --git a/templates/backoffice/quiz/tab_candidates.html.twig b/templates/backoffice/quiz/tab_candidates.html.twig
new file mode 100644
index 0000000..f636145
--- /dev/null
+++ b/templates/backoffice/quiz/tab_candidates.html.twig
@@ -0,0 +1,5 @@
+{% for question in quiz.questions %}
+ {% for answer in question.answers %}
+ {{ answer.text }}
+ {% endfor %}
+{% endfor %}
diff --git a/templates/backoffice/quiz/tab_overview.html.twig b/templates/backoffice/quiz/tab_overview.html.twig
new file mode 100644
index 0000000..d114d26
--- /dev/null
+++ b/templates/backoffice/quiz/tab_overview.html.twig
@@ -0,0 +1,100 @@
+
Quick actions
+
+
+
+
{{ 'Questions'|trans }}
+
+ {%~ for question in quiz.questions ~%}
+
+
+
+
+
+ {%~ for answer in question.answers %}
+ - {{ answer.text -}}
+ {%~ else %}
+ {{ 'There are no answers for this question'|trans -}}
+ {%~ endfor %}
+
+
+
+
+ {% else %}
+ {{ 'EMPTY'|trans }}
+ {% endfor %}
+
+
+
+{# Modal Clear #}
+
+
+
+
+
+ {{ 'Are you sure you want to clear all the results? This will also delete al the eliminations.'|trans }}
+
+
+
+
+
+
+{# Modal Delete #}
+
+
+
+
+
+ {{ 'Are you sure you want to delete this quiz?'|trans }}
+
+
+
+
+
diff --git a/templates/backoffice/quiz/tab_result.html.twig b/templates/backoffice/quiz/tab_result.html.twig
new file mode 100644
index 0000000..e25a000
--- /dev/null
+++ b/templates/backoffice/quiz/tab_result.html.twig
@@ -0,0 +1,78 @@
+
+
{{ 'Score'|trans }}
+
+
{{ 'Number of dropouts:'|trans }} {{ quiz.dropouts }}
+
+
+
+ | {{ 'Candidate'|trans }} |
+ {{ 'Correct Answers'|trans }} |
+ {{ 'Corrections'|trans }} |
+ {{ 'Penalty'|trans }} |
+ {{ 'Score'|trans }} |
+ {{ 'Time'|trans }} |
+
+
+
+ {%~ for candidate in result ~%}
+
+ | {{ candidate.name }} |
+ {{ candidate.correct|default('0') }} |
+
+
+ |
+
+
+ |
+ {{ candidate.score|default('x') }} |
+ {{ candidate.time.format('%i:%S') }} |
+
+ {% else %}
+
+ | {{ 'No results'|trans }} |
+
+ {% endfor %}
+
+
+
diff --git a/templates/quiz/select_season.html.twig b/templates/quiz/select_season.html.twig
index d1c0e48..54ceca6 100644
--- a/templates/quiz/select_season.html.twig
+++ b/templates/quiz/select_season.html.twig
@@ -1,5 +1,5 @@
{% extends 'quiz/base.html.twig' %}
{% block body %}
{{ form(form) }}
-
{{ 'Manage Quiz'|trans }}
+
{{ 'Manage quiz'|trans }}
{% endblock body %}
diff --git a/tests/Repository/QuizRepositoryTest.php b/tests/Repository/QuizRepositoryTest.php
index 79f0ad9..df2886e 100644
--- a/tests/Repository/QuizRepositoryTest.php
+++ b/tests/Repository/QuizRepositoryTest.php
@@ -59,7 +59,7 @@ final class QuizRepositoryTest extends DatabaseTestCase
$quiz = $krtekSeason->activeQuiz;
$this->assertInstanceOf(Quiz::class, $quiz);
- // Start Quiz
+ // Start quiz
$qc = new QuizCandidate($quiz, $candidate);
$this->entityManager->persist($qc);
$this->entityManager->flush();
diff --git a/tests/Security/Voter/SeasonVoterTest.php b/tests/Security/Voter/SeasonVoterTest.php
index e882af7..c53c8f7 100644
--- a/tests/Security/Voter/SeasonVoterTest.php
+++ b/tests/Security/Voter/SeasonVoterTest.php
@@ -62,7 +62,7 @@ final class SeasonVoterTest extends TestCase
$quiz = self::createStub(Quiz::class);
$quiz->season = $season;
- yield 'Quiz' => [$quiz];
+ yield 'quiz' => [$quiz];
$elimination = self::createStub(Elimination::class);
$elimination->quiz = $quiz;
diff --git a/translations/messages+intl-icu.nl.xliff b/translations/messages+intl-icu.nl.xliff
index 2a5baab..8a4a753 100644
--- a/translations/messages+intl-icu.nl.xliff
+++ b/translations/messages+intl-icu.nl.xliff
@@ -5,9 +5,9 @@
-
- Active Quiz
- Actieve test
+
+ Active quiz
+ Actieve Test
Add
@@ -85,13 +85,13 @@
Create an account
Maak een account aan
-
- Deactivate Quiz
- Deactiveer test
+
+ Deactivate quiz
+ Deactiveer Test
-
- Delete Quiz...
- Test verwijderen...
+
+ Delete quiz...
+ Verwijder test...
Download Template
@@ -141,22 +141,22 @@
Manage
Beheren
-
- Manage Quiz
+
+ Manage quiz
Beheer test
Name
Naam
-
- No
- Nee
-
Next
Volgende
+
+ No
+ Nee
+
No active quiz
Geen actieve test
@@ -169,6 +169,10 @@
Number of dropouts:
Aantal afvallers:
+
+ Overview
+ Overzicht
+
Owner(s)
Eigena(a)r(en)
@@ -177,6 +181,10 @@
Password
Wachtwoord
+
+ Penalty
+ Straf
+
Please Confirm
Bevestig Alsjeblieft
@@ -205,30 +213,6 @@
Quiz
Test
-
- Quiz (xlsx)
- Test (xlsx)
-
-
- Quiz Added!
- Test toegevoegd!
-
-
- Quiz cleared
- Test leeggemaakt
-
-
- Quiz completed
- Test voltooid
-
-
- Quiz deleted
- Test verwijderd
-
-
- Quiz name
- Testnaam
-
Quizzes
Tests
@@ -249,6 +233,10 @@
Repeat Password
Herhaal wachtwoord
+
+ Results & Elimination
+
+
Save
Opslaan
@@ -321,6 +309,30 @@
Your email address has been verified.
Je e-mailadres is geverifieerd.
+
+ quiz (xlsx)
+ test (xlsx)
+
+
+ quiz Added!
+ test toegevoegd!
+
+
+ quiz cleared
+ test geleegd
+
+
+ quiz completed
+ test voltooid
+
+
+ quiz deleted
+ test verwijderd
+
+
+ quiz name
+ test name
+