{"id":469,"date":"2024-10-25T14:30:23","date_gmt":"2024-10-25T07:30:23","guid":{"rendered":"https:\/\/sunflower-math.com\/?p=469"},"modified":"2024-10-26T10:29:58","modified_gmt":"2024-10-26T03:29:58","slug":"dien-khuyet","status":"publish","type":"post","link":"https:\/\/sunflower-math.com\/?p=469","title":{"rendered":"\u0111i\u1ec1n khuy\u1ebft"},"content":{"rendered":"\n<p><br><br>B\u00e0i Test \u0110i\u1ec1n Khuy\u1ebft<br><\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"vi\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>B\u00e0i Test Tr\u1eafc Nghi\u1ec7m<\/title>\n    <link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/tikzjax.com\/v1\/fonts.css\">\n    <script src=\"https:\/\/tikzjax.com\/v1\/tikzjax.js\"><\/script>\n    <link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/KaTeX\/0.13.18\/katex.min.css\">\n    <script defer src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/KaTeX\/0.13.18\/katex.min.js\"><\/script>\n    <script defer src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/KaTeX\/0.13.18\/contrib\/auto-render.min.js\"\n            onload=\"renderMathInElement(document.body, {\n            delimiters: [\n                {left: '<p class=\"ql-center-displayed-equation\" style=\"line-height: 20px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sunflower-math.com\/wp-content\/ql-cache\/quicklatex.com-77baa04537073105b02318b995c7964b_l3.svg\" height=\"20\" width=\"70\" class=\"ql-img-displayed-equation \" alt=\"&#92;&#91;&#39;&#44;&#32;&#114;&#105;&#103;&#104;&#116;&#58;&#32;&#39;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>', display: true},\n                {left: '$', right: '$', display: false}\n                        ]\n                    });\"><\/script>\n            <script>\n                document.addEventListener(\"DOMContentLoaded\", function() {\n                    \/\/ Render TikZ diagrams\n                    tikzjax.render(document.body);\n                });\n            <\/script>    \n    <style>\n        body {\n            font-family: Palatyno;\n            line-height: 1.6;\n            font-size: 20px;\n        }\n        h1 {\n            font-size: 1em;\n            color: #333;\n        }\n        .question {\n            margin-bottom: 10px;\n            counter-increment: question;\n        }\n        .question::before {\n            content: \"C\u00e2u \" counter(question) \". \";\n            font-weight: bold;\n            display: inline;\n        }\n        h2 {\n            font-size: 20px;\n            font-weight: normal;\n            margin-bottom: 0;\n            display: inline;\n        }\n        .blank-container {\n            display: inline-flex;\n            align-items: center;\n            margin-left: 10px;\n        }\n        .blank {\n            border-bottom: 1px solid #333;\n            width: 200px;\n            text-align: center;\n        }\n        #result {\n            margin-top: 20px;\n            font-weight: bold;\n        }\n        .preview {\n            font-weight: bold;\n            margin-left: 10px;\n        }\n    <\/style>\n<\/head>\n<body>\n\n    <h1>\u0110\u1ec0 KI\u1ec2M TRA TR\u1eaeC NHI\u1ec6M NHI\u1ec0U L\u1ef0A CH\u1eccN \u0110\u00daNG<\/h1>\n\n    <form id=\"quiz-form\">\n        <div class=\"question\">\n            <h2>Ph\u01b0\u01a1ng tr\u00ecnh b\u1eadc hai: $ax^2 + bx + c = 0$ c\u00f3 nghi\u1ec7m: \n                <span class=\"blank-container\">\n                    <input type=\"text\" class=\"blank\" data-value=\"x = \\dfrac{-b \\pm \\sqrt{\\Delta}}{2a}\" placeholder=\"\u0110i\u1ec1n v\u00e0o \u0111\u00e2y\" oninput=\"updatePreview(this)\">\n                <\/span>\n                <span class=\"preview\" id=\"preview-1\"><\/span>\n            <\/h2>\n        <\/div>\n\n        <div class=\"question\">\n            <h2>Ph\u01b0\u01a1ng tr\u00ecnh b\u1eadc hai: $ax^2 + bx + c = 0$ c\u00f3 nghi\u1ec7m: \n                <span class=\"blank-container\">\n                    <input type=\"text\" class=\"blank\" data-value=\"x = \\dfrac{-b \\pm \\sqrt{\\Delta}}{2a}\" placeholder=\"\u0110i\u1ec1n v\u00e0o \u0111\u00e2y\" oninput=\"updatePreview(this)\">\n                <\/span>\n                <span class=\"preview\" id=\"preview-2\"><\/span>\n            <\/h2>\n        <\/div>\n\n        <div class=\"question\">\n            <h2>Ph\u01b0\u01a1ng tr\u00ecnh b\u1eadc hai: $ax^2 + bx + c = 0$ c\u00f3 nghi\u1ec7m: \n                <span class=\"blank-container\">\n                    <input type=\"text\" class=\"blank\" data-value=\"x = \\dfrac{-b \\pm \\sqrt{\\Delta}}{2a}\" placeholder=\"\u0110i\u1ec1n v\u00e0o \u0111\u00e2y\" oninput=\"updatePreview(this)\">\n                <\/span>\n                <span class=\"preview\" id=\"preview-3\"><\/span>\n            <\/h2>\n        <\/div>\n\n        <button type=\"button\" id=\"submit-button\">N\u1ed9p b\u00e0i<\/button>\n    <\/form>\n\n    <div id=\"result\"><\/div>\n\n    <script>\n        document.getElementById('submit-button').addEventListener('click', calculateScore);\n\n        function updatePreview(input) {\n            const previewElement = input.closest('.question').querySelector('.preview');\n            const userAnswer = input.value.trim();\n            previewElement.innerHTML = userAnswer ? `<p class=\"ql-center-displayed-equation\" style=\"line-height: 14px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sunflower-math.com\/wp-content\/ql-cache\/quicklatex.com-b33f90f17a54db694571edfd9c40f7cc_l3.svg\" height=\"14\" width=\"93\" class=\"ql-img-displayed-equation \" alt=\"&#92;&#91;&#36;&#123;&#117;&#115;&#101;&#114;&#65;&#110;&#115;&#119;&#101;&#114;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>` : '';\n            renderMathInElement(previewElement);\n        }\n\n        function normalizeLatex(latex) {\n            \/\/ Lo\u1ea1i b\u1ecf kho\u1ea3ng tr\u1eafng th\u1eeba\n            latex = latex.replace(\/\\s+\/g, ' ').trim(); \/\/ Thay th\u1ebf nhi\u1ec1u kho\u1ea3ng tr\u1eafng b\u1eb1ng m\u1ed9t kho\u1ea3ng tr\u1eafng duy nh\u1ea5t\n        \n            \/\/ Lo\u1ea1i b\u1ecf kho\u1ea3ng tr\u1eafng trong c\u00e1c ph\u1ea7n t\u1eed c\u1ee5 th\u1ec3\n            latex = latex.replace(\/\\\\dfrac{([^}]*)}{([^}]*)}\/g, (match, num, denom) => {\n                const normalizedNum = num.replace(\/\\s+\/g, ' ').trim();\n                const normalizedDenom = denom.replace(\/\\s+\/g, ' ').trim();\n                return `\\\\dfrac{${normalizedNum}}{${normalizedDenom}}`;\n            });\n        \n            \/\/ Thay th\u1ebf c\u00e1c k\u00fd hi\u1ec7u gi\u1ed1ng nhau\n            latex = latex.replace(\/\\\\pm\/g, '\u00b1'); \/\/ Thay th\u1ebf \\pm b\u1eb1ng \u00b1\n            latex = latex.replace(\/\\\\sqrt{([^}]*)}\/g, '\u221a($1)'); \/\/ Thay th\u1ebf \\sqrt{}\n            latex = latex.replace(\/\\\\frac{([^}]*)}{([^}]*)}\/g, '($1)\/($2)'); \/\/ Thay th\u1ebf \\frac{}\n            latex = latex.replace(\/\\\\dfrac{([^}]*)}{([^}]*)}\/g, '($1)\/($2)'); \/\/ Thay th\u1ebf \\dfrac{}\n        \n            return latex;\n        }\n        \n        function calculateScore() {\n            const questions = document.querySelectorAll('.question');\n            let totalScore = 0;\n\n            questions.forEach((question) => {\n                const blank = question.querySelector('input[type=\"text\"]');\n                const userAnswer = normalizeLatex(blank.value.trim());\n                const correctAnswer = normalizeLatex(blank.dataset.value.trim());\n\n                \/\/ So s\u00e1nh n\u1ed9i dung \u0111\u00e3 \u0111\u01b0\u1ee3c chu\u1ea9n h\u00f3a\n                if (userAnswer === correctAnswer) {\n                    totalScore++;\n                }\n            });\n\n            document.getElementById('result').innerText = `T\u1ed5ng \u0111i\u1ec3m: ${totalScore} \/ ${2*questions.length}`;\n        }\n    <\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>B\u00e0i Test \u0110i\u1ec1n Khuy\u1ebft B\u00e0i Test Tr\u1eafc Nghi\u1ec7m \u0110\u1ec0 KI\u1ec2M TRA TR\u1eaeC NHI\u1ec6M NHI\u1ec0U L\u1ef0A CH\u1eccN \u0110\u00daNG Ph\u01b0\u01a1ng tr\u00ecnh b\u1eadc hai: $ax^2 + bx + c = 0$ c\u00f3 nghi\u1ec7m: Ph\u01b0\u01a1ng tr\u00ecnh b\u1eadc hai: $ax^2 + bx + c = 0$ c\u00f3 nghi\u1ec7m: Ph\u01b0\u01a1ng tr\u00ecnh b\u1eadc hai: $ax^2 + bx + c = 0$ c\u00f3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-469","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sunflower-math.com\/index.php?rest_route=\/wp\/v2\/posts\/469","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunflower-math.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunflower-math.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunflower-math.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunflower-math.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=469"}],"version-history":[{"count":27,"href":"https:\/\/sunflower-math.com\/index.php?rest_route=\/wp\/v2\/posts\/469\/revisions"}],"predecessor-version":[{"id":505,"href":"https:\/\/sunflower-math.com\/index.php?rest_route=\/wp\/v2\/posts\/469\/revisions\/505"}],"wp:attachment":[{"href":"https:\/\/sunflower-math.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunflower-math.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunflower-math.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}