mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-07-07 16:10:15 +02:00
Cleanup
This commit is contained in:
@@ -0,0 +1,69 @@
|
|||||||
|
# Agent Guide: Tijd Voor De Test (Tvdt)
|
||||||
|
|
||||||
|
This document provides essential context and instructions for AI agents working on the **Tijd Voor De Test** project.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
A web application for managing "Wie is de Mol?" style tests, including seasons, quizzes, candidates, and eliminations.
|
||||||
|
|
||||||
|
- **Namespace**: `Tvdt`
|
||||||
|
- **PHP Version**: 8.5+
|
||||||
|
- **Framework**: Symfony 8.0
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
- **Server**: FrankenPHP (Caddy-based PHP server)
|
||||||
|
- **Database**: PostgreSQL
|
||||||
|
- **Frontend**: Symfony Asset Mapper (no Node.js/Webpack), Stimulus, Turbo
|
||||||
|
- **Styling**: Sass (via `symfonycasts/sass-bundle`)
|
||||||
|
- **Persistence**: Doctrine ORM 3.x
|
||||||
|
|
||||||
|
## Core Domain Entities
|
||||||
|
- **Season**: Groups quizzes and candidates for a specific period.
|
||||||
|
- **SeasonSettings**: Configuration for a season.
|
||||||
|
- **Quiz**: A test within a season containing multiple questions.
|
||||||
|
- **Question**: Questions belonging to a quiz.
|
||||||
|
- **Answer**: Possible answers for a question.
|
||||||
|
- **Candidate**: A participant in the season.
|
||||||
|
- **QuizCandidate**: Represents a candidate's attempt at a specific quiz (tracking start/end time).
|
||||||
|
- **GivenAnswer**: The specific answer a candidate selected during a quiz.
|
||||||
|
- **Elimination**: Records of red/green screens and forced results.
|
||||||
|
- **User**: Administrative accounts for managing the system.
|
||||||
|
|
||||||
|
## Development Workflow
|
||||||
|
The project uses `just` as the primary task runner. Always prefer `just` commands over manual docker calls.
|
||||||
|
|
||||||
|
### Common Commands
|
||||||
|
- `just up`: Start the environment.
|
||||||
|
- `just down`: Stop the environment.
|
||||||
|
- `just shell`: Enter the PHP container.
|
||||||
|
- `just migrate`: Run database migrations.
|
||||||
|
- `just fixtures`: Load development fixtures.
|
||||||
|
- `just fix-cs`: Run `php-cs-fixer` and `twig-cs-fixer`.
|
||||||
|
- `just phpstan`: Run static analysis.
|
||||||
|
- `just rector`: Run Rector for automated refactorings.
|
||||||
|
- `just reload-tests`: Reset the test database and load test fixtures.
|
||||||
|
|
||||||
|
## Coding Standards
|
||||||
|
- **PSR-12**: Follow standard PHP coding styles.
|
||||||
|
- **Strict Typing**: Use strict types in all PHP files.
|
||||||
|
- **Doctrine ORM 3**: Be aware of ORM 3 changes (e.g., lazy loading behavior, attribute-based mapping).
|
||||||
|
- **Symfony 8**: Use modern Symfony features (Attributes, Type-hinting).
|
||||||
|
- **Safe Functions**: Use `thecodingmachine/safe` for standard PHP functions that throw exceptions instead of returning false.
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
- **Framework**: PHPUnit
|
||||||
|
- **Bundle**: `dama/doctrine-test-bundle` is used to wrap tests in transactions.
|
||||||
|
- **Location**: `tests/` directory mirroring `src/`.
|
||||||
|
- **Execution**: Run via `bin/phpunit` inside the container or `just reload-tests` to prepare the environment.
|
||||||
|
|
||||||
|
## Frontend Development
|
||||||
|
- JavaScript is managed via **Import Maps**.
|
||||||
|
- Stimulus controllers are located in `assets/controllers/`.
|
||||||
|
- CSS/Sass is in `assets/styles/`.
|
||||||
|
- Assets are compiled on-the-fly or mapped; do not look for a `node_modules` folder.
|
||||||
|
|
||||||
|
## Key Files
|
||||||
|
- `composer.json`: Dependency management.
|
||||||
|
- `importmap.php`: JavaScript module mapping.
|
||||||
|
- `Justfile`: Automation shortcuts.
|
||||||
|
- `config/`: Application configuration.
|
||||||
|
- `templates/`: Twig templates.
|
||||||
@@ -35,6 +35,9 @@ rector *args:
|
|||||||
phpstan *args:
|
phpstan *args:
|
||||||
docker compose exec php vendor/bin/phpstan analyse {{ args }}
|
docker compose exec php vendor/bin/phpstan analyse {{ args }}
|
||||||
|
|
||||||
|
test *args:
|
||||||
|
docker compose exec php vendor/bin/phpunit {{ args }}
|
||||||
|
|
||||||
[confirm]
|
[confirm]
|
||||||
clean:
|
clean:
|
||||||
docker compose down -v --remove-orphans
|
docker compose down -v --remove-orphans
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
import './stimulus.js';
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||||
import './bootstrap.js'
|
|
||||||
import './styles/backoffice.scss';
|
import './styles/backoffice.scss';
|
||||||
|
import './stimulus.js';
|
||||||
|
import './bootstrap.js';
|
||||||
|
|||||||
Vendored
-1
@@ -1,2 +1 @@
|
|||||||
import * as bootstrap from 'bootstrap'
|
import * as bootstrap from 'bootstrap'
|
||||||
import 'bootstrap/dist/css/bootstrap.min.css'
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"controllers": {
|
"controllers": {
|
||||||
"@symfony/ux-turbo": {
|
"@symfony/ux-turbo": {
|
||||||
"turbo-core": {
|
"turbo-core": {
|
||||||
"enabled": false,
|
"enabled": true,
|
||||||
"fetch": "eager"
|
"fetch": "eager"
|
||||||
},
|
},
|
||||||
"mercure-turbo-stream": {
|
"mercure-turbo-stream": {
|
||||||
|
|||||||
@@ -1,17 +1,28 @@
|
|||||||
import {Controller} from '@hotwired/stimulus';
|
import {Controller} from '@hotwired/stimulus';
|
||||||
import * as bootstrap from 'bootstrap'
|
import {Tooltip, Modal} from 'bootstrap';
|
||||||
|
|
||||||
export default class extends Controller {
|
export default class extends Controller {
|
||||||
|
static targets = ['clearModal', 'deleteModal'];
|
||||||
|
|
||||||
connect() {
|
connect() {
|
||||||
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
this.tooltips = [];
|
||||||
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
|
const tooltipTriggerList = this.element.querySelectorAll('[data-bs-toggle="tooltip"]');
|
||||||
|
[...tooltipTriggerList].forEach(tooltipTriggerEl => {
|
||||||
|
this.tooltips.push(Tooltip.getOrCreateInstance(tooltipTriggerEl));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnect() {
|
||||||
|
this.tooltips.forEach(tooltip => tooltip.dispose());
|
||||||
}
|
}
|
||||||
|
|
||||||
clearQuiz() {
|
clearQuiz() {
|
||||||
new bootstrap.Modal('#clearQuizModal').show();
|
const modal = Modal.getOrCreateInstance(this.clearModalTarget);
|
||||||
|
modal.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteQuiz() {
|
deleteQuiz() {
|
||||||
new bootstrap.Modal('#deleteQuizModal').show();
|
const modal = Modal.getOrCreateInstance(this.deleteModalTarget);
|
||||||
|
modal.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,13 @@ import {Controller} from '@hotwired/stimulus';
|
|||||||
|
|
||||||
export default class extends Controller {
|
export default class extends Controller {
|
||||||
next() {
|
next() {
|
||||||
const currentUrl = window.location.href;
|
const currentUrl = new URL(window.location.href);
|
||||||
const urlParts = currentUrl.split('/');
|
const pathParts = currentUrl.pathname.split('/');
|
||||||
urlParts.pop();
|
// Remove the last segment
|
||||||
window.location.href = urlParts.join('/');
|
pathParts.pop();
|
||||||
|
// Update the pathname
|
||||||
|
currentUrl.pathname = pathParts.join('/');
|
||||||
|
// Navigate
|
||||||
|
window.location.href = currentUrl.href;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||||
|
import './styles/quiz.scss';
|
||||||
import './stimulus.js';
|
import './stimulus.js';
|
||||||
import './bootstrap.js'
|
import './bootstrap.js';
|
||||||
import './styles/quiz.scss'
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
"roave/security-advisories": "dev-latest",
|
"roave/security-advisories": "dev-latest",
|
||||||
"symfony/browser-kit": "8.0.*",
|
"symfony/browser-kit": "8.0.*",
|
||||||
"symfony/css-selector": "8.0.*",
|
"symfony/css-selector": "8.0.*",
|
||||||
"symfony/maker-bundle": "^1.65.1",
|
"symfony/maker-bundle": "^1.66.0",
|
||||||
"symfony/phpunit-bridge": "8.0.*",
|
"symfony/phpunit-bridge": "8.0.*",
|
||||||
"symfony/stopwatch": "8.0.*",
|
"symfony/stopwatch": "8.0.*",
|
||||||
"symfony/web-profiler-bundle": "8.0.*",
|
"symfony/web-profiler-bundle": "8.0.*",
|
||||||
|
|||||||
Generated
+239
-237
File diff suppressed because it is too large
Load Diff
Generated
+39
-36
@@ -208,29 +208,29 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* initial_marking?: list<scalar|Param|null>,
|
* initial_marking?: list<scalar|Param|null>,
|
||||||
* events_to_dispatch?: list<string|Param>|null,
|
* events_to_dispatch?: list<string|Param>|null,
|
||||||
* places?: list<array{ // Default: []
|
* places?: list<array{ // Default: []
|
||||||
* name: scalar|Param|null,
|
* name?: scalar|Param|null,
|
||||||
* metadata?: list<mixed>,
|
* metadata?: array<string, mixed>,
|
||||||
* }>,
|
* }>,
|
||||||
* transitions: list<array{ // Default: []
|
* transitions?: list<array{ // Default: []
|
||||||
* name: string|Param,
|
* name?: string|Param,
|
||||||
* guard?: string|Param, // An expression to block the transition.
|
* guard?: string|Param, // An expression to block the transition.
|
||||||
* from?: list<array{ // Default: []
|
* from?: list<array{ // Default: []
|
||||||
* place: string|Param,
|
* place?: string|Param,
|
||||||
* weight?: int|Param, // Default: 1
|
* weight?: int|Param, // Default: 1
|
||||||
* }>,
|
* }>,
|
||||||
* to?: list<array{ // Default: []
|
* to?: list<array{ // Default: []
|
||||||
* place: string|Param,
|
* place?: string|Param,
|
||||||
* weight?: int|Param, // Default: 1
|
* weight?: int|Param, // Default: 1
|
||||||
* }>,
|
* }>,
|
||||||
* weight?: int|Param, // Default: 1
|
* weight?: int|Param, // Default: 1
|
||||||
* metadata?: list<mixed>,
|
* metadata?: array<string, mixed>,
|
||||||
* }>,
|
* }>,
|
||||||
* metadata?: list<mixed>,
|
* metadata?: array<string, mixed>,
|
||||||
* }>,
|
* }>,
|
||||||
* },
|
* },
|
||||||
* router?: bool|array{ // Router configuration
|
* router?: bool|array{ // Router configuration
|
||||||
* enabled?: bool|Param, // Default: false
|
* enabled?: bool|Param, // Default: false
|
||||||
* resource: scalar|Param|null,
|
* resource?: scalar|Param|null,
|
||||||
* type?: scalar|Param|null,
|
* type?: scalar|Param|null,
|
||||||
* default_uri?: scalar|Param|null, // The default URI used to generate URLs in a non-HTTP context. // Default: null
|
* default_uri?: scalar|Param|null, // The default URI used to generate URLs in a non-HTTP context. // Default: null
|
||||||
* http_port?: scalar|Param|null, // Default: 80
|
* http_port?: scalar|Param|null, // Default: 80
|
||||||
@@ -353,10 +353,10 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* mapping?: array{
|
* mapping?: array{
|
||||||
* paths?: list<scalar|Param|null>,
|
* paths?: list<scalar|Param|null>,
|
||||||
* },
|
* },
|
||||||
* default_context?: list<mixed>,
|
* default_context?: array<string, mixed>,
|
||||||
* named_serializers?: array<string, array{ // Default: []
|
* named_serializers?: array<string, array{ // Default: []
|
||||||
* name_converter?: scalar|Param|null,
|
* name_converter?: scalar|Param|null,
|
||||||
* default_context?: list<mixed>,
|
* default_context?: array<string, mixed>,
|
||||||
* include_built_in_normalizers?: bool|Param, // Whether to include the built-in normalizers // Default: true
|
* include_built_in_normalizers?: bool|Param, // Whether to include the built-in normalizers // Default: true
|
||||||
* include_built_in_encoders?: bool|Param, // Whether to include the built-in encoders // Default: true
|
* include_built_in_encoders?: bool|Param, // Whether to include the built-in encoders // Default: true
|
||||||
* }>,
|
* }>,
|
||||||
@@ -420,7 +420,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* },
|
* },
|
||||||
* messenger?: bool|array{ // Messenger configuration
|
* messenger?: bool|array{ // Messenger configuration
|
||||||
* enabled?: bool|Param, // Default: false
|
* enabled?: bool|Param, // Default: false
|
||||||
* routing?: array<string, array{ // Default: []
|
* routing?: array<string, string|array{ // Default: []
|
||||||
* senders?: list<scalar|Param|null>,
|
* senders?: list<scalar|Param|null>,
|
||||||
* }>,
|
* }>,
|
||||||
* serializer?: array{
|
* serializer?: array{
|
||||||
@@ -433,7 +433,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* transports?: array<string, string|array{ // Default: []
|
* transports?: array<string, string|array{ // Default: []
|
||||||
* dsn?: scalar|Param|null,
|
* dsn?: scalar|Param|null,
|
||||||
* serializer?: scalar|Param|null, // Service id of a custom serializer to use. // Default: null
|
* serializer?: scalar|Param|null, // Service id of a custom serializer to use. // Default: null
|
||||||
* options?: list<mixed>,
|
* options?: array<string, mixed>,
|
||||||
* failure_transport?: scalar|Param|null, // Transport name to send failed messages to (after all retries have failed). // Default: null
|
* failure_transport?: scalar|Param|null, // Transport name to send failed messages to (after all retries have failed). // Default: null
|
||||||
* retry_strategy?: string|array{
|
* retry_strategy?: string|array{
|
||||||
* service?: scalar|Param|null, // Service id to override the retry strategy entirely. // Default: null
|
* service?: scalar|Param|null, // Service id to override the retry strategy entirely. // Default: null
|
||||||
@@ -455,7 +455,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* allow_no_senders?: bool|Param, // Default: true
|
* allow_no_senders?: bool|Param, // Default: true
|
||||||
* },
|
* },
|
||||||
* middleware?: list<string|array{ // Default: []
|
* middleware?: list<string|array{ // Default: []
|
||||||
* id: scalar|Param|null,
|
* id?: scalar|Param|null,
|
||||||
* arguments?: list<mixed>,
|
* arguments?: list<mixed>,
|
||||||
* }>,
|
* }>,
|
||||||
* }>,
|
* }>,
|
||||||
@@ -627,7 +627,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* lock_factory?: scalar|Param|null, // The service ID of the lock factory used by this limiter (or null to disable locking). // Default: "auto"
|
* lock_factory?: scalar|Param|null, // The service ID of the lock factory used by this limiter (or null to disable locking). // Default: "auto"
|
||||||
* cache_pool?: scalar|Param|null, // The cache pool to use for storing the current limiter state. // Default: "cache.rate_limiter"
|
* cache_pool?: scalar|Param|null, // The cache pool to use for storing the current limiter state. // Default: "cache.rate_limiter"
|
||||||
* storage_service?: scalar|Param|null, // The service ID of a custom storage implementation, this precedes any configured "cache_pool". // Default: null
|
* storage_service?: scalar|Param|null, // The service ID of a custom storage implementation, this precedes any configured "cache_pool". // Default: null
|
||||||
* policy: "fixed_window"|"token_bucket"|"sliding_window"|"compound"|"no_limit"|Param, // The algorithm to be used by this limiter.
|
* policy?: "fixed_window"|"token_bucket"|"sliding_window"|"compound"|"no_limit"|Param, // The algorithm to be used by this limiter.
|
||||||
* limiters?: list<scalar|Param|null>,
|
* limiters?: list<scalar|Param|null>,
|
||||||
* limit?: int|Param, // The maximum allowed hits in a fixed interval or burst.
|
* limit?: int|Param, // The maximum allowed hits in a fixed interval or burst.
|
||||||
* interval?: scalar|Param|null, // Configures the fixed interval if "policy" is set to "fixed_window" or "sliding_window". The value must be a number followed by "second", "minute", "hour", "day", "week" or "month" (or their plural equivalent).
|
* interval?: scalar|Param|null, // Configures the fixed interval if "policy" is set to "fixed_window" or "sliding_window". The value must be a number followed by "second", "minute", "hour", "day", "week" or "month" (or their plural equivalent).
|
||||||
@@ -672,7 +672,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* enabled?: bool|Param, // Default: false
|
* enabled?: bool|Param, // Default: false
|
||||||
* message_bus?: scalar|Param|null, // The message bus to use. // Default: "messenger.default_bus"
|
* message_bus?: scalar|Param|null, // The message bus to use. // Default: "messenger.default_bus"
|
||||||
* routing?: array<string, array{ // Default: []
|
* routing?: array<string, array{ // Default: []
|
||||||
* service: scalar|Param|null,
|
* service?: scalar|Param|null,
|
||||||
* secret?: scalar|Param|null, // Default: ""
|
* secret?: scalar|Param|null, // Default: ""
|
||||||
* }>,
|
* }>,
|
||||||
* },
|
* },
|
||||||
@@ -687,7 +687,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* dbal?: array{
|
* dbal?: array{
|
||||||
* default_connection?: scalar|Param|null,
|
* default_connection?: scalar|Param|null,
|
||||||
* types?: array<string, string|array{ // Default: []
|
* types?: array<string, string|array{ // Default: []
|
||||||
* class: scalar|Param|null,
|
* class?: scalar|Param|null,
|
||||||
* }>,
|
* }>,
|
||||||
* driver_schemes?: array<string, scalar|Param|null>,
|
* driver_schemes?: array<string, scalar|Param|null>,
|
||||||
* connections?: array<string, array{ // Default: []
|
* connections?: array<string, array{ // Default: []
|
||||||
@@ -858,7 +858,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* datetime_functions?: array<string, scalar|Param|null>,
|
* datetime_functions?: array<string, scalar|Param|null>,
|
||||||
* },
|
* },
|
||||||
* filters?: array<string, string|array{ // Default: []
|
* filters?: array<string, string|array{ // Default: []
|
||||||
* class: scalar|Param|null,
|
* class?: scalar|Param|null,
|
||||||
* enabled?: bool|Param, // Default: false
|
* enabled?: bool|Param, // Default: false
|
||||||
* parameters?: array<string, mixed>,
|
* parameters?: array<string, mixed>,
|
||||||
* }>,
|
* }>,
|
||||||
@@ -959,7 +959,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* providers?: list<scalar|Param|null>,
|
* providers?: list<scalar|Param|null>,
|
||||||
* },
|
* },
|
||||||
* entity?: array{
|
* entity?: array{
|
||||||
* class: scalar|Param|null, // The full entity class name of your user class.
|
* class?: scalar|Param|null, // The full entity class name of your user class.
|
||||||
* property?: scalar|Param|null, // Default: null
|
* property?: scalar|Param|null, // Default: null
|
||||||
* manager_name?: scalar|Param|null, // Default: null
|
* manager_name?: scalar|Param|null, // Default: null
|
||||||
* },
|
* },
|
||||||
@@ -970,8 +970,8 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* }>,
|
* }>,
|
||||||
* },
|
* },
|
||||||
* ldap?: array{
|
* ldap?: array{
|
||||||
* service: scalar|Param|null,
|
* service?: scalar|Param|null,
|
||||||
* base_dn: scalar|Param|null,
|
* base_dn?: scalar|Param|null,
|
||||||
* search_dn?: scalar|Param|null, // Default: null
|
* search_dn?: scalar|Param|null, // Default: null
|
||||||
* search_password?: scalar|Param|null, // Default: null
|
* search_password?: scalar|Param|null, // Default: null
|
||||||
* extra_fields?: list<scalar|Param|null>,
|
* extra_fields?: list<scalar|Param|null>,
|
||||||
@@ -982,7 +982,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* password_attribute?: scalar|Param|null, // Default: null
|
* password_attribute?: scalar|Param|null, // Default: null
|
||||||
* },
|
* },
|
||||||
* }>,
|
* }>,
|
||||||
* firewalls: array<string, array{ // Default: []
|
* firewalls?: array<string, array{ // Default: []
|
||||||
* pattern?: scalar|Param|null,
|
* pattern?: scalar|Param|null,
|
||||||
* host?: scalar|Param|null,
|
* host?: scalar|Param|null,
|
||||||
* methods?: list<scalar|Param|null>,
|
* methods?: list<scalar|Param|null>,
|
||||||
@@ -1040,9 +1040,9 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* user?: scalar|Param|null, // Default: "REMOTE_USER"
|
* user?: scalar|Param|null, // Default: "REMOTE_USER"
|
||||||
* },
|
* },
|
||||||
* login_link?: array{
|
* login_link?: array{
|
||||||
* check_route: scalar|Param|null, // Route that will validate the login link - e.g. "app_login_link_verify".
|
* check_route?: scalar|Param|null, // Route that will validate the login link - e.g. "app_login_link_verify".
|
||||||
* check_post_only?: scalar|Param|null, // If true, only HTTP POST requests to "check_route" will be handled by the authenticator. // Default: false
|
* check_post_only?: scalar|Param|null, // If true, only HTTP POST requests to "check_route" will be handled by the authenticator. // Default: false
|
||||||
* signature_properties: list<scalar|Param|null>,
|
* signature_properties?: list<scalar|Param|null>,
|
||||||
* lifetime?: int|Param, // The lifetime of the login link in seconds. // Default: 600
|
* lifetime?: int|Param, // The lifetime of the login link in seconds. // Default: 600
|
||||||
* max_uses?: int|Param, // Max number of times a login link can be used - null means unlimited within lifetime. // Default: null
|
* max_uses?: int|Param, // Max number of times a login link can be used - null means unlimited within lifetime. // Default: null
|
||||||
* used_link_cache?: scalar|Param|null, // Cache service id used to expired links of max_uses is set.
|
* used_link_cache?: scalar|Param|null, // Cache service id used to expired links of max_uses is set.
|
||||||
@@ -1144,13 +1144,13 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* failure_handler?: scalar|Param|null,
|
* failure_handler?: scalar|Param|null,
|
||||||
* realm?: scalar|Param|null, // Default: null
|
* realm?: scalar|Param|null, // Default: null
|
||||||
* token_extractors?: list<scalar|Param|null>,
|
* token_extractors?: list<scalar|Param|null>,
|
||||||
* token_handler: string|array{
|
* token_handler?: string|array{
|
||||||
* id?: scalar|Param|null,
|
* id?: scalar|Param|null,
|
||||||
* oidc_user_info?: string|array{
|
* oidc_user_info?: string|array{
|
||||||
* base_uri: scalar|Param|null, // Base URI of the userinfo endpoint on the OIDC server, or the OIDC server URI to use the discovery (require "discovery" to be configured).
|
* base_uri?: scalar|Param|null, // Base URI of the userinfo endpoint on the OIDC server, or the OIDC server URI to use the discovery (require "discovery" to be configured).
|
||||||
* discovery?: array{ // Enable the OIDC discovery.
|
* discovery?: array{ // Enable the OIDC discovery.
|
||||||
* cache?: array{
|
* cache?: array{
|
||||||
* id: scalar|Param|null, // Cache service id to use to cache the OIDC discovery configuration.
|
* id?: scalar|Param|null, // Cache service id to use to cache the OIDC discovery configuration.
|
||||||
* },
|
* },
|
||||||
* },
|
* },
|
||||||
* claim?: scalar|Param|null, // Claim which contains the user identifier (e.g. sub, email, etc.). // Default: "sub"
|
* claim?: scalar|Param|null, // Claim which contains the user identifier (e.g. sub, email, etc.). // Default: "sub"
|
||||||
@@ -1158,25 +1158,25 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* },
|
* },
|
||||||
* oidc?: array{
|
* oidc?: array{
|
||||||
* discovery?: array{ // Enable the OIDC discovery.
|
* discovery?: array{ // Enable the OIDC discovery.
|
||||||
* base_uri: list<scalar|Param|null>,
|
* base_uri?: list<scalar|Param|null>,
|
||||||
* cache?: array{
|
* cache?: array{
|
||||||
* id: scalar|Param|null, // Cache service id to use to cache the OIDC discovery configuration.
|
* id?: scalar|Param|null, // Cache service id to use to cache the OIDC discovery configuration.
|
||||||
* },
|
* },
|
||||||
* },
|
* },
|
||||||
* claim?: scalar|Param|null, // Claim which contains the user identifier (e.g.: sub, email..). // Default: "sub"
|
* claim?: scalar|Param|null, // Claim which contains the user identifier (e.g.: sub, email..). // Default: "sub"
|
||||||
* audience: scalar|Param|null, // Audience set in the token, for validation purpose.
|
* audience?: scalar|Param|null, // Audience set in the token, for validation purpose.
|
||||||
* issuers: list<scalar|Param|null>,
|
* issuers?: list<scalar|Param|null>,
|
||||||
* algorithms: list<scalar|Param|null>,
|
* algorithms?: list<scalar|Param|null>,
|
||||||
* keyset?: scalar|Param|null, // JSON-encoded JWKSet used to sign the token (must contain a list of valid public keys).
|
* keyset?: scalar|Param|null, // JSON-encoded JWKSet used to sign the token (must contain a list of valid public keys).
|
||||||
* encryption?: bool|array{
|
* encryption?: bool|array{
|
||||||
* enabled?: bool|Param, // Default: false
|
* enabled?: bool|Param, // Default: false
|
||||||
* enforce?: bool|Param, // When enabled, the token shall be encrypted. // Default: false
|
* enforce?: bool|Param, // When enabled, the token shall be encrypted. // Default: false
|
||||||
* algorithms: list<scalar|Param|null>,
|
* algorithms?: list<scalar|Param|null>,
|
||||||
* keyset: scalar|Param|null, // JSON-encoded JWKSet used to decrypt the token (must contain a list of valid private keys).
|
* keyset?: scalar|Param|null, // JSON-encoded JWKSet used to decrypt the token (must contain a list of valid private keys).
|
||||||
* },
|
* },
|
||||||
* },
|
* },
|
||||||
* cas?: array{
|
* cas?: array{
|
||||||
* validation_url: scalar|Param|null, // CAS server validation URL
|
* validation_url?: scalar|Param|null, // CAS server validation URL
|
||||||
* prefix?: scalar|Param|null, // CAS prefix // Default: "cas"
|
* prefix?: scalar|Param|null, // CAS prefix // Default: "cas"
|
||||||
* http_client?: scalar|Param|null, // HTTP Client service // Default: null
|
* http_client?: scalar|Param|null, // HTTP Client service // Default: null
|
||||||
* },
|
* },
|
||||||
@@ -1550,7 +1550,10 @@ final class App
|
|||||||
*/
|
*/
|
||||||
public static function config(array $config): array
|
public static function config(array $config): array
|
||||||
{
|
{
|
||||||
return AppReference::config($config);
|
/** @var ConfigType $config */
|
||||||
|
$config = AppReference::config($config);
|
||||||
|
|
||||||
|
return $config;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-4
@@ -110,9 +110,7 @@ class Quiz
|
|||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @param list<Candidate> $activeCandidates */
|
||||||
* @param list<Candidate> $activeCandidates
|
|
||||||
*/
|
|
||||||
private function getQuestionError(Question $question, bool $hasCandidateRelations, array $activeCandidates): ?string
|
private function getQuestionError(Question $question, bool $hasCandidateRelations, array $activeCandidates): ?string
|
||||||
{
|
{
|
||||||
if (0 === \count($question->answers)) {
|
if (0 === \count($question->answers)) {
|
||||||
@@ -131,7 +129,6 @@ class Quiz
|
|||||||
|
|
||||||
// Only validate candidate-answer relations if at least one exists in the quiz
|
// Only validate candidate-answer relations if at least one exists in the quiz
|
||||||
if ($hasCandidateRelations) {
|
if ($hasCandidateRelations) {
|
||||||
|
|
||||||
$candidateCounts = [];
|
$candidateCounts = [];
|
||||||
|
|
||||||
// Count how many times each candidate appears in answers
|
// Count how many times each candidate appears in answers
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
<h4 class="mb-3">Quick actions</h4>
|
<div data-controller="bo--quiz">
|
||||||
<div class="mb-3 btn-group" data-controller="bo--quiz">
|
<h4 class="mb-3">Quick actions</h4>
|
||||||
|
<div class="mb-3 btn-group">
|
||||||
|
|
||||||
{% if quiz is same as (season.activeQuiz) %}
|
{% if quiz is same as (season.activeQuiz) %}
|
||||||
<a class="btn btn-secondary"
|
<a class="btn btn-secondary"
|
||||||
href="{{ path('tvdt_backoffice_enable', {seasonCode: season.seasonCode, quiz: 'null'}) }}">{{ 'Deactivate Quiz'|trans }}</a>
|
href="{{ path('tvdt_backoffice_enable', {seasonCode: season.seasonCode, quiz: 'null'}) }}">{{ 'Deactivate Quiz'|trans }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="btn btn-primary"
|
<a class="btn btn-primary"
|
||||||
href="{{ path('tvdt_backoffice_enable', {seasonCode: season.seasonCode, quiz: quiz.id}) }}">{{ 'Make active'|trans }}</a>
|
href="{{ path('tvdt_backoffice_enable', {seasonCode: season.seasonCode, quiz: quiz.id}) }}">{{ 'Make active'|trans }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button class="btn btn-danger" data-action="click->bo--quiz#clearQuiz">
|
<button class="btn btn-danger" data-action="click->bo--quiz#clearQuiz">
|
||||||
{{ 'Clear Quiz...'|trans }}
|
{{ 'Clear Quiz...'|trans }}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-danger" data-action="click->bo--quiz#deleteQuiz">
|
<button class="btn btn-danger" data-action="click->bo--quiz#deleteQuiz">
|
||||||
{{ 'Delete Quiz...'|trans }}
|
{{ 'Delete Quiz...'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h4 class="mb-3">{{ 'Questions'|trans }}</h4>
|
<h4 class="mb-3">{{ 'Questions'|trans }}</h4>
|
||||||
<div class="accordion">
|
<div class="accordion">
|
||||||
{%~ for question in quiz.questions ~%}
|
{%~ for question in quiz.questions ~%}
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
@@ -56,45 +57,48 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# Modal Clear #}
|
{# Modal Clear #}
|
||||||
<div class="modal fade" id="clearQuizModal" data-bs-backdrop="static"
|
<div class="modal fade" id="clearQuizModal" data-bs-backdrop="static"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
data-bo--quiz-target="clearModal"
|
||||||
<div class="modal-dialog">
|
aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||||
<div class="modal-content">
|
<div class="modal-dialog">
|
||||||
<div class="modal-header">
|
<div class="modal-content">
|
||||||
<h1 class="modal-title fs-5" id="staticBackdropLabel">{{ 'Please Confirm'|trans }}</h1>
|
<div class="modal-header">
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<h1 class="modal-title fs-5" id="staticBackdropLabel">{{ 'Please Confirm'|trans }}</h1>
|
||||||
</div>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
<div class="modal-body">
|
</div>
|
||||||
{{ 'Are you sure you want to clear all the results? This will also delete al the eliminations.'|trans }}
|
<div class="modal-body">
|
||||||
</div>
|
{{ 'Are you sure you want to clear all the results? This will also delete al the eliminations.'|trans }}
|
||||||
<div class="modal-footer">
|
</div>
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'No'|trans }}</button>
|
<div class="modal-footer">
|
||||||
<a href="{{ path('tvdt_backoffice_quiz_clear', {quiz: quiz.id}) }}"
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'No'|trans }}</button>
|
||||||
class="btn btn-danger">{{ 'Yes'|trans }}</a>
|
<a href="{{ path('tvdt_backoffice_quiz_clear', {quiz: quiz.id}) }}"
|
||||||
|
class="btn btn-danger">{{ 'Yes'|trans }}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{# Modal Delete #}
|
{# Modal Delete #}
|
||||||
<div class="modal fade" id="deleteQuizModal" data-bs-backdrop="static"
|
<div class="modal fade" id="deleteQuizModal" data-bs-backdrop="static"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
data-bo--quiz-target="deleteModal"
|
||||||
<div class="modal-dialog">
|
aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||||
<div class="modal-content">
|
<div class="modal-dialog">
|
||||||
<div class="modal-header">
|
<div class="modal-content">
|
||||||
<h1 class="modal-title fs-5" id="staticBackdropLabel">{{ 'Please Confirm'|trans }}</h1>
|
<div class="modal-header">
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<h1 class="modal-title fs-5" id="staticBackdropLabel">{{ 'Please Confirm'|trans }}</h1>
|
||||||
</div>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
<div class="modal-body">
|
</div>
|
||||||
{{ 'Are you sure you want to delete this quiz?'|trans }}
|
<div class="modal-body">
|
||||||
</div>
|
{{ 'Are you sure you want to delete this quiz?'|trans }}
|
||||||
<div class="modal-footer">
|
</div>
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'No'|trans }}</button>
|
<div class="modal-footer">
|
||||||
<a href="{{ path('tvdt_backoffice_quiz_delete', {quiz: quiz.id}) }}"
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'No'|trans }}</button>
|
||||||
class="btn btn-danger">{{ 'Yes'|trans }}</a>
|
<a href="{{ path('tvdt_backoffice_quiz_delete', {quiz: quiz.id}) }}"
|
||||||
|
class="btn btn-danger">{{ 'Yes'|trans }}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
<title>
|
<title>
|
||||||
{% block title %}Tijd voor de test{% endblock title %}
|
{% block title %}Tijd voor de test{% endblock title %}
|
||||||
</title>
|
</title>
|
||||||
{% block stylesheets %}{% endblock %}
|
{% block importmap %}{% endblock %}
|
||||||
{% block javascripts %}{% block importmap %}{% endblock %}{% endblock %}
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% block nav %}
|
{% block nav %}
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ final class QuizRepositoryTest extends DatabaseTestCase
|
|||||||
|
|
||||||
// Start Quiz
|
// Start Quiz
|
||||||
$qc = new QuizCandidate($quiz, $candidate);
|
$qc = new QuizCandidate($quiz, $candidate);
|
||||||
|
$qc->started = $clock->now();
|
||||||
$this->entityManager->persist($qc);
|
$this->entityManager->persist($qc);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
@@ -99,7 +100,9 @@ final class QuizRepositoryTest extends DatabaseTestCase
|
|||||||
$this->assertInstanceOf(Quiz::class, $quiz);
|
$this->assertInstanceOf(Quiz::class, $quiz);
|
||||||
|
|
||||||
$qc1 = new QuizCandidate($quiz, $candidate1);
|
$qc1 = new QuizCandidate($quiz, $candidate1);
|
||||||
|
$qc1->started = $clock->now();
|
||||||
$qc2 = new QuizCandidate($quiz, $candidate2);
|
$qc2 = new QuizCandidate($quiz, $candidate2);
|
||||||
|
$qc2->started = $clock->now();
|
||||||
$this->entityManager->persist($qc1);
|
$this->entityManager->persist($qc1);
|
||||||
$this->entityManager->persist($qc2);
|
$this->entityManager->persist($qc2);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
@@ -142,6 +145,8 @@ final class QuizRepositoryTest extends DatabaseTestCase
|
|||||||
$this->assertInstanceOf(Quiz::class, $quiz);
|
$this->assertInstanceOf(Quiz::class, $quiz);
|
||||||
|
|
||||||
$qc = new QuizCandidate($quiz, $candidate);
|
$qc = new QuizCandidate($quiz, $candidate);
|
||||||
|
$qc->started = $clock->now();
|
||||||
|
|
||||||
$this->entityManager->persist($qc);
|
$this->entityManager->persist($qc);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
@@ -178,9 +183,11 @@ final class QuizRepositoryTest extends DatabaseTestCase
|
|||||||
$this->assertInstanceOf(Quiz::class, $quiz);
|
$this->assertInstanceOf(Quiz::class, $quiz);
|
||||||
|
|
||||||
$qc1 = new QuizCandidate($quiz, $candidate1);
|
$qc1 = new QuizCandidate($quiz, $candidate1);
|
||||||
|
$qc1->started = $clock->now();
|
||||||
$this->entityManager->persist($qc1);
|
$this->entityManager->persist($qc1);
|
||||||
$clock->sleep(10);
|
$clock->sleep(10);
|
||||||
$qc2 = new QuizCandidate($quiz, $candidate2);
|
$qc2 = new QuizCandidate($quiz, $candidate2);
|
||||||
|
$qc2->started = $clock->now();
|
||||||
$this->entityManager->persist($qc2);
|
$this->entityManager->persist($qc2);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user