Skip to content

🤖 Cannot save fiddle #2337

@nhomaina-maker

Description

@nhomaina-maker

Error code

ERRW:0.75:L0.65:FHD0.1

Were you logged in?

Yes

Your username (if logged in)

No response

Your HTML

<!DOCTYPE html>
<html lang="vi">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ôn tập Phân thức Đại số - Toán 8</title>
    <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
    <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
    
    <style>
        :root { --primary: #1e40af; --secondary: #3b82f6; --bg: #f1f5f9; --white: #ffffff; }
        body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--bg); padding: 20px; color: #334155; }
        .container { max-width: 850px; margin: auto; background: var(--white); padding: 30px; border-radius: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
        h1 { text-align: center; color: var(--primary); text-transform: uppercase; margin-bottom: 5px; }
        h3 { color: var(--primary); border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-top: 30px; }
        .card { background: #fff; border: 1px solid #e2e8f0; padding: 20px; border-radius: 10px; margin-bottom: 20px; }
        .options label { display: block; margin: 10px 0; padding: 10px; border: 1px solid #f1f5f9; border-radius: 6px; cursor: pointer; transition: 0.2s; }
        .options label:hover { background: #eff6ff; border-color: var(--secondary); }
        .tf-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
        .tf-table th, .tf-table td { border: 1px solid #e2e8f0; padding: 12px; text-align: center; }
        .tf-table td:first-child { text-align: left; width: 70%; }
        .btn-submit { display: block; width: 100%; padding: 18px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 1.2rem; font-weight: bold; cursor: pointer; margin-top: 30px; }
        .btn-submit:hover { background: #1e3a8a; }
        #result-box { display: none; margin-top: 25px; padding: 20px; border-radius: 10px; text-align: center; background: #ecfdf5; border: 2px solid #10b981; }
    </style>
</head>
<body>

<div class="container">
    <h1>🚀 ĐẤU TRƯỜNG PHÂN THỨC 8</h1>
    <p style="text-align:center;">Phần: Khái niệm & Tính chất cơ bản</p>

    <h3>I. TRẮC NGHIỆM CHỌN ĐÁP ÁN ĐÚNG</h3>
    
    <div class="card">
        <p><strong>Câu 1:</strong> Biểu thức nào sau đây <b>không</b> phải là phân thức đại số?</p>
        <div class="options">
            <label><input type="radio" name="q1" value="A"> A. \(\frac{x+1}{y}\)</label>
            <label><input type="radio" name="q1" value="B"> B. \(\frac{3x-1}{0}\)</label>
            <label><input type="radio" name="q1" value="C"> C. \(x^2 + 2x + 1\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 2:</strong> Tử thức của phân thức \(\frac{5x-2}{3}\) là:</p>
        <div class="options">
            <label><input type="radio" name="q2" value="A"> A. \(3\)</label>
            <label><input type="radio" name="q2" value="B"> B. \(5x-2\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 3:</strong> Hai phân thức \(\frac{A}{B} = \frac{C}{D}\) khi:</p>
        <div class="options">
            <label><input type="radio" name="q3" value="A"> A. \(A \cdot D = B \cdot C\)</label>
            <label><input type="radio" name="q3" value="B"> B. \(A \cdot C = B \cdot D\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 4:</strong> Điều kiện xác định của phân thức \(\frac{x-3}{x+2}\) là:</p>
        <div class="options">
            <label><input type="radio" name="q4" value="A"> A. \(x \neq 3\)</label>
            <label><input type="radio" name="q4" value="B"> B. \(x \neq -2\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 5:</strong> Khẳng định nào sau đây đúng (\(M \neq 0\))?</p>
        <div class="options">
            <label><input type="radio" name="q5" value="A"> A. \(\frac{A}{B} = \frac{A \cdot M}{B \cdot M}\)</label>
            <label><input type="radio" name="q5" value="B"> B. \(\frac{A}{B} = \frac{A+M}{B+M}\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 6:</strong> Quy tắc đổi dấu nào sau đây là đúng?</p>
        <div class="options">
            <label><input type="radio" name="q6" value="A"> A. \(\frac{A}{B} = \frac{-A}{-B}\)</label>
            <label><input type="radio" name="q6" value="B"> B. \(\frac{A}{B} = \frac{-A}{B}\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 7:</strong> Rút gọn phân thức \(\frac{12x^3y^2}{18xy^3}\) ta được:</p>
        <div class="options">
            <label><input type="radio" name="q7" value="A"> A. \(\frac{2x^2}{3y}\)</label>
            <label><input type="radio" name="q7" value="B"> B. \(\frac{2x}{3y^2}\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 8:</strong> Giá trị của phân thức \(\frac{x+1}{x-1}\) tại \(x=2\) là:</p>
        <div class="options">
            <label><input type="radio" name="q8" value="A"> A. \(1\)</label>
            <label><input type="radio" name="q8" value="B"> B. \(3\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 9:</strong> Phân thức \(\frac{x-y}{3}\) bằng phân thức nào?</p>
        <div class="options">
            <label><input type="radio" name="q9" value="A"> A. \(\frac{y-x}{-3}\)</label>
            <label><input type="radio" name="q9" value="B"> B. \(\frac{y-x}{3}\)</label>
        </div>
    </div>

    <div class="card">
        <p><strong>Câu 10:</strong> Mẫu thức chung của \(\frac{1}{x(x+1)}\) và \(\frac{3}{(x+1)(x+2)}\) là:</p>
        <div class="options">
            <label><input type="radio" name="q10" value="A"> A. \(x(x+1)(x+2)\)</label>
            <label><input type="radio" name="q10" value="B"> B. \(x(x+2)\)</label>
        </div>
    </div>

    <h3>II. TRẮC NGHIỆM ĐÚNG - SAI</h3>

    <div class="card">
        <p><strong>Bài 1: Khái niệm & Điều kiện xác định</strong></p>
        <table class="tf-table">
            <tr><th>Phát biểu</th><th>Đúng</th><th>Sai</th></tr>
            <tr><td>a) \(2x+1\) là một phân thức đại số.</td><td><input type="radio" name="b1a" value="T"></td><td><input type="radio" name="b1a" value="F"></td></tr>
            <tr><td>b) Số 0 không phải là phân thức đại số.</td><td><input type="radio" name="b1b" value="F"></td><td><input type="radio" name="b1b" value="T"></td></tr>
            <tr><td>c) \(\frac{A}{B} = \frac{-A}{-B}\)</td><td><input type="radio" name="b1c" value="T"></td><td><input type="radio" name="b1c" value="F"></td></tr>
            <tr><td>d) Điều kiện xác định của \(\frac{2x}{x-5}\) là \(x \neq 5\).</td><td><input type="radio" name="b1d" value="T"></td><td><input type="radio" name="b1d" value="F"></td></tr>
        </table>
    </div>

    <div class="card">
        <p><strong>Bài 2: Kỹ năng dấu & Rút gọn (Biểu thức đối)</strong></p>
        <table class="tf-table">
            <tr><th>Phát biểu</th><th>Đúng</th><th>Sai</th></tr>
            <tr><td>a) \(y-x = -(x-y)\)</td><td><input type="radio" name="b2a" value="T"></td><td><input type="radio" name="b2a" value="F"></td></tr>
            <tr><td>b) Phân thức \(\frac{x-y}{y-x}\) rút gọn bằng \(1\).</td><td><input type="radio" name="b2b" value="F"></td><td><input type="radio" name="b2b" value="T"></td></tr>
            <tr><td>c) \(\frac{(x-2)^2}{2-x} = -(x-2)\)</td><td><input type="radio" name="b2c" value="T"></td><td><input type="radio" name="b2c" value="F"></td></tr>
            <tr><td>d) Rút gọn phân thức là chia cả tử và mẫu cho nhân tử chung.</td><td><input type="radio" name="b2d" value="T"></td><td><input type="radio" name="b2d" value="F"></td></tr>
        </table>
    </div>

    <div class="card">
        <p><strong>Bài 3: Chuỗi Quy đồng mẫu thức</strong></p>
        <table class="tf-table">
            <tr><th>Phát biểu</th><th>Đúng</th><th>Sai</th></tr>
            <tr><td>1. Phân tích: \(x^2-4 = (x-2)(x+2)\).</td><td><input type="radio" name="b31" value="T"></td><td><input type="radio" name="b31" value="F"></td></tr>
            <tr><td>2. MTC của \(\frac{1}{x^2-4}\) và \(\frac{1}{x(x-2)}\) là \(x(x-2)(x+2)\).</td><td><input type="radio" name="b32" value="T"></td><td><input type="radio" name="b32" value="F"></td></tr>
            <tr><td>3. Nhân tử phụ của phân thức thứ nhất là \(x\).</td><td><input type="radio" name="b33" value="T"></td><td><input type="radio" name="b33" value="F"></td></tr>
            <tr><td>4. Quy đồng phân thức thứ hai ta được \(\frac{x+2}{x(x-2)(x+2)}\).</td><td><input type="radio" name="b34" value="T"></td><td><input type="radio" name="b34" value="F"></td></tr>
        </table>
    </div>

    <button class="btn-submit" onclick="checkScore()">NỘP BÀI & KIỂM TRA KẾT QUẢ</button>

    <div id="result-box">
        <h2 id="score-text"></h2>
        <p id="feedback"></p>
    </div>
</div>

<script>
    function checkScore() {
        let score = 0;
        let total = 10 + 12;

        // Đáp án trắc nghiệm
        const mc = { q1:'B', q2:'B', q3:'A', q4:'B', q5:'A', q6:'A', q7:'A', q8:'B', q9:'A', q10:'A' };
        for(let key in mc) {
            if(document.querySelector(`input[name="${key}"]:checked`)?.value === mc[key]) score++;
        }

        // Đáp án Đúng/Sai
        const tf = { 
            b1a:'T', b1b:'T', b1c:'T', b1d:'T',
            b2a:'T', b2b:'T', b2c:'T', b2d:'T',
            b31:'T', b32:'T', b33:'T', b34:'T'
        };
        for(let key in tf) {
            if(document.querySelector(`input[name="${key}"]:checked`)?.value === 'T') score++;
        }

        const box = document.getElementById('result-box');
        const scoreText = document.getElementById('score-text');
        const feedback = document.getElementById('feedback');

        box.style.display = 'block';
        scoreText.innerText = `Điểm của em: ${score}/${total}`;
        
        if(score === total) feedback.innerText = "Tuyệt vời! Em đã làm chủ hoàn toàn kiến thức phân thức! 🎉";
        else if(score > total/2) feedback.innerText = "Khá lắm! Hãy rà soát lại các câu sai để hoàn thiện nhé! 💪";
        else feedback.innerText = "Em cần ôn lại bài kỹ hơn một chút. Cố gắng lên nào! 📚";

        window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
    }
</script>

</body>
</html>

Your JavaScript

function checkScore() {
        let score = 0;
        let total = 10 + 12;

        // Đáp án trắc nghiệm
        const mc = { q1:'B', q2:'B', q3:'A', q4:'B', q5:'A', q6:'A', q7:'A', q8:'B', q9:'A', q10:'A' };
        for(let key in mc) {
            if(document.querySelector(`input[name="${key}"]:checked`)?.value === mc[key]) score++;
        }

        // Đáp án Đúng/Sai
        const tf = { 
            b1a:'T', b1b:'T', b1c:'T', b1d:'T',
            b2a:'T', b2b:'T', b2c:'T', b2d:'T',
            b31:'T', b32:'T', b33:'T', b34:'T'
        };
        for(let key in tf) {
            if(document.querySelector(`input[name="${key}"]:checked`)?.value === 'T') score++;
        }

        const box = document.getElementById('result-box');
        const scoreText = document.getElementById('score-text');
        const feedback = document.getElementById('feedback');

        box.style.display = 'block';
        scoreText.innerText = `Điểm của em: ${score}/${total}`;
        
        if(score === total) feedback.innerText = "Tuyệt vời! Em đã làm chủ hoàn toàn kiến thức phân thức! 🎉";
        else if(score > total/2) feedback.innerText = "Khá lắm! Hãy rà soát lại các câu sai để hoàn thiện nhé! 💪";
        else feedback.innerText = "Em cần ôn lại bài kỹ hơn một chút. Cố gắng lên nào! 📚";

        window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
    }

Your CSS

:root {
  --primary: #1e40af;
  --secondary: #3b82f6;
  --bg: #f1f5f9;
  --white: #ffffff;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  padding: 20px;
  color: #334155;
}
.container {
  max-width: 850px;
  margin: auto;
  background: var(--white);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
h1 {
  text-align: center;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 5px;
}
h3 {
  color: var(--primary);
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
  margin-top: 30px;
}
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.options label {
  display: block;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}
.options label:hover {
  background: #eff6ff;
  border-color: var(--secondary);
}
.tf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.tf-table th,
.tf-table td {
  border: 1px solid #e2e8f0;
  padding: 12px;
  text-align: center;
}
.tf-table td:first-child {
  text-align: left;
  width: 70%;
}
.btn-submit {
  display: block;
  width: 100%;
  padding: 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 30px;
}
.btn-submit:hover {
  background: #1e3a8a;
}
#result-box {
  display: none;
  margin-top: 25px;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  background: #ecfdf5;
  border: 2px solid #10b981;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions