{"id":217,"date":"2023-05-16T16:56:33","date_gmt":"2023-05-16T14:56:33","guid":{"rendered":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/?page_id=217"},"modified":"2023-05-16T17:06:26","modified_gmt":"2023-05-16T15:06:26","slug":"yest","status":"publish","type":"page","link":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/yest\/","title":{"rendered":"yest"},"content":{"rendered":"\n\n\n\n    <title>Tables de multiplication<\/title>\n    \n        body {\n            font-family: Arial, sans-serif;\n            background-color: #f2f2f2;\n            text-align: center;\n            margin: 0;\n            padding: 0;\n        }\n\n        h1 {\n            color: #333;\n        }\n\n        form {\n            margin-top: 30px;\n        }\n\n        label {\n            font-weight: bold;\n            display: block;\n            margin-bottom: 10px;\n        }\n\n        input[type=\u00a0\u00bbtext\u00a0\u00bb],\n        input[type=\u00a0\u00bbnumber\u00a0\u00bb] {\n            padding: 8px;\n            font-size: 16px;\n            border: 1px solid #ccc;\n            border-radius: 4px;\n            width: 200px;\n        }\n\n        button {\n            padding: 10px 20px;\n            background-color: #4caf50;\n            color: #fff;\n            border: none;\n            border-radius: 4px;\n            font-size: 16px;\n            cursor: pointer;\n        }\n\n        button:hover {\n            background-color: #45a049;\n        }\n\n        #score {\n            font-size: 24px;\n            font-weight: bold;\n            margin-top: 20px;\n        }\n    \n\n\n    <h1>Tables de multiplication<\/h1>\n    \n        <label for=\"username\">Pseudonyme:<\/label>\n        \n        <p id=\"question\"><\/p>\n        \n        <button type=\"submit\">Soumettre<\/button>\n    \n    <div id=\"score\"><\/div>\n\n    \n        const form = document.getElementById(&lsquo;quizForm&rsquo;);\n        const questionText = document.getElementById(&lsquo;question&rsquo;);\n        const answerInput = document.getElementById(&lsquo;answer&rsquo;);\n        const scoreDiv = document.getElementById(&lsquo;score&rsquo;);\n\n        let score = 0;\n        let timer = 60;\n        let timerInterval;\n\n        function generateQuestion() {\n            const num1 = Math.floor(Math.random() * 10) + 1;\n            const num2 = Math.floor(Math.random() * 10) + 1;\n            return `${num1} x ${num2}`;\n        }\n\n        function displayQuestion() {\n            const question = generateQuestion();\n            questionText.textContent = question;\n            answerInput.value = \u00a0\u00bb;\n            answerInput.focus();\n        }\n\n        function updateScore(isCorrect) {\n            if (isCorrect) {\n                score += 2;\n            } else {\n                score -= 1;\n            }\n            scoreDiv.textContent = `Score: ${score}`;\n        }\n\n        function handleSubmit(event) {\n            event.preventDefault();\n            const userAnswer = parseInt(answerInput.value, 10);\n            const [num1, num2] = questionText.textContent.split(&lsquo; x &lsquo;);\n            const correctAnswer = parseInt(num1, 10) * parseInt(num2, 10);\n            const isCorrect = userAnswer === correctAnswer;\n            updateScore(isCorrect);\n            displayQuestion();\n        }\n\n        timerInterval = setInterval(() =&gt; {\n            timer&#8211;;\n            if (timer === 0) {\n                clearInterval(timerInterval);\n                form.removeEventListener(&lsquo;submit&rsquo;, handleSubmit);\n                form.style.display = &lsquo;none&rsquo;;\n                scoreDiv.textContent = `Score final: ${score}`;\n            }\n        }, 1000);\n\n        form.addEventListener(&lsquo;submit&rsquo;, handleSubmit);\n\n        displayQuestion();\n    \n\n\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tables de multiplication body { font-family: Arial, sans-serif; background-color: #f2f2f2; text-align: center; margin: 0; padding: 0; } h1 { color: #333; } form { margin-top: 30px; } label { font-weight: bold; display: block; margin-bottom: 10px; } input[type=\u00a0\u00bbtext\u00a0\u00bb], input[type=\u00a0\u00bbnumber\u00a0\u00bb] { padding: 8px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px; width: 200px; } button { padding: &hellip; <a href=\"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/yest\/\" class=\"more-link\">Continuer la lecture de <span class=\"screen-reader-text\">yest<\/span><\/a><\/p>\n","protected":false},"author":144,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-217","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/wp-json\/wp\/v2\/pages\/217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/wp-json\/wp\/v2\/users\/144"}],"replies":[{"embeddable":true,"href":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/wp-json\/wp\/v2\/comments?post=217"}],"version-history":[{"count":1,"href":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/wp-json\/wp\/v2\/pages\/217\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/wp-json\/wp\/v2\/pages\/217\/revisions\/223"}],"wp:attachment":[{"href":"https:\/\/mediascol.ac-clermont.fr\/cm-au-college\/wp-json\/wp\/v2\/media?parent=217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}