<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* adminQuestionsModal.twig */
class __TwigTemplate_75bef74a25a0ec5559fef760a3bbe2a6595a7456c8de4260cd469657ba8632c6 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 1
        echo "<!DOCTYPE html>
<html lang=\"fr\">
    <head>
        <title>Maths Educ</title>
        <meta charset=\"UTF-8\">
        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
        <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN\" crossorigin=\"anonymous\">
        </script>

        <style>
            @font-face {
                font-family: 'MenuFont';
                src: url('Media/mathEducFont.ttf') format('truetype');
            }

            * {
                font-family: 'MenuFont';
            }
        </style>
    </head>

    <body>
        <div class=\"modal fade\" id=\"modalUpdateQuestions\">
            <div class=\"modal-dialog\" role=\"document\">
                <div class=\"modal-content\">
                    <div class=\"modal-header\">
                        <h5 class=\"modal-title\" id=\"exampleModalLabel\">Ajouter un chapitre</h5>
                    </div>
                    <form method=\"POST\" action=\"/admin/questions/update\">
                        <div class=\"modal-body\">
                            <div class=\"form-group\">
                                <input type=\"hidden\" class=\"form-control\" id=\"updateId\" name=\"id\">
                            </div>
                            <div class=\"form-group\">
                                <label for=\"name\">Contenu de la question :</label>
                                <input type=\"text\" class=\"form-control\" id=\"updateContent\" name=\"content\">
                            </div>
                            <div class=\"form-group\">
                                <label for=\"name\">Chapitre de la question :</label>
                                <select class=\"form-control\" id=\"updateIdChapter\" name=\"idChapter\">
                                    ";
        // line 41
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["chapters"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["chapter"]) {
            // line 42
            echo "                                    <option value=\"";
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["chapter"], "id", [], "any", false, false, false, 42), "html", null, true);
            echo "\" ";
            if ((twig_get_attribute($this->env, $this->source, $context["chapter"], "id", [], "any", false, false, false, 42) == twig_get_attribute($this->env, $this->source, ($context["question"] ?? null), "idchapter", [], "any", false, false, false, 42))) {
                echo "selected=\"selected\"";
            }
            echo ">";
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["chapter"], "name", [], "any", false, false, false, 42), "html", null, true);
            echo "</option>
                                    ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['chapter'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 44
        echo "                                </select>
                            </div>
                            <div class=\"form-group\">
                                <label for=\"name\">Réponse 1 de la question :</label>
                                <input type=\"hidden\" class=\"form-control\" id=\"updateIdAnswer1\" name=\"IdAnswer1\">
                                <input type=\"text\" class=\"form-control\" id=\"updateAnswer1\" name=\"answer1\">
                                <input type=\"radio\" name=\"correctAnswer\" ";
        // line 50
        if ((twig_get_attribute($this->env, $this->source, ($context["question"] ?? null), "idanswergood", [], "any", false, false, false, 50) == twig_get_attribute($this->env, $this->source, (($__internal_compile_0 = ($context["answers"] ?? null)) && is_array($__internal_compile_0) || $__internal_compile_0 instanceof ArrayAccess ? ($__internal_compile_0[0] ?? null) : null), "id", [], "any", false, false, false, 50))) {
            echo "checked=\"checked\"";
        }
        echo " value=\"1\"> Correct
                            </div>
                            <div class=\"form-group\">
                                <label for=\"name\">Réponse 2 de la question :</label>
                                <input type=\"hidden\" class=\"form-control\" id=\"updateIdAnswer2\" name=\"IdAnswer2\">
                                <input type=\"text\" class=\"form-control\" id=\"updateAnswer2\" name=\"answer2\">
                                <input type=\"radio\" name=\"correctAnswer\" ";
        // line 56
        if ((twig_get_attribute($this->env, $this->source, ($context["question"] ?? null), "idanswergood", [], "any", false, false, false, 56) == twig_get_attribute($this->env, $this->source, (($__internal_compile_1 = ($context["answers"] ?? null)) && is_array($__internal_compile_1) || $__internal_compile_1 instanceof ArrayAccess ? ($__internal_compile_1[1] ?? null) : null), "id", [], "any", false, false, false, 56))) {
            echo "checked=\"checked\"";
        }
        echo " value=\"2\"> Correct
                            </div>
                            <div class=\"form-group\">
                                <label for=\"name\">Réponse 3 de la question :</label>
                                <input type=\"hidden\" class=\"form-control\" id=\"updateIdAnswer3\" name=\"IdAnswer3\">
                                <input type=\"text\" class=\"form-control\" id=\"updateAnswer3\" name=\"answer3\">
                                <input type=\"radio\" name=\"correctAnswer\" ";
        // line 62
        if ((twig_get_attribute($this->env, $this->source, ($context["question"] ?? null), "idanswergood", [], "any", false, false, false, 62) == twig_get_attribute($this->env, $this->source, (($__internal_compile_2 = ($context["answers"] ?? null)) && is_array($__internal_compile_2) || $__internal_compile_2 instanceof ArrayAccess ? ($__internal_compile_2[2] ?? null) : null), "id", [], "any", false, false, false, 62))) {
            echo "checked=\"checked\"";
        }
        echo " value=\"3\"> Correct
                            </div>
                            <div class=\"form-group\">
                                <label for=\"name\">Réponse 4 de la question :</label>
                                <input type=\"hidden\" class=\"form-control\" id=\"updateIdAnswer4\" name=\"IdAnswer4\">
                                <input type=\"text\" class=\"form-control\" id=\"updateAnswer4\" name=\"answer4\">
                                <input type=\"radio\" name=\"correctAnswer\" ";
        // line 68
        if ((twig_get_attribute($this->env, $this->source, ($context["question"] ?? null), "idanswergood", [], "any", false, false, false, 68) == twig_get_attribute($this->env, $this->source, (($__internal_compile_3 = ($context["answers"] ?? null)) && is_array($__internal_compile_3) || $__internal_compile_3 instanceof ArrayAccess ? ($__internal_compile_3[3] ?? null) : null), "id", [], "any", false, false, false, 68))) {
            echo "checked=\"checked\"";
        }
        echo " value=\"4\"> Correct
                            </div>
                        </div>
                        <div class=\"modal-footer\">
                            <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Fermer</button>
                            <button type=\"submit\" class=\"btn btn-primary\">Enregistrer</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js\"></script>
        
        <script>            
            if (";
        // line 83
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["question"] ?? null), "id", [], "any", false, false, false, 83), "html", null, true);
        echo " != 0) {
                window.onload = showModal();

                function showModal() {
                    var modal = new bootstrap.Modal(document.getElementById('modalUpdateQuestions'));

                    var id = document.getElementById('updateId');
                    var content = document.getElementById('updateContent');

                    var IdAnswer1 = document.getElementById('updateIdAnswer1');
                    var IdAnswer2 = document.getElementById('updateIdAnswer2'); 
                    var IdAnswer3 = document.getElementById('updateIdAnswer3');
                    var IdAnswer4 = document.getElementById('updateIdAnswer4');  

                    var answer1 = document.getElementById('updateAnswer1');
                    var answer2 = document.getElementById('updateAnswer2'); 
                    var answer3 = document.getElementById('updateAnswer3');
                    var answer4 = document.getElementById('updateAnswer4'); 

                    id.value = \"";
        // line 102
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["question"] ?? null), "id", [], "any", false, false, false, 102), "html", null, true);
        echo "\";
                    content.value = \"";
        // line 103
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["question"] ?? null), "content", [], "any", false, false, false, 103), "html", null, true);
        echo "\";

                    IdAnswer1.value = \"";
        // line 105
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (($__internal_compile_4 = ($context["answers"] ?? null)) && is_array($__internal_compile_4) || $__internal_compile_4 instanceof ArrayAccess ? ($__internal_compile_4[0] ?? null) : null), "id", [], "any", false, false, false, 105), "html", null, true);
        echo "\";
                    IdAnswer2.value = \"";
        // line 106
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (($__internal_compile_5 = ($context["answers"] ?? null)) && is_array($__internal_compile_5) || $__internal_compile_5 instanceof ArrayAccess ? ($__internal_compile_5[1] ?? null) : null), "id", [], "any", false, false, false, 106), "html", null, true);
        echo "\"; 
                    IdAnswer3.value = \"";
        // line 107
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (($__internal_compile_6 = ($context["answers"] ?? null)) && is_array($__internal_compile_6) || $__internal_compile_6 instanceof ArrayAccess ? ($__internal_compile_6[2] ?? null) : null), "id", [], "any", false, false, false, 107), "html", null, true);
        echo "\";
                    IdAnswer4.value = \"";
        // line 108
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (($__internal_compile_7 = ($context["answers"] ?? null)) && is_array($__internal_compile_7) || $__internal_compile_7 instanceof ArrayAccess ? ($__internal_compile_7[3] ?? null) : null), "id", [], "any", false, false, false, 108), "html", null, true);
        echo "\"; 

                    answer1.value = \"";
        // line 110
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (($__internal_compile_8 = ($context["answers"] ?? null)) && is_array($__internal_compile_8) || $__internal_compile_8 instanceof ArrayAccess ? ($__internal_compile_8[0] ?? null) : null), "content", [], "any", false, false, false, 110), "html", null, true);
        echo "\";
                    answer2.value = \"";
        // line 111
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (($__internal_compile_9 = ($context["answers"] ?? null)) && is_array($__internal_compile_9) || $__internal_compile_9 instanceof ArrayAccess ? ($__internal_compile_9[1] ?? null) : null), "content", [], "any", false, false, false, 111), "html", null, true);
        echo "\"; 
                    answer3.value = \"";
        // line 112
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (($__internal_compile_10 = ($context["answers"] ?? null)) && is_array($__internal_compile_10) || $__internal_compile_10 instanceof ArrayAccess ? ($__internal_compile_10[2] ?? null) : null), "content", [], "any", false, false, false, 112), "html", null, true);
        echo "\";
                    answer4.value = \"";
        // line 113
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (($__internal_compile_11 = ($context["answers"] ?? null)) && is_array($__internal_compile_11) || $__internal_compile_11 instanceof ArrayAccess ? ($__internal_compile_11[3] ?? null) : null), "content", [], "any", false, false, false, 113), "html", null, true);
        echo "\";  

                    modal.show();
                }
            }
        </script>
    </body>
</html>
";
    }

    public function getTemplateName()
    {
        return "adminQuestionsModal.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  219 => 113,  215 => 112,  211 => 111,  207 => 110,  202 => 108,  198 => 107,  194 => 106,  190 => 105,  185 => 103,  181 => 102,  159 => 83,  139 => 68,  128 => 62,  117 => 56,  106 => 50,  98 => 44,  83 => 42,  79 => 41,  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "adminQuestionsModal.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\adminQuestionsModal.twig");
    }
}
