adapte le code de process_quiz au reste du projet qui maintenant gère plusieurs quizz et pas un seul : <?php
require_once 'databases/connexion.php';
function getQuizzes() {
    $pdo = new PDO('sqlite:db.sqlite');
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    $stmt = $pdo->prepare("SELECT * FROM quizzes");
    $stmt->execute();
    $quizzes = $stmt->fetchAll(PDO::FETCH_ASSOC);

    return $quizzes;
}
?> questions.php : <?php
require_once 'databases/connexion.php';
use Classes\Form\Type\TextQuestion;
use Classes\Form\Type\CheckboxQuestion;
use Classes\Form\Type\RadioQuestion;

function getQuestions($quiz_id) {
    $pdo = new PDO('sqlite:db.sqlite');
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    $stmt = $pdo->prepare("SELECT * FROM questions WHERE quiz_id = ?");

    $stmt->execute([$quiz_id]);
    $datas = $stmt->fetchAll(PDO::FETCH_ASSOC);
    var_dump($datas);

    $questions = [];

    foreach ($datas as $data) {
        $question = null;
        $uuid = $data['uuid'];
        $type = $data['type'];
        $label = $data['label'];
        $choices = json_decode($data['choices'], true);
        $correct = is_array(json_decode($data['correct'], true)) ? json_decode($data['correct'], true) : $data['correct'];

        switch ($type) {
            case 'radio':
                $question = new RadioQuestion($uuid, $type, $label, $choices, $correct);
                break;
            case 'checkbox':
                $question = new CheckboxQuestion($uuid, $type, $label, $choices, $correct);
                break;
            case 'text':
                $question = new TextQuestion($uuid, $type, $label, $correct);
                break;
        }
        if ($question !== null) {
            $questions[] = $question;
        }
    }

    return $questions;
}
?> questions_quizz.php : <?php

session_start();
require_once 'questions.php';
require 'Classes/autoloader.php';
Autoloader::register();

use Classes\Form\Type\TextQuestion;
use Classes\Form\Type\CheckboxQuestion;
use Classes\Form\Type\RadioQuestion;


$quiz_id = $_GET['quiz_id'];
var_dump($quiz_id);
$questions = getQuestions($quiz_id);

echo "<form method='POST' action='process_quiz.php'>";
echo "<h1> Répondez aux questions</h1>";
echo '<hr />';
foreach ($questions as $question) {
    echo $question->render().PHP_EOL;
}
echo '<button type="submit" class="btn btn-primary">Valider</button>';
echo "</form>";
?> process_quizz.php a adapter : <?php
session_start();

require_once 'questions.php';
require 'Classes/autoloader.php';
Autoloader::register();

$questions = getQuestions();
$score = 0;
$repBonne = [];
$repFausse = [];

if ($_SERVER["REQUEST_METHOD"] === "POST") {
    foreach ($_POST as $key => $userResponse) {
        $questionId = str_replace('question-', '', $key);

        $currentQuestion = null;
        foreach ($questions as $question) {
            if ($question->getUuid() === $questionId) {
                $currentQuestion = $question;
                break;
            }
        }
        $currentQuestion->setUserResponse($userResponse);
        if ($currentQuestion && $currentQuestion->isCorrect()) {
            $repBonne[] = $currentQuestion->getUuid();
            $score++;
        } else {
            $repFausse[] = $currentQuestion->getUuid();
        }
    }

    $_SESSION['quiz_score'] = $score;
    $_SESSION['repBonne'] = $repBonne;
    $_SESSION['repFausse'] = $repFausse;

    header("Location: correction.php");
    exit();
} else {
    header("Location: quizz.php");
    exit();
}
?>
index.php : <?php
require_once 'quizz.php';

$quizzes = getQuizzes();
echo "<h1>Choose a Quiz</h1>";
foreach ($quizzes as $quiz) {
    echo "<a href='questions_quizz.php?quiz_id={$quiz['id']}'>{$quiz['name']}</a><br>";
}
?>