<!DOCTYPE html>
<!--
Copyright (C) 2021 Echedey López Romero <elr@disroot.org>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<html lang="es">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
        <meta name="author" content="Echedey López Romero" />
        <title>Test de Conducir</title>
        <link rel="stylesheet" href="./frameworks/bootstrap/css/bootstrap.min.css" />
        <script src="./frameworks/jquery/jquery-3.5.1.slim.min.js"></script>
        <script src="./frameworks/bootstrap/js/bootstrap.bundle.min.js"></script>
        <link rel="stylesheet" href="./css/common.css" />
        <script src="./js/common.js"></script>
    </head>
    <body class="container">
        <div class="row my-3">
            <div class="col"></div>
            <div class="col-md-8 col-sm-10 col-12 p-2">
                <h1 class="text-center">Test de Conducir</h1>
                <form action="<?= $_SERVER["PHP_SELF"] ?>" METHOD="GET" class="border border-primary rounded p-3">
                    <h2 class="text-center">Preguntas</h2>
                    <?php echo CrearPreguntas($Preguntas, $RespuestasUsuario, $Comprobar, $Puntuaciones); ?>
                    <div class="container">
                        <div class="row">
                            <div class="col-md-6 col-12 p-0 pr-md-1 m-md-0 mb-2">
                                <button type="submit" name="operacion" value="comprobar"
                                        class="btn btn-primary btn-lg btn-block">Comprobar</button>
                            </div>
                            <div class="col-md-6 col-12 p-0 pl-md-1 m-md-0">
                                <button type="reset" onclick="Reiniciar()"
                                        class="btn btn-danger btn-lg btn-block">Reiniciar</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="col"></div>
        </div>
        <div class="row mb-3">
            <div class="col-sm-3"></div>
            <div class="col-sm-6 col-12 border border-primary rounded p-2">
                <h2 class="text-center">Resultado</h2>
                <div class="container" id="resultado">
                    <?php echo ImprimirResultado($Comprobar, $Puntuaciones); ?>
                </div>
            </div>
            <div class="col-sm-3"></div>
        </div>
    </body>
</html>
