mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-07 13:14:20 +01:00
Compare commits
1 Commits
c70f713f7e
...
php
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3192fb6c83 |
@@ -33,7 +33,6 @@ indent_size = 4
|
|||||||
|
|
||||||
[*.{yaml,yml}]
|
[*.{yaml,yml}]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[.github/workflows/*.yml]
|
[.github/workflows/*.yml]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
47
.github/workflows/ci.yml
vendored
47
.github/workflows/ci.yml
vendored
@@ -16,11 +16,14 @@ jobs:
|
|||||||
name: Tests
|
name: Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
-
|
||||||
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Set up Docker Buildx
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Build Docker images
|
-
|
||||||
|
name: Build Docker images
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
pull: true
|
pull: true
|
||||||
@@ -32,30 +35,42 @@ jobs:
|
|||||||
*.cache-from=type=gha,scope=${{github.ref}}
|
*.cache-from=type=gha,scope=${{github.ref}}
|
||||||
*.cache-from=type=gha,scope=refs/heads/main
|
*.cache-from=type=gha,scope=refs/heads/main
|
||||||
*.cache-to=type=gha,scope=${{github.ref}},mode=max
|
*.cache-to=type=gha,scope=${{github.ref}},mode=max
|
||||||
- name: Start services
|
-
|
||||||
|
name: Start services
|
||||||
run: docker compose up --wait --no-build
|
run: docker compose up --wait --no-build
|
||||||
- name: Check HTTP reachability
|
-
|
||||||
|
name: Check HTTP reachability
|
||||||
run: curl -v --fail-with-body http://localhost
|
run: curl -v --fail-with-body http://localhost
|
||||||
- name: Check HTTPS reachability
|
-
|
||||||
|
name: Check HTTPS reachability
|
||||||
if: false # Remove this line when the homepage will be configured, or change the path to check
|
if: false # Remove this line when the homepage will be configured, or change the path to check
|
||||||
run: curl -vk --fail-with-body https://localhost
|
run: curl -vk --fail-with-body https://localhost
|
||||||
- name: Check Mercure reachability
|
-
|
||||||
|
name: Check Mercure reachability
|
||||||
run: curl -vkI --fail-with-body https://localhost/.well-known/mercure?topic=test
|
run: curl -vkI --fail-with-body https://localhost/.well-known/mercure?topic=test
|
||||||
- name: Create test database
|
-
|
||||||
|
name: Create test database
|
||||||
|
if: false # Remove this line if Doctrine ORM is installed
|
||||||
run: docker compose exec -T php bin/console -e test doctrine:database:create
|
run: docker compose exec -T php bin/console -e test doctrine:database:create
|
||||||
- name: Run migrations
|
-
|
||||||
|
name: Run migrations
|
||||||
|
if: false # Remove this line if Doctrine Migrations is installed
|
||||||
run: docker compose exec -T php bin/console -e test doctrine:migrations:migrate --no-interaction
|
run: docker compose exec -T php bin/console -e test doctrine:migrations:migrate --no-interaction
|
||||||
- name: Run PHPUnit
|
-
|
||||||
if: false # Remove this line when the tests are ready
|
name: Run PHPUnit
|
||||||
run: docker compose exec -T php vendor/bin/phpunit
|
if: false # Remove this line if PHPUnit is installed
|
||||||
- name: Doctrine Schema Validator
|
run: docker compose exec -T php bin/phpunit
|
||||||
|
-
|
||||||
|
name: Doctrine Schema Validator
|
||||||
|
if: false # Remove this line if Doctrine ORM is installed
|
||||||
run: docker compose exec -T php bin/console -e test doctrine:schema:validate
|
run: docker compose exec -T php bin/console -e test doctrine:schema:validate
|
||||||
lint:
|
lint:
|
||||||
name: Docker Lint
|
name: Docker Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
-
|
||||||
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Lint Dockerfile
|
-
|
||||||
|
name: Lint Dockerfile
|
||||||
uses: hadolint/hadolint-action@v3.1.0
|
uses: hadolint/hadolint-action@v3.1.0
|
||||||
|
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -105,7 +105,3 @@ phpstan.neon
|
|||||||
/phpunit.xml
|
/phpunit.xml
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
###< phpunit/phpunit ###
|
###< phpunit/phpunit ###
|
||||||
|
|
||||||
###> vincentlanglet/twig-cs-fixer ###
|
|
||||||
/.twig-cs-fixer.cache
|
|
||||||
###< vincentlanglet/twig-cs-fixer ###
|
|
||||||
|
|||||||
8
.idea/TijdVoorDeTest.iml
generated
8
.idea/TijdVoorDeTest.iml
generated
@@ -6,6 +6,7 @@
|
|||||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="App\Tests\" />
|
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="App\Tests\" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/clue/ndjson-react" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/clue/ndjson-react" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/cache" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/collections" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/collections" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/dbal" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/dbal" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
|
||||||
@@ -47,6 +48,8 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/rector/rector" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/rector/rector" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/runtime/frankenphp-symfony" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/runtime/frankenphp-symfony" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
|
||||||
@@ -82,6 +85,7 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php83" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/runtime" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/runtime" />
|
||||||
@@ -129,13 +133,9 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/twig/html-extra" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/twig/html-extra" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/data-fixtures" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/data-fixtures" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/doctrine-fixtures-bundle" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/doctrine-fixtures-bundle" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/vincentlanglet/twig-cs-fixer" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php84" />
|
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="bootstrap" level="application" />
|
<orderEntry type="library" name="bootstrap" level="application" />
|
||||||
<orderEntry type="library" name="bootstrap-icons" level="application" />
|
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
2
.idea/jsLibraryMappings.xml
generated
2
.idea/jsLibraryMappings.xml
generated
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="JavaScriptLibraryMappings">
|
<component name="JavaScriptLibraryMappings">
|
||||||
<file url="PROJECT" libraries="{bootstrap, bootstrap-icons}" />
|
<file url="PROJECT" libraries="{bootstrap}" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
7
.idea/php.xml
generated
7
.idea/php.xml
generated
@@ -46,6 +46,7 @@
|
|||||||
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
|
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
|
||||||
<path value="$PROJECT_DIR$/vendor/symfony/runtime" />
|
<path value="$PROJECT_DIR$/vendor/symfony/runtime" />
|
||||||
<path value="$PROJECT_DIR$/vendor/symfony/routing" />
|
<path value="$PROJECT_DIR$/vendor/symfony/routing" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php83" />
|
||||||
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
|
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
|
||||||
<path value="$PROJECT_DIR$/vendor/symfony/var-exporter" />
|
<path value="$PROJECT_DIR$/vendor/symfony/var-exporter" />
|
||||||
<path value="$PROJECT_DIR$/vendor/psr/cache" />
|
<path value="$PROJECT_DIR$/vendor/psr/cache" />
|
||||||
@@ -70,6 +71,7 @@
|
|||||||
<path value="$PROJECT_DIR$/vendor/symfony/stopwatch" />
|
<path value="$PROJECT_DIR$/vendor/symfony/stopwatch" />
|
||||||
<path value="$PROJECT_DIR$/vendor/doctrine/doctrine-migrations-bundle" />
|
<path value="$PROJECT_DIR$/vendor/doctrine/doctrine-migrations-bundle" />
|
||||||
<path value="$PROJECT_DIR$/vendor/doctrine/migrations" />
|
<path value="$PROJECT_DIR$/vendor/doctrine/migrations" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/doctrine/cache" />
|
||||||
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
|
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
|
||||||
<path value="$PROJECT_DIR$/vendor/doctrine/dbal" />
|
<path value="$PROJECT_DIR$/vendor/doctrine/dbal" />
|
||||||
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
|
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
|
||||||
@@ -111,6 +113,8 @@
|
|||||||
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
|
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
|
||||||
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
|
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
|
||||||
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
|
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||||
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
|
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
|
||||||
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
|
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
|
||||||
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
|
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
|
||||||
@@ -159,9 +163,6 @@
|
|||||||
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
|
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
|
||||||
<path value="$PROJECT_DIR$/vendor/doctrine/data-fixtures" />
|
<path value="$PROJECT_DIR$/vendor/doctrine/data-fixtures" />
|
||||||
<path value="$PROJECT_DIR$/vendor/doctrine/doctrine-fixtures-bundle" />
|
<path value="$PROJECT_DIR$/vendor/doctrine/doctrine-fixtures-bundle" />
|
||||||
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
|
|
||||||
<path value="$PROJECT_DIR$/vendor/vincentlanglet/twig-cs-fixer" />
|
|
||||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php84" />
|
|
||||||
</include_path>
|
</include_path>
|
||||||
</component>
|
</component>
|
||||||
<component name="PhpInterpreters">
|
<component name="PhpInterpreters">
|
||||||
|
|||||||
10
.idea/phpunit.xml
generated
10
.idea/phpunit.xml
generated
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="PHPUnit">
|
|
||||||
<option name="directories">
|
|
||||||
<list>
|
|
||||||
<option value="$PROJECT_DIR$/tests" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
8
.idea/sonarlint.xml
generated
8
.idea/sonarlint.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="SonarLintProjectSettings">
|
|
||||||
<option name="bindingEnabled" value="true" />
|
|
||||||
<option name="projectKey" value="MarijnDoeve_TijdVoorDeTest" />
|
|
||||||
<option name="serverId" value="SonarQube" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -1,20 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
use PhpCsFixer\Config;
|
|
||||||
use PhpCsFixer\Finder;
|
|
||||||
|
|
||||||
$finder = (new Finder())
|
$finder = (new PhpCsFixer\Finder())
|
||||||
->in(__DIR__)
|
->in(__DIR__)
|
||||||
->exclude('var')
|
->exclude('var')
|
||||||
;
|
;
|
||||||
|
|
||||||
return (new Config())
|
return (new PhpCsFixer\Config())
|
||||||
->setRules([
|
->setRules([
|
||||||
'@Symfony' => true,
|
'@Symfony' => true,
|
||||||
'@Symfony:risky' => true,
|
'@Symfony:risky' => true,
|
||||||
'declare_strict_types' => true,
|
'declare_strict_types' => true,
|
||||||
'fully_qualified_strict_types' => ['import_symbols' => true],
|
|
||||||
'linebreak_after_opening_tag' => true,
|
'linebreak_after_opening_tag' => true,
|
||||||
'mb_str_functions' => true,
|
'mb_str_functions' => true,
|
||||||
'no_php4_constructor' => true,
|
'no_php4_constructor' => true,
|
||||||
@@ -22,11 +19,11 @@ return (new Config())
|
|||||||
'no_useless_else' => true,
|
'no_useless_else' => true,
|
||||||
'no_useless_return' => true,
|
'no_useless_return' => true,
|
||||||
'php_unit_strict' => true,
|
'php_unit_strict' => true,
|
||||||
'phpdoc_line_span' => ['const' => 'single', 'method' => 'single', 'property' => 'single'],
|
|
||||||
'phpdoc_order' => true,
|
'phpdoc_order' => true,
|
||||||
'single_line_empty_body' => true,
|
|
||||||
'strict_comparison' => true,
|
'strict_comparison' => true,
|
||||||
'strict_param' => true,
|
'strict_param' => true,
|
||||||
|
'blank_line_between_import_groups' => false,
|
||||||
|
'phpdoc_line_span' => ['const' => 'single', 'method' => 'single', 'property' => 'single'],
|
||||||
])
|
])
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setFinder($finder)
|
->setFinder($finder)
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ RUN set -eux; \
|
|||||||
|
|
||||||
COPY --link frankenphp/conf.d/20-app.dev.ini $PHP_INI_DIR/app.conf.d/
|
COPY --link frankenphp/conf.d/20-app.dev.ini $PHP_INI_DIR/app.conf.d/
|
||||||
|
|
||||||
RUN git config --global --add safe.directory /app
|
|
||||||
|
|
||||||
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ]
|
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ]
|
||||||
|
|
||||||
# Prod FrankenPHP image
|
# Prod FrankenPHP image
|
||||||
|
|||||||
27
Justfile
27
Justfile
@@ -1,27 +0,0 @@
|
|||||||
up:
|
|
||||||
docker compose up -d
|
|
||||||
|
|
||||||
down *args:
|
|
||||||
docker compose down {{ args }} --remove-orphans
|
|
||||||
|
|
||||||
stop:
|
|
||||||
docker compose stop
|
|
||||||
|
|
||||||
exec *args:
|
|
||||||
docker compose exec php {{ args }}
|
|
||||||
|
|
||||||
[no-exit-message]
|
|
||||||
shell:
|
|
||||||
@docker compose exec php bash
|
|
||||||
|
|
||||||
migrate: up
|
|
||||||
docker compose run --rm php bin/console doctrine:migrations:migrate --no-interaction
|
|
||||||
|
|
||||||
fixtures:
|
|
||||||
docker compose exec php bin/console doctrine:fixtures:load --purge-with-truncate --no-interaction
|
|
||||||
|
|
||||||
translations:
|
|
||||||
docker compose exec php bin/console translation:extract --domain=messages --force --format=yaml --sort=asc --clean nl
|
|
||||||
|
|
||||||
fix-cs:
|
|
||||||
docker compose exec php vendor/bin/php-cs-fixer fix
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use App\Kernel;
|
use App\Kernel;
|
||||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "marijndoeve/tijdvoordetest",
|
"name": "symfony/skeleton",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "A minimal Symfony project recommended to create bare bones applications",
|
"description": "A minimal Symfony project recommended to create bare bones applications",
|
||||||
@@ -9,16 +9,16 @@
|
|||||||
"php": ">=8.3.15",
|
"php": ">=8.3.15",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-iconv": "*",
|
"ext-iconv": "*",
|
||||||
"doctrine/dbal": "^4.2.3",
|
"doctrine/dbal": "^3",
|
||||||
"doctrine/doctrine-bundle": "^2.14.0",
|
"doctrine/doctrine-bundle": "^2.13",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.4.1",
|
"doctrine/doctrine-migrations-bundle": "^3.3",
|
||||||
"doctrine/orm": "^3.3.2",
|
"doctrine/orm": "^3.3",
|
||||||
"easycorp/easyadmin-bundle": "^4.24.5",
|
"easycorp/easyadmin-bundle": "^4.23",
|
||||||
"runtime/frankenphp-symfony": "^0.2.0",
|
"runtime/frankenphp-symfony": "^0.2.0",
|
||||||
"symfony/asset": "7.2.*",
|
"symfony/asset": "7.2.*",
|
||||||
"symfony/console": "7.2.*",
|
"symfony/console": "7.2.*",
|
||||||
"symfony/dotenv": "7.2.*",
|
"symfony/dotenv": "7.2.*",
|
||||||
"symfony/flex": "^2.5.0",
|
"symfony/flex": "^2.4.7",
|
||||||
"symfony/form": "7.2.*",
|
"symfony/form": "7.2.*",
|
||||||
"symfony/framework-bundle": "7.2.*",
|
"symfony/framework-bundle": "7.2.*",
|
||||||
"symfony/runtime": "7.2.*",
|
"symfony/runtime": "7.2.*",
|
||||||
@@ -26,24 +26,22 @@
|
|||||||
"symfony/twig-bundle": "7.2.*",
|
"symfony/twig-bundle": "7.2.*",
|
||||||
"symfony/uid": "7.2.*",
|
"symfony/uid": "7.2.*",
|
||||||
"symfony/yaml": "7.2.*",
|
"symfony/yaml": "7.2.*",
|
||||||
"thecodingmachine/safe": "^3.0.2"
|
"thecodingmachine/safe": "^2.5"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/doctrine-fixtures-bundle": "^4.1",
|
"doctrine/doctrine-fixtures-bundle": "^4.0",
|
||||||
"friendsofphp/php-cs-fixer": "^3.75.0",
|
"friendsofphp/php-cs-fixer": "^3.65",
|
||||||
"phpstan/extension-installer": "^1.4.3",
|
"phpstan/extension-installer": "^1.4",
|
||||||
"phpstan/phpstan": "^2.1.11",
|
"phpstan/phpstan": "^2.0",
|
||||||
"phpstan/phpstan-doctrine": "^2.0.2",
|
"phpstan/phpstan-doctrine": "^2.0",
|
||||||
"phpstan/phpstan-phpunit": "^2.0.6",
|
"phpstan/phpstan-phpunit": "^2.0",
|
||||||
"phpstan/phpstan-symfony": "^2.0.4",
|
"phpstan/phpstan-symfony": "^2.0",
|
||||||
"phpunit/phpunit": "^12.0.10",
|
"phpunit/phpunit": "^11",
|
||||||
"rector/rector": "^2.0.11",
|
"rector/rector": "^2.0",
|
||||||
"roave/security-advisories": "dev-latest",
|
|
||||||
"symfony/maker-bundle": "^1.62.1",
|
"symfony/maker-bundle": "^1.62.1",
|
||||||
"symfony/stopwatch": "7.2.*",
|
"symfony/stopwatch": "7.2.*",
|
||||||
"symfony/web-profiler-bundle": "7.2.*",
|
"symfony/web-profiler-bundle": "7.2.*",
|
||||||
"thecodingmachine/phpstan-safe-rule": "^1.4",
|
"thecodingmachine/phpstan-safe-rule": "^1.3"
|
||||||
"vincentlanglet/twig-cs-fixer": "^3.5.1"
|
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
@@ -73,8 +71,7 @@
|
|||||||
"symfony/polyfill-php74": "*",
|
"symfony/polyfill-php74": "*",
|
||||||
"symfony/polyfill-php80": "*",
|
"symfony/polyfill-php80": "*",
|
||||||
"symfony/polyfill-php81": "*",
|
"symfony/polyfill-php81": "*",
|
||||||
"symfony/polyfill-php82": "*",
|
"symfony/polyfill-php82": "*"
|
||||||
"symfony/polyfill-php83": "*"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"auto-scripts": {
|
"auto-scripts": {
|
||||||
|
|||||||
2447
composer.lock
generated
2447
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,28 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
|
|
||||||
use Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle;
|
|
||||||
use Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle;
|
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
|
||||||
use Symfony\Bundle\MakerBundle\MakerBundle;
|
|
||||||
use Symfony\Bundle\SecurityBundle\SecurityBundle;
|
|
||||||
use Symfony\Bundle\TwigBundle\TwigBundle;
|
|
||||||
use Symfony\Bundle\WebProfilerBundle\WebProfilerBundle;
|
|
||||||
use Symfony\UX\TwigComponent\TwigComponentBundle;
|
|
||||||
use Twig\Extra\TwigExtraBundle\TwigExtraBundle;
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
FrameworkBundle::class => ['all' => true],
|
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||||
DoctrineBundle::class => ['all' => true],
|
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||||
DoctrineMigrationsBundle::class => ['all' => true],
|
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||||
MakerBundle::class => ['dev' => true],
|
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||||
TwigBundle::class => ['all' => true],
|
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||||
SecurityBundle::class => ['all' => true],
|
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||||
WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||||
TwigExtraBundle::class => ['all' => true],
|
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
||||||
TwigComponentBundle::class => ['all' => true],
|
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
|
||||||
EasyAdminBundle::class => ['all' => true],
|
EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle::class => ['all' => true],
|
||||||
DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
|
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Enable stateless CSRF protection for forms and logins/logouts
|
# Enable stateless CSRF protection for forms and logins/logouts
|
||||||
framework:
|
framework:
|
||||||
form:
|
form:
|
||||||
|
csrf_protection:
|
||||||
|
token_id: submit
|
||||||
|
|
||||||
csrf_protection:
|
csrf_protection:
|
||||||
token_id: submit
|
stateless_token_ids:
|
||||||
|
- submit
|
||||||
csrf_protection:
|
- authenticate
|
||||||
stateless_token_ids:
|
- logout
|
||||||
- submit
|
|
||||||
- authenticate
|
|
||||||
- logout
|
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
doctrine:
|
doctrine:
|
||||||
dbal:
|
dbal:
|
||||||
url: '%env(resolve:DATABASE_URL)%'
|
url: '%env(resolve:DATABASE_URL)%'
|
||||||
|
|
||||||
# IMPORTANT: You MUST configure your server version,
|
# IMPORTANT: You MUST configure your server version,
|
||||||
# either here or in the DATABASE_URL env var (see .env file)
|
# either here or in the DATABASE_URL env var (see .env file)
|
||||||
#server_version: '16'
|
#server_version: '16'
|
||||||
|
|
||||||
profiling_collect_backtrace: '%kernel.debug%'
|
profiling_collect_backtrace: '%kernel.debug%'
|
||||||
use_savepoints: true
|
use_savepoints: true
|
||||||
orm:
|
orm:
|
||||||
auto_generate_proxy_classes: true
|
auto_generate_proxy_classes: true
|
||||||
enable_lazy_ghost_objects: true
|
enable_lazy_ghost_objects: true
|
||||||
report_fields_where_declared: true
|
report_fields_where_declared: true
|
||||||
validate_xml_mapping: true
|
validate_xml_mapping: true
|
||||||
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
|
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
|
||||||
identity_generation_preferences:
|
identity_generation_preferences:
|
||||||
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
|
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
|
||||||
auto_mapping: true
|
auto_mapping: true
|
||||||
mappings:
|
mappings:
|
||||||
App:
|
App:
|
||||||
type: attribute
|
type: attribute
|
||||||
is_bundle: false
|
is_bundle: false
|
||||||
dir: '%kernel.project_dir%/src/Entity'
|
dir: '%kernel.project_dir%/src/Entity'
|
||||||
prefix: 'App\Entity'
|
prefix: 'App\Entity'
|
||||||
alias: App
|
alias: App
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
doctrine:
|
doctrine:
|
||||||
dbal:
|
dbal:
|
||||||
# "TEST_TOKEN" is typically set by ParaTest
|
# "TEST_TOKEN" is typically set by ParaTest
|
||||||
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
|
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
|
||||||
|
|
||||||
when@prod:
|
when@prod:
|
||||||
doctrine:
|
doctrine:
|
||||||
orm:
|
orm:
|
||||||
auto_generate_proxy_classes: false
|
auto_generate_proxy_classes: false
|
||||||
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
|
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
|
||||||
query_cache_driver:
|
query_cache_driver:
|
||||||
type: pool
|
type: pool
|
||||||
pool: doctrine.system_cache_pool
|
pool: doctrine.system_cache_pool
|
||||||
result_cache_driver:
|
result_cache_driver:
|
||||||
type: pool
|
type: pool
|
||||||
pool: doctrine.result_cache_pool
|
pool: doctrine.result_cache_pool
|
||||||
|
|
||||||
framework:
|
framework:
|
||||||
cache:
|
cache:
|
||||||
pools:
|
pools:
|
||||||
doctrine.result_cache_pool:
|
doctrine.result_cache_pool:
|
||||||
adapter: cache.app
|
adapter: cache.app
|
||||||
doctrine.system_cache_pool:
|
doctrine.system_cache_pool:
|
||||||
adapter: cache.system
|
adapter: cache.system
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
doctrine_migrations:
|
doctrine_migrations:
|
||||||
migrations_paths:
|
migrations_paths:
|
||||||
# namespace is arbitrary but should be different from App\Migrations
|
# namespace is arbitrary but should be different from App\Migrations
|
||||||
# as migrations classes should NOT be autoloaded
|
# as migrations classes should NOT be autoloaded
|
||||||
'DoctrineMigrations': '%kernel.project_dir%/migrations'
|
'DoctrineMigrations': '%kernel.project_dir%/migrations'
|
||||||
enable_profiler: false
|
enable_profiler: false
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
||||||
framework:
|
framework:
|
||||||
secret: '%env(APP_SECRET)%'
|
secret: '%env(APP_SECRET)%'
|
||||||
|
|
||||||
# Note that the session will be started ONLY if you read or write from it.
|
# Note that the session will be started ONLY if you read or write from it.
|
||||||
session: true
|
session: true
|
||||||
|
|
||||||
#esi: true
|
#esi: true
|
||||||
#fragments: true
|
#fragments: true
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
framework:
|
framework:
|
||||||
test: true
|
test: true
|
||||||
session:
|
session:
|
||||||
storage_factory_id: session.storage.factory.mock_file
|
storage_factory_id: session.storage.factory.mock_file
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
framework:
|
framework:
|
||||||
router:
|
router:
|
||||||
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
||||||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
||||||
#default_uri: http://localhost
|
#default_uri: http://localhost
|
||||||
|
|
||||||
when@prod:
|
when@prod:
|
||||||
framework:
|
framework:
|
||||||
router:
|
router:
|
||||||
strict_requirements: null
|
strict_requirements: null
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
security:
|
security:
|
||||||
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
||||||
password_hashers:
|
password_hashers:
|
||||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||||
providers:
|
providers:
|
||||||
# used to reload user from session & other features (e.g. switch_user)
|
# used to reload user from session & other features (e.g. switch_user)
|
||||||
app_user_provider:
|
app_user_provider:
|
||||||
entity:
|
entity:
|
||||||
class: App\Entity\User
|
class: App\Entity\User
|
||||||
property: email
|
property: email
|
||||||
# used to reload user from session & other features (e.g. switch_user)
|
# used to reload user from session & other features (e.g. switch_user)
|
||||||
firewalls:
|
firewalls:
|
||||||
dev:
|
dev:
|
||||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||||
security: false
|
security: false
|
||||||
main:
|
main:
|
||||||
lazy: true
|
lazy: true
|
||||||
provider: app_user_provider
|
provider: app_user_provider
|
||||||
form_login:
|
form_login:
|
||||||
login_path: app_login
|
login_path: app_login
|
||||||
check_path: app_login
|
check_path: app_login
|
||||||
enable_csrf: true
|
enable_csrf: true
|
||||||
logout:
|
logout:
|
||||||
path: app_logout
|
path: app_logout
|
||||||
# where to redirect after logout
|
# where to redirect after logout
|
||||||
# target: app_any_route
|
# target: app_any_route
|
||||||
|
|
||||||
# activate different ways to authenticate
|
# activate different ways to authenticate
|
||||||
# https://symfony.com/doc/current/security.html#the-firewall
|
# https://symfony.com/doc/current/security.html#the-firewall
|
||||||
|
|
||||||
# https://symfony.com/doc/current/security/impersonating_user.html
|
# https://symfony.com/doc/current/security/impersonating_user.html
|
||||||
# switch_user: true
|
# switch_user: true
|
||||||
|
|
||||||
# Easy way to control access for large sections of your site
|
# Easy way to control access for large sections of your site
|
||||||
# Note: Only the *first* access control that matches will be used
|
# Note: Only the *first* access control that matches will be used
|
||||||
access_control:
|
access_control:
|
||||||
# - { path: ^/admin, roles: ROLE_ADMIN }
|
# - { path: ^/admin, roles: ROLE_ADMIN }
|
||||||
# - { path: ^/profile, roles: ROLE_USER }
|
# - { path: ^/profile, roles: ROLE_USER }
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
security:
|
security:
|
||||||
password_hashers:
|
password_hashers:
|
||||||
# By default, password hashers are resource intensive and take time. This is
|
# By default, password hashers are resource intensive and take time. This is
|
||||||
# important to generate secure password hashes. In tests however, secure hashes
|
# important to generate secure password hashes. In tests however, secure hashes
|
||||||
# are not important, waste resources and increase test times. The following
|
# are not important, waste resources and increase test times. The following
|
||||||
# reduces the work factor to the lowest possible values.
|
# reduces the work factor to the lowest possible values.
|
||||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
||||||
algorithm: auto
|
algorithm: auto
|
||||||
cost: 4 # Lowest possible value for bcrypt
|
cost: 4 # Lowest possible value for bcrypt
|
||||||
time_cost: 3 # Lowest possible value for argon
|
time_cost: 3 # Lowest possible value for argon
|
||||||
memory_cost: 10 # Lowest possible value for argon
|
memory_cost: 10 # Lowest possible value for argon
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
framework:
|
framework:
|
||||||
default_locale: nl
|
default_locale: nl
|
||||||
translator:
|
translator:
|
||||||
default_path: '%kernel.project_dir%/translations'
|
default_path: '%kernel.project_dir%/translations'
|
||||||
fallbacks:
|
fallbacks:
|
||||||
- en
|
- en
|
||||||
providers:
|
providers:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
twig:
|
twig:
|
||||||
file_name_pattern: '*.twig'
|
file_name_pattern: '*.twig'
|
||||||
form_themes: [ 'bootstrap_5_layout.html.twig' ]
|
form_themes: [ 'bootstrap_5_layout.html.twig' ]
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
twig:
|
twig:
|
||||||
strict_variables: true
|
strict_variables: true
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
twig_component:
|
twig_component:
|
||||||
anonymous_template_directory: 'components/'
|
anonymous_template_directory: 'components/'
|
||||||
defaults:
|
defaults:
|
||||||
# Namespace & directory for components
|
# Namespace & directory for components
|
||||||
App\Twig\Components\: 'components/'
|
App\Twig\Components\: 'components/'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
framework:
|
framework:
|
||||||
uid:
|
uid:
|
||||||
default_uuid_version: 7
|
default_uuid_version: 7
|
||||||
time_based_uuid_version: 7
|
time_based_uuid_version: 7
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
framework:
|
framework:
|
||||||
validation:
|
validation:
|
||||||
# Enables validator auto-mapping support.
|
# Enables validator auto-mapping support.
|
||||||
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
|
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
|
||||||
#auto_mapping:
|
#auto_mapping:
|
||||||
# App\Entity\: []
|
# App\Entity\: []
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
framework:
|
framework:
|
||||||
validation:
|
validation:
|
||||||
not_compromised_password: false
|
not_compromised_password: false
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
when@dev:
|
when@dev:
|
||||||
web_profiler:
|
web_profiler:
|
||||||
toolbar: true
|
toolbar: true
|
||||||
intercept_redirects: false
|
intercept_redirects: false
|
||||||
|
|
||||||
framework:
|
framework:
|
||||||
profiler:
|
profiler:
|
||||||
only_exceptions: false
|
only_exceptions: false
|
||||||
collect_serializer_data: true
|
collect_serializer_data: true
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
web_profiler:
|
web_profiler:
|
||||||
toolbar: false
|
toolbar: false
|
||||||
intercept_redirects: false
|
intercept_redirects: false
|
||||||
|
|
||||||
framework:
|
framework:
|
||||||
profiler: { collect: false }
|
profiler: { collect: false }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
controllers:
|
controllers:
|
||||||
resource:
|
resource:
|
||||||
path: ../src/Controller/
|
path: ../src/Controller/
|
||||||
namespace: App\Controller
|
namespace: App\Controller
|
||||||
type: attribute
|
type: attribute
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
controllers:
|
controllers:
|
||||||
resource:
|
resource:
|
||||||
path: ../../src/Controller/
|
path: ../../src/Controller/
|
||||||
namespace: App\Controller
|
namespace: App\Controller
|
||||||
type: attribute
|
type: attribute
|
||||||
|
|
||||||
kernel:
|
kernel:
|
||||||
resource: App\Kernel
|
resource: App\Kernel
|
||||||
type: attribute
|
type: attribute
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
easyadmin:
|
easyadmin:
|
||||||
resource: .
|
resource: .
|
||||||
type: easyadmin.routes
|
type: easyadmin.routes
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
when@dev:
|
when@dev:
|
||||||
_errors:
|
_errors:
|
||||||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
||||||
prefix: /_error
|
prefix: /_error
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
_security_logout:
|
_security_logout:
|
||||||
resource: security.route_loader.logout
|
resource: security.route_loader.logout
|
||||||
type: service
|
type: service
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
when@dev:
|
when@dev:
|
||||||
web_profiler_wdt:
|
web_profiler_wdt:
|
||||||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
|
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
|
||||||
prefix: /_wdt
|
prefix: /_wdt
|
||||||
|
|
||||||
web_profiler_profiler:
|
web_profiler_profiler:
|
||||||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
|
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
|
||||||
prefix: /_profiler
|
prefix: /_profiler
|
||||||
|
|||||||
@@ -6,19 +6,19 @@
|
|||||||
parameters:
|
parameters:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# default configuration for services in *this* file
|
# default configuration for services in *this* file
|
||||||
_defaults:
|
_defaults:
|
||||||
autowire: true # Automatically injects dependencies in your services.
|
autowire: true # Automatically injects dependencies in your services.
|
||||||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
||||||
|
|
||||||
# makes classes in src/ available to be used as services
|
# makes classes in src/ available to be used as services
|
||||||
# this creates a service per class whose id is the fully-qualified class name
|
# this creates a service per class whose id is the fully-qualified class name
|
||||||
App\:
|
App\:
|
||||||
resource: '../src/'
|
resource: '../src/'
|
||||||
exclude:
|
exclude:
|
||||||
- '../src/DependencyInjection/'
|
- '../src/DependencyInjection/'
|
||||||
- '../src/Entity/'
|
- '../src/Entity/'
|
||||||
- '../src/Kernel.php'
|
- '../src/Kernel.php'
|
||||||
|
|
||||||
# add more service definitions when explicit configuration is needed
|
# add more service definitions when explicit configuration is needed
|
||||||
# please note that last definitions always *replace* previous ones
|
# please note that last definitions always *replace* previous ones
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20250311213417 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE answer ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE answer ALTER question_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN answer.id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN answer.question_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE answer_candidate ALTER answer_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE answer_candidate ALTER candidate_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN answer_candidate.answer_id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN answer_candidate.candidate_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE candidate ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE candidate ALTER season_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN candidate.id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN candidate.season_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE correction ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE correction ALTER candidate_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE correction ALTER quiz_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN correction.id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN correction.candidate_id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN correction.quiz_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE given_answer ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE given_answer ALTER candidate_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE given_answer ALTER quiz_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE given_answer ALTER answer_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN given_answer.id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN given_answer.candidate_id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN given_answer.quiz_id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN given_answer.answer_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE question ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE question ALTER quiz_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN question.id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN question.quiz_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE quiz ADD dropouts INT DEFAULT NULL');
|
|
||||||
$this->addSql('ALTER TABLE quiz ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE quiz ALTER season_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN quiz.id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN quiz.season_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE season ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE season ALTER active_quiz_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN season.id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN season.active_quiz_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE season_user ALTER season_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE season_user ALTER user_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN season_user.season_id IS \'\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN season_user.user_id IS \'\'');
|
|
||||||
$this->addSql('ALTER TABLE "user" ALTER id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN "user".id IS \'\'');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE candidate ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE candidate ALTER season_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN candidate.id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN candidate.season_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE correction ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE correction ALTER candidate_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE correction ALTER quiz_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN correction.id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN correction.candidate_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN correction.quiz_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE given_answer ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE given_answer ALTER candidate_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE given_answer ALTER quiz_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE given_answer ALTER answer_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN given_answer.id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN given_answer.candidate_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN given_answer.quiz_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN given_answer.answer_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE answer_candidate ALTER answer_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE answer_candidate ALTER candidate_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN answer_candidate.answer_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN answer_candidate.candidate_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE quiz DROP dropouts');
|
|
||||||
$this->addSql('ALTER TABLE quiz ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE quiz ALTER season_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN quiz.id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN quiz.season_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE season ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE season ALTER active_quiz_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN season.id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN season.active_quiz_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE answer ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE answer ALTER question_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN answer.id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN answer.question_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE season_user ALTER season_id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE season_user ALTER user_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN season_user.season_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN season_user.user_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE question ALTER id TYPE UUID');
|
|
||||||
$this->addSql('ALTER TABLE question ALTER quiz_id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN question.id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('COMMENT ON COLUMN question.quiz_id IS \'(DC2Type:uuid)\'');
|
|
||||||
$this->addSql('ALTER TABLE "user" ALTER id TYPE UUID');
|
|
||||||
$this->addSql('COMMENT ON COLUMN "user".id IS \'(DC2Type:uuid)\'');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20250402185128 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'add elimination table';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE elimination (id UUID NOT NULL, data JSON NOT NULL, PRIMARY KEY(id))');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE elimination');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,8 +7,8 @@ use App\Kernel;
|
|||||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
||||||
|
|
||||||
return static function (array $context): Kernel {
|
return static function (array $context): Kernel {
|
||||||
$appEnv = empty($context['APP_ENV']) ? 'prod' : (string) $context['APP_ENV'];
|
$appEnv = !empty($context['APP_ENV']) ? (string) $context['APP_ENV'] : 'prod';
|
||||||
$appDebug = empty($context['APP_DEBUG']) ? 'prod' !== $appEnv : filter_var($context['APP_DEBUG'], \FILTER_VALIDATE_BOOL);
|
$appDebug = !empty($context['APP_DEBUG']) ? filter_var($context['APP_DEBUG'], \FILTER_VALIDATE_BOOL) : 'prod' !== $appEnv;
|
||||||
|
|
||||||
return new Kernel($appEnv, $appDebug);
|
return new Kernel($appEnv, $appDebug);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Command;
|
|
||||||
|
|
||||||
use App\Repository\CandidateRepository;
|
|
||||||
use App\Repository\QuizRepository;
|
|
||||||
use Symfony\Component\Console\Attribute\AsCommand;
|
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
|
||||||
|
|
||||||
#[AsCommand(
|
|
||||||
name: 'app:test-command',
|
|
||||||
description: 'Add a short description for your command',
|
|
||||||
)]
|
|
||||||
class TestCommand extends Command
|
|
||||||
{
|
|
||||||
public function __construct(private readonly CandidateRepository $candidateRepository, private readonly QuizRepository $quizRepository)
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
|
||||||
{
|
|
||||||
new SymfonyStyle($input, $output);
|
|
||||||
|
|
||||||
dd($this->candidateRepository->getScores($this->quizRepository->find('1f00ff44-6f12-630e-9b87-67e78e97c05e')));
|
|
||||||
|
|
||||||
return Command::SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller;
|
|
||||||
|
|
||||||
use App\Enum\FlashType;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController as AbstractBaseController;
|
|
||||||
|
|
||||||
abstract class AbstractController extends AbstractBaseController
|
|
||||||
{
|
|
||||||
#[\Override]
|
|
||||||
protected function addFlash(FlashType|string $type, mixed $message): void
|
|
||||||
{
|
|
||||||
if ($type instanceof FlashType) {
|
|
||||||
$type = $type->value;
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::addFlash($type, $message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\Answer;
|
use App\Entity\Answer;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\Candidate;
|
use App\Entity\Candidate;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\Correction;
|
use App\Entity\Correction;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||||||
class DashboardController extends AbstractDashboardController
|
class DashboardController extends AbstractDashboardController
|
||||||
{
|
{
|
||||||
#[Route('/admin', name: 'admin')]
|
#[Route('/admin', name: 'admin')]
|
||||||
#[\Override]
|
|
||||||
public function index(): Response
|
public function index(): Response
|
||||||
{
|
{
|
||||||
// return parent::index();
|
// return parent::index();
|
||||||
@@ -45,14 +44,12 @@ class DashboardController extends AbstractDashboardController
|
|||||||
// return $this->render('some/path/my-dashboard.html.twig');
|
// return $this->render('some/path/my-dashboard.html.twig');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
|
||||||
public function configureDashboard(): Dashboard
|
public function configureDashboard(): Dashboard
|
||||||
{
|
{
|
||||||
return Dashboard::new()
|
return Dashboard::new()
|
||||||
->setTitle('TijdVoorDeTest');
|
->setTitle('TijdVoorDeTest');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
|
||||||
public function configureMenuItems(): iterable
|
public function configureMenuItems(): iterable
|
||||||
{
|
{
|
||||||
yield MenuItem::linkToDashboard('Dashboard', 'fa fa-home');
|
yield MenuItem::linkToDashboard('Dashboard', 'fa fa-home');
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\GivenAnswer;
|
use App\Entity\GivenAnswer;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\Question;
|
use App\Entity\Question;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\Quiz;
|
use App\Entity\Quiz;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\Season;
|
use App\Entity\Season;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller;
|
|
||||||
|
|
||||||
use App\Entity\Quiz;
|
|
||||||
use App\Entity\Season;
|
|
||||||
use App\Repository\CandidateRepository;
|
|
||||||
use App\Repository\SeasonRepository;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
|
||||||
|
|
||||||
#[AsController]
|
|
||||||
final class BackofficeController extends AbstractController
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
private readonly SeasonRepository $seasonRepository,
|
|
||||||
private readonly CandidateRepository $candidateRepository,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
#[Route('/backoffice/', name: 'app_backoffice_index')]
|
|
||||||
public function index(): Response
|
|
||||||
{
|
|
||||||
$seasons = $this->seasonRepository->findAll();
|
|
||||||
|
|
||||||
return $this->render('backoffice/index.html.twig', [
|
|
||||||
'seasons' => $seasons,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route('/backoffice/{seasonCode}', name: 'app_backoffice_season')]
|
|
||||||
public function season(Season $season): Response
|
|
||||||
{
|
|
||||||
return $this->render('backoffice/season.html.twig', [
|
|
||||||
'season' => $season,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route('/backoffice/{seasonCode}/{quiz}', name: 'app_backoffice_quiz')]
|
|
||||||
public function quiz(Season $season, Quiz $quiz): Response
|
|
||||||
{
|
|
||||||
return $this->render('backoffice/quiz.html.twig', [
|
|
||||||
'season' => $season,
|
|
||||||
'quiz' => $quiz,
|
|
||||||
'result' => $this->candidateRepository->getScores($quiz),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,14 +6,12 @@ namespace App\Controller;
|
|||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||||
|
|
||||||
#[AsController]
|
|
||||||
class LoginController extends AbstractController
|
class LoginController extends AbstractController
|
||||||
{
|
{
|
||||||
#[Route(path: '/login', name: 'app_login_login')]
|
#[Route(path: '/login', name: 'app_login')]
|
||||||
public function login(AuthenticationUtils $authenticationUtils): Response
|
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||||
{
|
{
|
||||||
// get the login error if there is one
|
// get the login error if there is one
|
||||||
@@ -28,7 +26,7 @@ class LoginController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route(path: '/logout', name: 'app_login_logout')]
|
#[Route(path: '/logout', name: 'app_logout')]
|
||||||
public function logout(): void
|
public function logout(): void
|
||||||
{
|
{
|
||||||
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller;
|
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
|
||||||
|
|
||||||
#[Route(path: '/backoffice/elimination')]
|
|
||||||
final class PrepareEliminationController extends AbstractController
|
|
||||||
{
|
|
||||||
#[Route('/prepare', name: 'app_prepare_elimination')]
|
|
||||||
public function index(): Response
|
|
||||||
{
|
|
||||||
return $this->render('prepare_elimination/index.html.twig', [
|
|
||||||
'controller_name' => 'PrepareEliminationController',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,34 +4,27 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\Answer;
|
|
||||||
use App\Entity\Candidate;
|
use App\Entity\Candidate;
|
||||||
use App\Entity\GivenAnswer;
|
|
||||||
use App\Entity\Question;
|
|
||||||
use App\Entity\Season;
|
use App\Entity\Season;
|
||||||
use App\Enum\FlashType;
|
use App\Enum\FlashType;
|
||||||
use App\Form\EnterNameType;
|
use App\Form\EnterNameType;
|
||||||
use App\Form\SelectSeasonType;
|
use App\Form\SelectSeasonType;
|
||||||
use App\Helpers\Base64;
|
use App\Helpers\Base64;
|
||||||
use App\Repository\AnswerRepository;
|
|
||||||
use App\Repository\CandidateRepository;
|
use App\Repository\CandidateRepository;
|
||||||
use App\Repository\GivenAnswerRepository;
|
|
||||||
use App\Repository\QuestionRepository;
|
use App\Repository\QuestionRepository;
|
||||||
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
#[AsController]
|
#[AsController]
|
||||||
final class QuizController extends AbstractController
|
class QuizController extends AbstractController
|
||||||
{
|
{
|
||||||
public const string SEASON_CODE_REGEX = '[A-Za-z\d]{5}';
|
public const string SEASON_CODE_REGEX = '[A-Za-z\d]{5}';
|
||||||
|
|
||||||
private const string CANDIDATE_HASH_REGEX = '[\w\-=]+';
|
private const string CANDIDATE_HASH_REGEX = '[\w\-=]+';
|
||||||
|
|
||||||
#[Route(path: '/', name: 'app_quiz_selectseason', methods: ['GET', 'POST'])]
|
#[Route(path: '/', name: 'select_season', methods: ['GET', 'POST'])]
|
||||||
public function selectSeason(Request $request): Response
|
public function selectSeason(Request $request): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(SelectSeasonType::class);
|
$form = $this->createForm(SelectSeasonType::class);
|
||||||
@@ -40,16 +33,15 @@ final class QuizController extends AbstractController
|
|||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_quiz_entername', ['seasonCode' => $data['season_code']]);
|
return $this->redirectToRoute('enter_name', ['seasonCode' => $data['season_code']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('quiz/select_season.html.twig', ['form' => $form]);
|
return $this->render('quiz/select_season.html.twig', ['form' => $form]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route(path: '/{seasonCode}', name: 'app_quiz_entername', requirements: ['seasonCode' => self::SEASON_CODE_REGEX])]
|
#[Route(path: '/{seasonCode}', name: 'enter_name', requirements: ['seasonCode' => self::SEASON_CODE_REGEX])]
|
||||||
public function enterName(
|
public function enterName(
|
||||||
Request $request,
|
Request $request,
|
||||||
#[MapEntity(mapping: ['seasonCode' => 'seasonCode'])]
|
|
||||||
Season $season,
|
Season $season,
|
||||||
): Response {
|
): Response {
|
||||||
$form = $this->createForm(EnterNameType::class);
|
$form = $this->createForm(EnterNameType::class);
|
||||||
@@ -60,7 +52,7 @@ final class QuizController extends AbstractController
|
|||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
$name = $data['name'];
|
$name = $data['name'];
|
||||||
|
|
||||||
return $this->redirectToRoute('app_quiz_quizpage', ['seasonCode' => $season->getSeasonCode(), 'nameHash' => Base64::base64UrlEncode($name)]);
|
return $this->redirectToRoute('quiz_page', ['seasonCode' => $season->getSeasonCode(), 'nameHash' => Base64::base64_url_encode($name)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('quiz/enter_name.twig', ['season' => $season, 'form' => $form]);
|
return $this->render('quiz/enter_name.twig', ['season' => $season, 'form' => $form]);
|
||||||
@@ -68,55 +60,29 @@ final class QuizController extends AbstractController
|
|||||||
|
|
||||||
#[Route(
|
#[Route(
|
||||||
path: '/{seasonCode}/{nameHash}',
|
path: '/{seasonCode}/{nameHash}',
|
||||||
name: 'app_quiz_quizpage',
|
name: 'quiz_page',
|
||||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'nameHash' => self::CANDIDATE_HASH_REGEX],
|
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'nameHash' => self::CANDIDATE_HASH_REGEX],
|
||||||
)]
|
)]
|
||||||
public function quizPage(
|
public function quizPage(
|
||||||
#[MapEntity(mapping: ['seasonCode' => 'seasonCode'])]
|
|
||||||
Season $season,
|
Season $season,
|
||||||
string $nameHash,
|
string $nameHash,
|
||||||
CandidateRepository $candidateRepository,
|
CandidateRepository $candidateRepository,
|
||||||
QuestionRepository $questionRepository,
|
QuestionRepository $questionRepository,
|
||||||
AnswerRepository $answerRepository,
|
|
||||||
GivenAnswerRepository $givenAnswerRepository,
|
|
||||||
Request $request,
|
|
||||||
): Response {
|
): Response {
|
||||||
$candidate = $candidateRepository->getCandidateByHash($season, $nameHash);
|
$candidate = $candidateRepository->getCandidateByHash($season, $nameHash);
|
||||||
|
|
||||||
if (!$candidate instanceof Candidate) {
|
if (!$candidate instanceof Candidate) {
|
||||||
if ($season->isPreregisterCandidates()) {
|
if ($season->isPreregisterCandidates() === false) {
|
||||||
$this->addFlash(FlashType::Danger, 'Candidate not found');
|
// create candidate
|
||||||
|
|
||||||
return $this->redirectToRoute('app_quiz_entername', ['seasonCode' => $season->getSeasonCode()]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$candidate = new Candidate(Base64::base64UrlDecode($nameHash));
|
$this->addFlash(FlashType::Danger->value, "Candidate {${Base64::base64_url_decode($nameHash)}} not found");
|
||||||
$candidateRepository->save($candidate);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ('POST' === $request->getMethod()) {
|
return $this->redirectToRoute('enter_name', ['seasonCode' => $season->getSeasonCode()]);
|
||||||
$answer = $answerRepository->findOneBy(['id' => $request->request->get('answer')]);
|
|
||||||
|
|
||||||
if (!$answer instanceof Answer) {
|
|
||||||
throw new BadRequestException('Invalid Answer ID');
|
|
||||||
}
|
|
||||||
|
|
||||||
$givenAnswer = (new GivenAnswer())
|
|
||||||
->setCandidate($candidate)
|
|
||||||
->setAnswer($answer)
|
|
||||||
->setQuiz($answer->getQuestion()->getQuiz());
|
|
||||||
$givenAnswerRepository->save($givenAnswer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$question = $questionRepository->findNextQuestionForCandidate($candidate);
|
$question = $questionRepository->findNextQuestionForCandidate($candidate);
|
||||||
|
|
||||||
if (!$question instanceof Question) {
|
|
||||||
$this->addFlash(FlashType::Success, 'Quiz completed');
|
|
||||||
|
|
||||||
return $this->redirectToRoute('app_quiz_entername', ['seasonCode' => $season->getSeasonCode()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO One first question record time
|
|
||||||
return $this->render('quiz/question.twig', ['candidate' => $candidate, 'question' => $question]);
|
return $this->render('quiz/question.twig', ['candidate' => $candidate, 'question' => $question]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class KrtekFixtures extends Fixture
|
|||||||
$manager->persist($season);
|
$manager->persist($season);
|
||||||
|
|
||||||
$season->setName('Krtek Weekend')
|
$season->setName('Krtek Weekend')
|
||||||
->setSeasonCode('krtek')
|
->setSeasonCode('12345')
|
||||||
->setPreregisterCandidates(true)
|
->setPreregisterCandidates(true)
|
||||||
->addCandidate(new Candidate('Claudia'))
|
->addCandidate(new Candidate('Claudia'))
|
||||||
->addCandidate(new Candidate('Eelco'))
|
->addCandidate(new Candidate('Eelco'))
|
||||||
@@ -77,7 +77,7 @@ class KrtekFixtures extends Fixture
|
|||||||
->addAnswer(new Answer('Met de auto'))
|
->addAnswer(new Answer('Met de auto'))
|
||||||
)
|
)
|
||||||
->addQuestion((new Question())
|
->addQuestion((new Question())
|
||||||
->setQuestion('Met wie keek de Krtek video bij binnenkomst?')
|
->setQuestion('Met wie keek de Kretek video bij binnenkomst?')
|
||||||
->addAnswer(new Answer('Claudia'))
|
->addAnswer(new Answer('Claudia'))
|
||||||
->addAnswer(new Answer('Eelco'))
|
->addAnswer(new Answer('Eelco'))
|
||||||
->addAnswer(new Answer('Elise'))
|
->addAnswer(new Answer('Elise'))
|
||||||
|
|||||||
@@ -135,6 +135,6 @@ class Candidate
|
|||||||
|
|
||||||
public function getNameHash(): string
|
public function getNameHash(): string
|
||||||
{
|
{
|
||||||
return Base64::base64UrlEncode($this->name);
|
return Base64::base64_url_encode($this->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Entity;
|
|
||||||
|
|
||||||
use App\Repository\EliminationRepository;
|
|
||||||
use Doctrine\DBAL\Types\Types;
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
|
|
||||||
use Symfony\Bridge\Doctrine\Types\UuidType;
|
|
||||||
use Symfony\Component\Uid\Uuid;
|
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: EliminationRepository::class)]
|
|
||||||
class Elimination
|
|
||||||
{
|
|
||||||
#[ORM\Id]
|
|
||||||
#[ORM\Column(type: UuidType::NAME, unique: true)]
|
|
||||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
|
||||||
#[ORM\CustomIdGenerator(class: UuidGenerator::class)]
|
|
||||||
private ?Uuid $id = null;
|
|
||||||
|
|
||||||
#[ORM\Column(type: Types::JSON)]
|
|
||||||
private array $data = [];
|
|
||||||
|
|
||||||
public function getId(): ?int
|
|
||||||
{
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getData(): array
|
|
||||||
{
|
|
||||||
return $this->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setData(array $data): static
|
|
||||||
{
|
|
||||||
$this->data = $data;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -34,7 +34,7 @@ class GivenAnswer
|
|||||||
#[ORM\JoinColumn(nullable: true)]
|
#[ORM\JoinColumn(nullable: true)]
|
||||||
private ?Answer $answer = null;
|
private ?Answer $answer = null;
|
||||||
|
|
||||||
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: false)]
|
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: false)]
|
||||||
private \DateTimeInterface $created;
|
private \DateTimeInterface $created;
|
||||||
|
|
||||||
public function getId(): ?Uuid
|
public function getId(): ?Uuid
|
||||||
@@ -78,7 +78,7 @@ class GivenAnswer
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCreated(): \DateTimeInterface
|
public function getCreated(): ?\DateTimeInterface
|
||||||
{
|
{
|
||||||
return $this->created;
|
return $this->created;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,23 +96,4 @@ class Question
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getErrors(): ?string
|
|
||||||
{
|
|
||||||
if (0 === \count($this->answers)) {
|
|
||||||
return 'This question has no answers';
|
|
||||||
}
|
|
||||||
|
|
||||||
$correctAnswers = $this->answers->filter(static fn (Answer $answer): ?bool => $answer->isRightAnswer())->count();
|
|
||||||
|
|
||||||
if (0 === $correctAnswers) {
|
|
||||||
return 'This question has no correct answers';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($correctAnswers > 1) {
|
|
||||||
return 'This question has multiple correct answers';
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ class Quiz
|
|||||||
#[ORM\OneToMany(targetEntity: Correction::class, mappedBy: 'quiz', orphanRemoval: true)]
|
#[ORM\OneToMany(targetEntity: Correction::class, mappedBy: 'quiz', orphanRemoval: true)]
|
||||||
private Collection $corrections;
|
private Collection $corrections;
|
||||||
|
|
||||||
#[ORM\Column(nullable: true)]
|
|
||||||
private ?int $dropouts = null;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->questions = new ArrayCollection();
|
$this->questions = new ArrayCollection();
|
||||||
@@ -105,16 +102,4 @@ class Quiz
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDropouts(): ?int
|
|
||||||
{
|
|
||||||
return $this->dropouts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setDropouts(?int $dropouts): static
|
|
||||||
{
|
|
||||||
$this->dropouts = $dropouts;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ enum FlashType: string
|
|||||||
case Danger = 'danger';
|
case Danger = 'danger';
|
||||||
case Warning = 'warning';
|
case Warning = 'warning';
|
||||||
case Info = 'info';
|
case Info = 'info';
|
||||||
case Light = 'light';
|
case Ligt = 'light';
|
||||||
case Dark = 'dark';
|
case Dark = 'dark';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,14 @@ namespace App\Form;
|
|||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class EnterNameType extends AbstractType
|
class EnterNameType extends AbstractType
|
||||||
{
|
{
|
||||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
public function __construct(private TranslatorInterface $translator)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
@@ -19,6 +22,14 @@ class EnterNameType extends AbstractType
|
|||||||
->add('name', TextType::class,
|
->add('name', TextType::class,
|
||||||
['required' => true, 'label' => $this->translator->trans('Enter your name')],
|
['required' => true, 'label' => $this->translator->trans('Enter your name')],
|
||||||
)
|
)
|
||||||
|
// ->add('submit', SubmitType::class, ['label' => 'Start quiz'])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
|
{
|
||||||
|
$resolver->setDefaults([
|
||||||
|
// Configure your form options here
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,17 +5,30 @@ declare(strict_types=1);
|
|||||||
namespace App\Helpers;
|
namespace App\Helpers;
|
||||||
|
|
||||||
use Safe\Exceptions\UrlException;
|
use Safe\Exceptions\UrlException;
|
||||||
|
use function rtrim;
|
||||||
|
|
||||||
class Base64
|
class Base64
|
||||||
{
|
{
|
||||||
public static function base64UrlEncode(string $input): string
|
private function __construct()
|
||||||
{
|
{
|
||||||
return rtrim(strtr(base64_encode($input), '+/', '-_'), '=');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @throws UrlException */
|
/**
|
||||||
public static function base64UrlDecode(string $input): string
|
* @param string $name name to hash
|
||||||
|
* @return string hashed name
|
||||||
|
*/
|
||||||
|
public static function base64_url_encode(string $name): string
|
||||||
{
|
{
|
||||||
return \Safe\base64_decode(strtr($input, '-_', '+/'), true);
|
return rtrim(strtr(base64_encode($name), '+/', '-_'), '=');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $hash hashed name
|
||||||
|
* @return string plaintext name
|
||||||
|
* @throws UrlException
|
||||||
|
*/
|
||||||
|
public static function base64_url_decode(string $hash): string
|
||||||
|
{
|
||||||
|
return \Safe\base64_decode(strtr($hash, '-_', '+/'), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,20 +5,14 @@ declare(strict_types=1);
|
|||||||
namespace App\Repository;
|
namespace App\Repository;
|
||||||
|
|
||||||
use App\Entity\Candidate;
|
use App\Entity\Candidate;
|
||||||
use App\Entity\Correction;
|
|
||||||
use App\Entity\Quiz;
|
|
||||||
use App\Entity\Season;
|
use App\Entity\Season;
|
||||||
use App\Helpers\Base64;
|
use App\Helpers\Base64;
|
||||||
use DateInterval;
|
|
||||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\ORM\Query\Expr\Join;
|
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Safe\Exceptions\UrlException;
|
use Safe\Exceptions\UrlException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends ServiceEntityRepository<Candidate>
|
* @extends ServiceEntityRepository<Candidate>
|
||||||
*
|
|
||||||
* @phpstan-type ResultArray array<string, array{0: Candidate, correct: int, time: DateInterval, corrections?: float, score: float}>
|
|
||||||
*/
|
*/
|
||||||
class CandidateRepository extends ServiceEntityRepository
|
class CandidateRepository extends ServiceEntityRepository
|
||||||
{
|
{
|
||||||
@@ -30,7 +24,7 @@ class CandidateRepository extends ServiceEntityRepository
|
|||||||
public function getCandidateByHash(Season $season, string $hash): ?Candidate
|
public function getCandidateByHash(Season $season, string $hash): ?Candidate
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$name = Base64::base64UrlDecode($hash);
|
$name = Base64::base64_url_decode($hash);
|
||||||
} catch (UrlException) {
|
} catch (UrlException) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -42,59 +36,4 @@ class CandidateRepository extends ServiceEntityRepository
|
|||||||
->setParameter('name', $name)
|
->setParameter('name', $name)
|
||||||
->getQuery()->getOneOrNullResult();
|
->getQuery()->getOneOrNullResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function save(Candidate $candidate, bool $flush = true): void
|
|
||||||
{
|
|
||||||
$this->getEntityManager()->persist($candidate);
|
|
||||||
|
|
||||||
if ($flush) {
|
|
||||||
$this->getEntityManager()->flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return ResultArray */
|
|
||||||
public function getScores(Quiz $quiz): array
|
|
||||||
{
|
|
||||||
$scoreTimeQb = $this->createQueryBuilder('c', 'c.id')
|
|
||||||
->select('c', 'sum(case when a.isRightAnswer = true then 1 else 0 end) as correct', 'max(ga.created) - min(ga.created) as time')
|
|
||||||
->join('c.givenAnswers', 'ga')
|
|
||||||
->join('ga.answer', 'a')
|
|
||||||
->where('ga.quiz = :quiz')
|
|
||||||
->groupBy('c.id')
|
|
||||||
->setParameter('quiz', $quiz);
|
|
||||||
|
|
||||||
$correctionsQb = $this->createQueryBuilder('c', 'c.id')
|
|
||||||
->select('c', 'cor.amount as corrections')
|
|
||||||
->innerJoin(Correction::class, 'cor', Join::WITH, 'cor.candidate = c and cor.quiz = :quiz')
|
|
||||||
->setParameter('quiz', $quiz);
|
|
||||||
|
|
||||||
$merged = array_merge_recursive($scoreTimeQb->getQuery()->getArrayResult(), $correctionsQb->getQuery()->getArrayResult());
|
|
||||||
|
|
||||||
return $this->sortResults($this->calculateScore($merged));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array<string, array{0: Candidate, correct: int, time: \DateInterval, corrections?: float}> $in
|
|
||||||
*
|
|
||||||
* @return ResultArray
|
|
||||||
*/
|
|
||||||
private function calculateScore(array $in): array
|
|
||||||
{
|
|
||||||
return array_map(static fn ($candidate): array => [
|
|
||||||
...$candidate,
|
|
||||||
'score' => $candidate['correct'] + ($candidate['corrections'] ?? 0.0),
|
|
||||||
], $in);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param ResultArray $results
|
|
||||||
*
|
|
||||||
* @return ResultArray
|
|
||||||
*/
|
|
||||||
private function sortResults(array $results): array
|
|
||||||
{
|
|
||||||
usort($results, static fn ($a, $b): int => $b['score'] <=> $a['score']);
|
|
||||||
|
|
||||||
return $results;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Repository;
|
|
||||||
|
|
||||||
use App\Entity\Elimination;
|
|
||||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @extends ServiceEntityRepository<Elimination>
|
|
||||||
*/
|
|
||||||
class EliminationRepository extends ServiceEntityRepository
|
|
||||||
{
|
|
||||||
public function __construct(ManagerRegistry $registry)
|
|
||||||
{
|
|
||||||
parent::__construct($registry, Elimination::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * @return Elimination[] Returns an array of Elimination objects
|
|
||||||
// */
|
|
||||||
// public function findByExampleField($value): array
|
|
||||||
// {
|
|
||||||
// return $this->createQueryBuilder('e')
|
|
||||||
// ->andWhere('e.exampleField = :val')
|
|
||||||
// ->setParameter('val', $value)
|
|
||||||
// ->orderBy('e.id', 'ASC')
|
|
||||||
// ->setMaxResults(10)
|
|
||||||
// ->getQuery()
|
|
||||||
// ->getResult()
|
|
||||||
// ;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function findOneBySomeField($value): ?Elimination
|
|
||||||
// {
|
|
||||||
// return $this->createQueryBuilder('e')
|
|
||||||
// ->andWhere('e.exampleField = :val')
|
|
||||||
// ->setParameter('val', $value)
|
|
||||||
// ->getQuery()
|
|
||||||
// ->getOneOrNullResult()
|
|
||||||
// ;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
@@ -17,13 +17,4 @@ class GivenAnswerRepository extends ServiceEntityRepository
|
|||||||
{
|
{
|
||||||
parent::__construct($registry, GivenAnswer::class);
|
parent::__construct($registry, GivenAnswer::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function save(GivenAnswer $givenAnswer, bool $flush = true): void
|
|
||||||
{
|
|
||||||
$this->getEntityManager()->persist($givenAnswer);
|
|
||||||
|
|
||||||
if ($flush) {
|
|
||||||
$this->getEntityManager()->flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ class QuestionRepository extends ServiceEntityRepository
|
|||||||
parent::__construct($registry, Question::class);
|
parent::__construct($registry, Question::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function findNextQuestionForCandidate(Candidate $candidate): ?Question
|
public function findNextQuestionForCandidate(Candidate $candidate): Question
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('q');
|
$qb = $this->createQueryBuilder('q');
|
||||||
|
|
||||||
return $qb->join('q.quiz', 'qz')
|
return $qb->join('q.quiz', 'qz')
|
||||||
->andWhere($qb->expr()->notIn('q.id', $this->getEntityManager()->createQueryBuilder()
|
->andWhere($qb->expr()->notIn('q.id', $this->getEntityManager()->createQueryBuilder()
|
||||||
->select('q1')
|
->select('ga.id')
|
||||||
->from(GivenAnswer::class, 'ga')
|
->from(GivenAnswer::class, 'ga')
|
||||||
->join('ga.answer', 'a')
|
->join('ga.answer', 'a')
|
||||||
->join('a.question', 'q1')
|
->join('a.question', 'q1')
|
||||||
@@ -38,6 +38,6 @@ class QuestionRepository extends ServiceEntityRepository
|
|||||||
->setMaxResults(1)
|
->setMaxResults(1)
|
||||||
->setParameter('candidate', $candidate)
|
->setParameter('candidate', $candidate)
|
||||||
->setParameter('quiz', $candidate->getSeason()->getActiveQuiz())
|
->setParameter('quiz', $candidate->getSeason()->getActiveQuiz())
|
||||||
->getQuery()->getOneOrNullResult();
|
->getQuery()->getSingleResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,4 @@ class QuizRepository extends ServiceEntityRepository
|
|||||||
{
|
{
|
||||||
parent::__construct($registry, Quiz::class);
|
parent::__construct($registry, Quiz::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function quizReault(Quiz $quiz): array {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Service;
|
|
||||||
|
|
||||||
use App\Repository\CandidateRepository;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @phpstan-import-type ResultArray from CandidateRepository
|
|
||||||
*/
|
|
||||||
class EliminationService
|
|
||||||
{
|
|
||||||
/** @phpstan-param ResultArray $result */
|
|
||||||
public function createEliminationFromResult(array $result): void {}
|
|
||||||
}
|
|
||||||
@@ -250,14 +250,5 @@
|
|||||||
},
|
},
|
||||||
"twig/extra-bundle": {
|
"twig/extra-bundle": {
|
||||||
"version": "v3.18.0"
|
"version": "v3.18.0"
|
||||||
},
|
|
||||||
"vincentlanglet/twig-cs-fixer": {
|
|
||||||
"version": "3.5",
|
|
||||||
"recipe": {
|
|
||||||
"repo": "github.com/symfony/recipes-contrib",
|
|
||||||
"branch": "main",
|
|
||||||
"version": "3.0",
|
|
||||||
"ref": "d42582ae1bce86fd43491d6264c738b0867f8ffe"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" data-bs-theme="dark">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
|
||||||
crossorigin="anonymous">
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
||||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
<link rel="stylesheet"
|
|
||||||
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
||||||
<link rel="icon"
|
|
||||||
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
|
||||||
<title>
|
|
||||||
{% block title %}Tijd voor de test{% endblock title %}
|
|
||||||
</title>
|
|
||||||
{% block stylesheets %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block javascripts %}
|
|
||||||
{% endblock %}
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
{% block nav %}
|
|
||||||
{{ include('backoffice/nav.html.twig') }}
|
|
||||||
{% endblock nav %}
|
|
||||||
<main>
|
|
||||||
<div class="container">
|
|
||||||
{# {% include "messages.html" %} #}
|
|
||||||
{% block body %}
|
|
||||||
{% endblock body %}
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
{% extends 'backoffice/base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Hello BackofficeController!{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<h2>{% trans %}Your Seasons{% endtrans %}</h2>
|
|
||||||
<table class="table table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">{% trans %}Name{% endtrans %}</th>
|
|
||||||
<th scope="col">{% trans %}Active Quiz{% endtrans %}</th>
|
|
||||||
<th scope="col">{% trans %}Season Code{% endtrans %}</th>
|
|
||||||
<th scope="col">{% trans %}Preregister?{% endtrans %}</th>
|
|
||||||
<th scope="col">{% trans %}Manage{% endtrans %}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for season in seasons %}
|
|
||||||
<tr class="align-middle">
|
|
||||||
<td>{{ season.name }}</td>
|
|
||||||
<td>
|
|
||||||
{% if season.activeQuiz %}
|
|
||||||
{{ season.activeQuiz.name }}
|
|
||||||
{% else %}
|
|
||||||
{% trans %} No active quiz {% endtrans %}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a {% if season.activeQuiz %}href="{{ path('app_quiz_entername', {seasonCode: season.seasonCode}) }}"
|
|
||||||
{% else %}class="disabled" {% endif %}>{{ season.seasonCode }}</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input class="form-check-input"
|
|
||||||
type="checkbox"
|
|
||||||
disabled
|
|
||||||
{% if season.preregisterCandidates %}checked{% endif %}
|
|
||||||
aria-label="Preregister Enabled">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="{{ path('app_backoffice_season', {seasonCode: season.seasonCode}) }}">{% trans %}Manage{% endtrans %}</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% else %}
|
|
||||||
EMPTY
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<a class="navbar-brand" href="#">Tijd voor de test</a>
|
|
||||||
<button class="navbar-toggler"
|
|
||||||
type="button"
|
|
||||||
data-bs-toggle="collapse"
|
|
||||||
data-bs-target="#navbarSupportedContent"
|
|
||||||
aria-controls="navbarSupportedContent"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link{% if 'app_backoffice_index' == app.current_route() %} active{% endif %}"
|
|
||||||
href="{{ path('app_backoffice_index') }}">{{ 'Seasons'|trans }}</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{% extends 'backoffice/base.html.twig' %}
|
|
||||||
{% block body %}
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
{% extends 'backoffice/base.html.twig' %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<p>
|
|
||||||
<h2>{{ 'Quiz'|trans }}: {{ quiz.season.name }} - {{ quiz.name }}</h2>
|
|
||||||
</p>
|
|
||||||
<div id="questions">
|
|
||||||
<p>
|
|
||||||
<h4>{{ 'Questions'|trans }}</h4>
|
|
||||||
</p>
|
|
||||||
<div class="accordion">
|
|
||||||
{% for question in quiz.questions %}
|
|
||||||
<div class="accordion-item">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button class="accordion-button collapsed"
|
|
||||||
type="button"
|
|
||||||
data-bs-toggle="collapse"
|
|
||||||
data-bs-target="#question-{{ loop.index0 }}"
|
|
||||||
aria-controls="question-{{ loop.index0 }}">
|
|
||||||
{% set questionErrors = question.getErrors %}
|
|
||||||
{% if questionErrors %}
|
|
||||||
<span data-bs-toggle="tooltip"
|
|
||||||
title="{{ questionErrors }}"
|
|
||||||
class="badge text-bg-danger rounded-pill me-2">!</span>
|
|
||||||
{% endif %}
|
|
||||||
{{ loop.index }}. {{ question.question }}
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
<div id="question-{{ loop.index0 }}"
|
|
||||||
class="accordion-collapse collapse">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<ul>
|
|
||||||
{% for answer in question.answers %}
|
|
||||||
<li {% if answer.isRightAnswer %}class="text-decoration-underline"{% endif %}>{{ answer.text }}</li>
|
|
||||||
{% else %}
|
|
||||||
{{ 'There are no answers for this question'|trans }}
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
EMPTY
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="scores">
|
|
||||||
<p>
|
|
||||||
<h4>{{ 'Score'|trans }}</h4>
|
|
||||||
</p>
|
|
||||||
<div class="btn-toolbar" role="toolbar">
|
|
||||||
<div class="btn-group btn-group-lg me-2">
|
|
||||||
<a class="btn btn-primary">{{ 'Start Elimination'|trans }}</a>
|
|
||||||
</div>
|
|
||||||
<div class="btn-group btn-group-lg">
|
|
||||||
<a class="btn btn-secondary">{{ 'Prepare Custom Elimination'|trans }}</a>
|
|
||||||
<a class="btn btn-secondary">{{ 'Load Prepared Elimination'|trans }}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p>{{ 'Number of dropouts:'|trans }} {{ quiz.dropouts }} </p>
|
|
||||||
<table class="table table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">{{ 'Candidate'|trans }}</th>
|
|
||||||
<th scope="col">{{ 'Correct Answers'|trans }}</th>
|
|
||||||
<th scope="col">{{ 'Corrections'|trans }}</th>
|
|
||||||
<th scope="col">{{ 'Score'|trans }}</th>
|
|
||||||
<th scope="col">{{ 'Time'|trans }}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for candidate in result %}
|
|
||||||
<tr class="table-{% if loop.revindex > quiz.dropouts %}success{% else %}danger{% endif %}">
|
|
||||||
<td>{{ candidate.0.name }}</td>
|
|
||||||
<td>{{ candidate.correct|default('0') }}</td>
|
|
||||||
<td>{{ candidate.corrections|default('0') }}</td>
|
|
||||||
<td>{{ candidate.score|default('x') }}</td>
|
|
||||||
<td>{{ candidate.time }}</td>
|
|
||||||
</tr>
|
|
||||||
{% else %}
|
|
||||||
<tr>
|
|
||||||
<td colspan="5">{{ 'No results'|trans }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
{% block javascripts %}
|
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
|
||||||
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
|
||||||
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% endblock javascripts %}
|
|
||||||
{% block title %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{% extends 'backoffice/base.html.twig' %}
|
|
||||||
{% block body %}
|
|
||||||
<p>
|
|
||||||
<h2>{{ 'Season'|trans }}: {{ season.name }}</h2>
|
|
||||||
</p>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 col-12">
|
|
||||||
<h4>{{ 'Quizzes'|trans }}</h4>
|
|
||||||
<div class="list-group">
|
|
||||||
{% for quiz in season.quizzes %}
|
|
||||||
<a class="list-group-item list-group-item-action{% if season.activeQuiz == quiz %} active{% endif %}"
|
|
||||||
href="{{ path('app_backoffice_quiz', {seasonCode: season.seasonCode, quiz: quiz.id}) }}">{{ quiz.name }}</a>
|
|
||||||
{% else %}
|
|
||||||
No quizzes
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 col-12">
|
|
||||||
<h4>{{ 'Candidates'|trans }}</h4>
|
|
||||||
<ul>
|
|
||||||
{% for candidate in season.candidates %}
|
|
||||||
<li>{{ candidate.name }}</li>{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock body %}
|
|
||||||
17
templates/base.html.twig
Normal file
17
templates/base.html.twig
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||||
|
<link rel="icon"
|
||||||
|
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||||
|
{% block stylesheets %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block javascripts %}
|
||||||
|
{% endblock %}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% block body %}{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -16,24 +16,22 @@
|
|||||||
|
|
||||||
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
|
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
|
||||||
<label for="username">Email</label>
|
<label for="username">Email</label>
|
||||||
<input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control"
|
<input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="email" required autofocus>
|
||||||
autocomplete="email" required autofocus>
|
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password"
|
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
|
||||||
required>
|
|
||||||
|
|
||||||
<input type="hidden" name="_csrf_token"
|
<input type="hidden" name="_csrf_token"
|
||||||
value="{{ csrf_token('authenticate') }}"
|
value="{{ csrf_token('authenticate') }}"
|
||||||
>
|
>
|
||||||
|
|
||||||
{#
|
{#
|
||||||
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
|
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
|
||||||
See https://symfony.com/doc/current/security/remember_me.html
|
See https://symfony.com/doc/current/security/remember_me.html
|
||||||
|
|
||||||
<div class="checkbox mb-3">
|
<div class="checkbox mb-3">
|
||||||
<input type="checkbox" name="_remember_me" id="_remember_me">
|
<input type="checkbox" name="_remember_me" id="_remember_me">
|
||||||
<label for="_remember_me">Remember me</label>
|
<label for="_remember_me">Remember me</label>
|
||||||
</div>
|
</div>
|
||||||
#}
|
#}
|
||||||
|
|
||||||
<button class="btn btn-lg btn-primary" type="submit">
|
<button class="btn btn-lg btn-primary" type="submit">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% extends 'quiz/base.html.twig' %}
|
{% extends "quiz/base.html.twig" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{{ season.name }}
|
{{ season.name }}
|
||||||
{{ form(form) }}
|
{{ form(form) }}
|
||||||
|
|||||||
@@ -1,16 +1,9 @@
|
|||||||
{% extends 'quiz/base.html.twig' %}
|
{% extends "quiz/base.html.twig" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
Candiadte: {{ candidate.name }}<br/>
|
||||||
|
|
||||||
{{ question.question }}<br/>
|
{{ question.question }}<br/>
|
||||||
<form method="post">
|
{% for answer in question.answers %}
|
||||||
{% for answer in question.answers %}
|
<input type="radio" name="answer" value="{{ answer.id }}"> {{ answer.text }}
|
||||||
<div>
|
{% endfor %}
|
||||||
<button class="btn btn-outline-success"
|
|
||||||
type="submit"
|
|
||||||
name="answer"
|
|
||||||
value="{{ answer.id }}">{{ answer.text }}</button>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
Weirdly enough this question has no answers...
|
|
||||||
{% endfor %}
|
|
||||||
</form>
|
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% extends 'quiz/base.html.twig' %}
|
{% extends "quiz/base.html.twig" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{{ form(form) }}
|
{{ form(form) }}
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|||||||
14
translations/messages+intl-icu.nl.xlf
Normal file
14
translations/messages+intl-icu.nl.xlf
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
|
||||||
|
<file source-language="nl" target-language="nl" datatype="plaintext" original="file.ext">
|
||||||
|
<header>
|
||||||
|
<tool tool-id="symfony" tool-name="Symfony"/>
|
||||||
|
</header>
|
||||||
|
<body>
|
||||||
|
<trans-unit id="RnI7jJT" resname="Enter your name">
|
||||||
|
<source>Enter your name</source>
|
||||||
|
<target>Voor je naam in</target>
|
||||||
|
</trans-unit>
|
||||||
|
</body>
|
||||||
|
</file>
|
||||||
|
</xliff>
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
'Active Quiz': 'Actieve test'
|
|
||||||
Candidate: Kandidaat
|
|
||||||
Candidates: Kandidaten
|
|
||||||
'Correct Answers': 'Goede antwoorden'
|
|
||||||
Corrections: Jokers
|
|
||||||
'Enter your name': 'Voor je naam in'
|
|
||||||
'Load Prepared Elimination': 'Laad voorbereide eliminatie'
|
|
||||||
Manage: Beheren
|
|
||||||
Name: Naam
|
|
||||||
'No active quiz': 'Geen actieve test'
|
|
||||||
'No results': 'Geen resultaten'
|
|
||||||
'Number of dropouts:': 'Aantal afvallers:'
|
|
||||||
'Prepare Custom Elimination': 'Bereid aangepaste eliminatie voor'
|
|
||||||
'Preregister?': 'Voorregistreren?'
|
|
||||||
Questions: Vragen
|
|
||||||
Quiz: Test
|
|
||||||
Quizzes: Tests
|
|
||||||
Score: Score
|
|
||||||
Season: Seizoen
|
|
||||||
'Season Code': Seizoenscode
|
|
||||||
Seasons: Seizoenen
|
|
||||||
'Start Elimination': 'Start eliminatie'
|
|
||||||
'There are no answers for this question': 'Er zijn geen antwoorden voor deze vraag'
|
|
||||||
Time: Tijd
|
|
||||||
'Your Seasons': 'Jouw seizoenen'
|
|
||||||
Reference in New Issue
Block a user