Commit Graph

28 Commits

Author SHA1 Message Date
Marijn 9008f128a6 fix: address PR review feedback on help texts and translations
- Replace 'speelronde' with 'spel' in index and season_add help
- Season settings help: remove incorrect claim name is editable, describe
  actual settings (Show Numbers, Confirm Answers)
- quiz_add help: rename 'XLSX-bestand' to 'Excel-bestand', add explanation
  of WAAR/ONWAAR (Dutch Excel) vs TRUE/FALSE (English Excel) for marking
  the correct answer
- quiz_answer_mapping help: remove em-dashes
- quiz_candidates help: clarify that multiple devices and mixed setups
  (multiple laptops, phones, or a mix) are supported
- quiz_question_bank_form help: change 'thema' to 'type vraag' for labels
- Rename 'Add from XLSX' to 'Import' in translation and template
2026-07-05 10:28:18 +02:00
Marijn 052268e042 refactor: move help content out of translations into locale-specific partials
Replace the instructions translation domain with plain HTML files under
templates/backoffice/help/nl/. Each help/*.html.twig is now a locale
dispatch shim that tries the current locale first and falls back to nl,
so adding English (or any other language) is simply a matter of creating
a help/en/ directory with the translated files — no code changes needed.

Removes instructions+intl-icu.nl.xliff.
2026-07-04 23:18:27 +02:00
Marijn 482ca8be7e feat: add contextual help panels to all backoffice pages
Add a 50/50 or 66/33 split layout to every backoffice page with Dutch
instructions explaining how to use Tijd voor de Test. Content covers the
overall workflow, quiz finalize/activate flow, and both candidate
participation methods (own device vs. shared laptop).

Help text lives in dedicated partials under templates/backoffice/help/ and
is loaded via Twig include(), keeping page templates clean. All strings use
a separate 'instructions' translation domain (instructions+intl-icu.nl.xliff)
isolated from the main messages domain.

Also updates 'Finalize'-related Dutch translations to use 'Afronden' and
adds tooltips to the finalize/unfinalize buttons.
2026-07-04 23:10:12 +02:00
Marijn f6988f4d77 fix: crash on empty-quiz overview and answer-mapping, use FlashType enum consistently
- fetchWithQuestionsAndCandidates / fetchWithQuestions used INNER JOINs on
  questions/answers, so quizzes with no questions threw NoResultException (500)
  when opening the overview tab. Switched to LEFT JOINs.
- answerMapping bare \assert() replaced with a proper flash + redirect when
  the quiz has no questions, instead of crashing with AssertionError.
- Three raw 'success' flash strings in QuizController replaced with FlashType::Success.
- Added Dutch translation for "This quiz has no questions yet".
- Two new tests: empty-quiz overview loads (200), answer-mapping redirects with flash.
2026-07-04 22:44:33 +02:00
Marijn 8304d8680b feat: address PR review comments — unassign/sync bank questions, blank quiz creation, deactivate redirect, remove duplicate tab titles
- Use Symfony ObjectMapper for BankQuestion/BankAnswer → Question/Answer copy (#[Map(if: false)] on id, season, etc.)
- Track created Question on BankQuestionUsage (nullable FK, onDelete: SET NULL) for unassign/sync support
- Add unassign route: removes the Question copy + usage record
- Add sync route: pushes bank question edits to a finalized-not-started quiz copy
- Auto-sync non-finalized quiz copies on bank question edit; flash warning for finalized-not-started
- Add blank quiz creation (no XLSX required) with new route + template
- Deactivate quiz button now stays on the quiz overview page (redirect_quiz hidden field)
- Remove duplicate h4 titles below the tab bar on all season tabs
- Add migration for bank_question_usage.question_id
- Add Dutch translations for all new strings
2026-07-04 21:54:44 +02:00
Marijn f05f88bcc5 chore: add symfony/object-mapper dependency and fix Finalized translation 2026-07-04 21:32:47 +02:00
Marijn c34c25dff7 feat: add question bank management, quiz finalization, and related backend/frontend functionality 2026-07-04 20:10:03 +02:00
Marijn 281462fab8 Added Gedmo stuff, fix translations (#117)
* Added Gedmo stuff, fix translations

* Add CSRF token validation across backoffice forms

- Added CSRF validations to candidate correction, penalty, answer saving, and elimination forms.
- Updated corresponding Twig templates to include CSRF token inputs.
- Adjusted column count in `tab_result` template to maintain layout consistency.

* Add unique index constraint for `quiz_candidate` with soft delete support

- Updated migration to include a unique index on `quiz_candidate` table that excludes soft-deleted records.
- Adjusted `QuizCandidate` entity to reflect the new unique constraint with `deleted_at` condition.

* Add CSRF token validation for quiz-related actions

- Added CSRF validation to `enableQuiz`, `clearQuiz`, `deleteQuiz`, `toggleCandidate`, and `prepareElimination` actions.
- Updated Twig templates to replace links with POST forms to include CSRF tokens.
- Set HTTP method restrictions for related endpoints to `POST`.

* Fix unique index condition for `quiz_candidate` with soft deletes

- Updated condition in unique index definition of `quiz_candidate` to add parentheses for clarity.
- Adjusted related migration to reflect the revised condition.

* Remove if for post an use methods in Route instead

* Refactor CSRF token validation in backoffice controllers

- Applied `#[IsCsrfTokenValid]` attribute for CSRF checks to simplify and standardize validation.
- Removed manual `isCsrfTokenValid` calls and associated exception throwing.
- Updated method signatures across affected endpoints to remove unnecessary `Request` dependency.
- Ensured consistency in route HTTP method restrictions where applicable.

* Add rector and phpstan

* Add validation for answering incorrect quiz question

- Added logic to prevent candidates from answering questions out of sequence in `QuizController`.
- Updated Dutch translations to include the new error message.

* Things
2026-05-24 19:43:30 +02:00
Marijn 55bbe962c1 Fix/answer without selected (#104)
* Fix a bug when click clicking next

* Disable autocomplete for name
2026-05-21 20:19:18 +02:00
Marijn 18a6090366 Answer on candidate (#72)
* Add Penalty Seconds on tests

* Refactors and start of candidate answer relation

* Add breadcrumbs and UI consistency updates across backoffice templates

* Add breadcrumbs and UI consistency updates across backoffice templates

* Add Dutch translations for email verification and security messages

* Rector

* Refactor for code consistency and type safety assertions across repositories and entities

* Refactor candidate-related logic to optimize queries, improve template separation, and add "Answer Mapping" functionality.

* Cleanup

* Update Symfony

* Add coderabbit config

* Fixes from coderabbit
2026-03-22 22:40:25 +01:00
Marijn 7586d2d8ac Merge branch 'main' of github.com:MarijnDoeve/TijdVoorDeTest 2025-06-11 18:27:04 +02:00
Marijn 9e41376244 Translations! 2025-06-11 18:26:17 +02:00
Marijn 2bfef94bbe Add settings management for seasons, update templates, migrations, and commands 2025-06-10 23:06:59 +02:00
Marijn 366bc36520 Fix typo 2025-06-07 23:47:58 +02:00
Marijn 6a77df402d Add quiz clearing and deletion functionality with UI enhancements
This commit introduces the ability to clear quiz results and delete quizzes directly from the backoffice. It includes new routes, controllers, modals for user confirmation, and updates to translations. The `QuizRepository` now supports dedicated methods for clearing results and deleting quizzes along with error handling. Related database migrations and front-end adjustments are also included.
2025-06-07 20:59:01 +02:00
Marijn c6f9b57c60 Refactor translations to XLIFF format, enhance elimination workflows, and update compose configuration
This commit switches translations from YAML to XLIFF format for better standardization, updates the elimination preparation process with UI and functionality improvements, tweaks form structures, adjusts compose.override.yaml for improved asset handling, and optimizes back office usability with refined translation handling.
2025-06-01 21:28:56 +02:00
Marijn 25aa8b8622 Introduce importmap, enhance elimination workflows, and update assets
This commit adds initial importmap configuration to manage assets, updates the elimination preparation workflow with form enhancements and database changes, introduces new styles and JS assets, refines translations, and improves entity handling with an input bag update method.
2025-06-01 15:40:47 +02:00
Marijn d3e5cb0569 Refactor elimination feature and improve backoffice usability
This commit introduces a refactored EliminationFactory for better modularity, updates the elimination preparation process, and adds functionality to view eliminations. Backoffice templates and forms have been reorganized, minor translations were corrected, and additional assets like styles and flashes were included for enhanced user experience.
2025-06-01 15:40:47 +02:00
Marijn e0350c8c31 WIP 2025-06-01 15:40:47 +02:00
Marijn 49b7c0f5d5 Add Sheet upload function 2025-04-28 23:01:37 +02:00
Marijn 4712c01688 Add quiz management features and improve UI 2025-04-23 23:23:22 +02:00
Marijn 0f07e7eabf Phpstan 2025-04-22 23:42:07 +02:00
Marijn 66b57ea84a Secure admin 2025-04-21 19:12:48 +02:00
Marijn 057bc778ed Fixes 2025-04-21 18:03:54 +02:00
Marijn 4bcab2724a Implement email verification feature, add registration form, and update user entity for verification status 2025-04-20 19:34:27 +02:00
Marijn acf5c06fcc Refactor code for improved readability and consistency; add flash message handling and enhance quiz functionality
CI / Tests (push) Failing after 9s
CI / Docker Lint (push) Successful in 4s
2025-03-12 23:18:13 +01:00
Marijn 448daed6ea wip 12-03-2025
CI / Tests (push) Failing after 11s
CI / Docker Lint (push) Successful in 3s
2025-03-12 09:28:36 +01:00
Marijn 451d117d9e WIP 3-3 2025-03-04 08:15:50 +01:00