mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-05 20:44:19 +01:00
Refactor Candidate and Quiz entities, rename Correction to QuizCandidate, and update related workflows
This commit removes nullable Uuid properties for consistency, transitions the Correction entity to QuizCandidate with associated migrations, refactors queries and repositories, adjusts related routes and controllers to use the new entity, updates front-end assets for elimination workflows, and standardizes route requirements and naming conventions.
This commit is contained in:
10
assets/controllers/elimination_controller.js
Normal file
10
assets/controllers/elimination_controller.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import {Controller} from '@hotwired/stimulus';
|
||||
|
||||
export default class extends Controller {
|
||||
next() {
|
||||
const currentUrl = window.location.href;
|
||||
const urlParts = currentUrl.split('/');
|
||||
urlParts.pop();
|
||||
window.location.href = urlParts.join('/');
|
||||
}
|
||||
}
|
||||
@@ -4,22 +4,3 @@ import * as bootstrap from 'bootstrap'
|
||||
|
||||
import './styles/app.scss'
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Check if we're on the elimination candidate screen
|
||||
const eliminationScreen = document.querySelector('.elimination-screen');
|
||||
if (eliminationScreen) {
|
||||
// Add event listener for any keypress
|
||||
document.addEventListener('keydown', function (event) {
|
||||
// Get the current URL
|
||||
const currentUrl = window.location.href;
|
||||
// Extract the elimination ID from the URL
|
||||
const urlParts = currentUrl.split('/');
|
||||
// Remove the candidate hash (last part of the URL)
|
||||
urlParts.pop();
|
||||
// Construct the URL to the main elimination page
|
||||
const redirectUrl = urlParts.join('/');
|
||||
// Redirect to the main elimination page
|
||||
window.location.href = redirectUrl;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user