<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kuis Matematika Kelas 6 SD Interaktif (30 Soal Operasi Hitung Campuran)</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
body { background-color: #f1f5f9; color: #1e293b; padding-bottom: 60px; }
header { background: linear-gradient(135deg, #059669, #10b981); color: white; padding: 24px 16px; text-align: center; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
header p { font-size: 0.9rem; color: #ecfdf5; }
main { max-width: 900px; margin: 20px auto; padding: 0 16px; }
.sticky-bar { position: sticky; top: 12px; z-index: 20; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); padding: 12px 16px; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 4px 12px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.stat-box { background: #ecfdf5; border: 1px solid #a7f3d0; padding: 8px 12px; border-radius: 8px; }
.stat-label { font-size: 0.7rem; font-weight: 700; color: #059669; text-transform: uppercase; display: block; }
.stat-val { font-size: 1rem; font-weight: 800; color: #065f46; }
.btn { border: none; border-radius: 8px; padding: 10px 16px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: 0.2s; }
.btn-primary { background: #059669; color: white; }
.btn-primary:hover { background: #047857; }
.btn-reset { background: #e2e8f0; color: #475569; }
.btn-reset:hover { background: #cbd5e1; }
section { margin-bottom: 32px; }
.section-title { font-size: 1.1rem; font-weight: 700; color: #1e293b; border-bottom: 2px solid #059669; padding-bottom: 6px; margin-bottom: 16px; }
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.card { background: white; padding: 16px; border-radius: 12px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; justify-content: space-between; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tag { background: #d1fae5; color: #065f46; font-size: 0.75rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.question-text { font-size: 0.95rem; font-weight: 600; color: #0f172a; margin-bottom: 12px; line-height: 1.4; }
.options-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.opt-label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 0.85rem; font-weight: 600; cursor: pointer; background: #f8fafc; transition: 0.2s; }
.opt-label:hover { background: #f1f5f9; }
.opt-correct { border-color: #10b981 !important; background-color: #ecfdf5 !important; color: #065f46 !important; font-weight: 700; }
.opt-incorrect { border-color: #ef4444 !important; background-color: #fef2f2 !important; color: #991b1b !important; }
.status-badge { font-size: 0.75rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; display: none; }
.status-correct { background: #d1fae5; color: #065f46; display: inline-block; }
.status-incorrect { background: #fee2e2; color: #991b1b; display: inline-block; }
.status-empty { background: #fef3c7; color: #92400e; display: inline-block; }
.explanation { background: #ecfdf5; border-left: 4px solid #059669; padding: 8px 12px; font-size: 0.8rem; color: #334155; border-radius: 0 8px 8px 0; margin-top: 8px; display: none; }
/* Modal Style */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-content { background: white; border-radius: 12px; max-width: 400px; width: 100%; padding: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 16px; font-weight: 700; }
.modal-input { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; margin-top: 6px; font-size: 0.9rem; font-weight: 600; }
.error-msg { color: #dc2626; font-size: 0.75rem; font-weight: 700; margin-top: 4px; display: none; }
</style>
</head>
<body>
<header>
<h1>Kuis Matematika Kelas 6 SD Interaktif</h1>
<p>30 Soal Latihan: Operasi Hitung Campuran Bilangan Cacah</p>
</header>
<main>
<!-- Bar Progress -->
<div class="sticky-bar">
<div style="display: flex; gap: 12px;">
<div class="stat-box">
<span class="stat-label">Terjawab</span>
<span class="stat-val" id="progress-text">0 / 30 Soal</span>
</div>
<div class="stat-box" id="score-box" style="display: none; background: #ecfdf5; border-color: #a7f3d0;">
<span class="stat-label" style="color: #059669;">Skor Akhir</span>
<span class="stat-val" style="color: #065f46;" id="final-score">0 / 100</span>
</div>
</div>
<div style="display: flex; gap: 8px;">
<button onclick="openPasswordModal()" class="btn btn-primary">Periksa Jawaban</button>
<button onclick="resetForm()" class="btn btn-reset">Reset</button>
</div>
</div>
<form id="quiz-form" onsubmit="event.preventDefault();">
<section>
<h2 class="section-title">1. Operasi Hitung Campuran Bilangan Cacah (Soal 1–25)</h2>
<div class="grid-container" id="container-kat-1"></div>
</section>
<section>
<h2 class="section-title">2. Soal Cerita Operasi Hitung Campuran (Soal 26–30)</h2>
<div class="grid-container" id="container-kat-2"></div>
</section>
</form>
<div style="text-align: center; margin-top: 24px;">
<button onclick="openPasswordModal()" class="btn btn-primary" style="padding: 12px 24px; font-size: 1rem;">Periksa Semua Jawaban</button>
</div>
</main>
<!-- Modal Password Pengawas -->
<div id="password-modal" class="modal-overlay">
<div class="modal-content">
<div class="modal-header">
<span>Akses Guru / Pengawas</span>
<button onclick="closePasswordModal()" style="background:none; border:none; cursor:pointer; font-size: 1rem;">✕</button>
</div>
<form onsubmit="handlePasswordSubmit(event)">
<label style="font-size: 0.8rem; font-weight: 700; color: #475569;">PASSWORD PENGAWAS</label>
<input type="password" id="password-input" placeholder="Masukkan password..." class="modal-input">
<p id="password-error" class="error-msg">Password salah! Silakan coba lagi.</p>
<div style="display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px;">
<button type="button" onclick="closePasswordModal()" class="btn btn-reset">Batal</button>
<button type="submit" class="btn btn-primary">Verifikasi</button>
</div>
</form>
</div>
</div>
<script>
var questionsData = [
// Kategori 1: Operasi Hitung Campuran Biasa (1-25)
{ id: 1, kat: 1, text: "Hasil dari 250 + 40 × 15 adalah...", options: ["650", "850", "4.350", "8.500"], ans: 1, exp: "Dahulukan perkalian: 40 × 15 = 600. Kemudian penjumlahan: 250 + 600 = 850." },
{ id: 2, kat: 1, text: "Hasil dari 1.500 - 350 : 5 adalah...", options: ["1.430", "1.470", "230", "1.570"], ans: 0, exp: "Dahulukan pembagian: 350 : 5 = 70. Kemudian pengurangan: 1.500 - 70 = 1.430." },
{ id: 3, kat: 1, text: "Hasil dari (450 + 350) × 12 adalah...", options: ["4.650", "9.600", "8.600", "5.400"], ans: 1, exp: "Hitung operasi dalam kurung terlebih dahulu: 450 + 350 = 800. Kemudian perkalian: 800 × 12 = 9.600." },
{ id: 4, kat: 1, text: "Hasil dari 1.250 : 25 × 4 adalah...", options: ["12,5", "200", "50", "500"], ans: 1, exp: "Kerjakan dari kiri ke kanan: 1.250 : 25 = 50. Kemudian perkalian: 50 × 4 = 200." },
{ id: 5, kat: 1, text: "Hasil dari 750 + 1.200 : 6 - 150 adalah...", options: ["800", "950", "650", "1.750"], ans: 0, exp: "Dahulukan pembagian: 1.200 : 6 = 200. Kemudian dari kiri: 750 + 200 - 150 = 800." },
{ id: 6, kat: 1, text: "Hasil dari 3.500 - 125 × 8 + 450 adalah...", options: ["2.750", "2.950", "2.050", "3.050"], ans: 1, exp: "Kerjakan perkalian terlebih dahulu: 125 × 8 = 1.000. Kemudian: 3.500 - 1.000 + 450 = 2.950." },
{ id: 7, kat: 1, text: "Hasil dari (2.400 - 900) : 30 + 80 adalah...", options: ["130", "150", "110", "210"], ans: 0, exp: "Hitung dalam kurung: 2.400 - 900 = 1.500. Pembagian: 1.500 : 30 = 50. Penjumlahan: 50 + 80 = 130." },
{ id: 8, kat: 1, text: "Hasil dari 450 × 4 : 9 + 300 adalah...", options: ["400", "500", "600", "350"], ans: 1, exp: "Kerjakan dari kiri: 450 × 4 = 1.800. Pembagian: 1.800 : 9 = 200. Penjumlahan: 200 + 300 = 500." },
{ id: 9, kat: 1, text: "Hasil dari 2.000 - 450 × 3 : 5 adalah...", options: ["1.730", "1.630", "930", "1.830"], ans: 0, exp: "Dahulukan perkalian & pembagian: 450 × 3 = 1.350, lalu 1.350 : 5 = 270. Pengurangan: 2.000 - 270 = 1.730." },
{ id: 10, kat: 1, text: "Hasil dari 1.800 + (650 - 250) × 4 adalah...", options: ["3.400", "3.200", "8.000", "2.800"], ans: 0, exp: "Hitung dalam kurung: 650 - 250 = 400. Perkalian: 400 × 4 = 1.600. Penjumlahan: 1.800 + 1.600 = 3.400." },
{ id: 11, kat: 1, text: "Hasil dari 400 × 15 : 20 - 150 adalah...", options: ["150", "200", "250", "100"], ans: 0, exp: "Hitung dari kiri: 400 × 15 = 6.000. Pembagian: 6.000 : 20 = 300. Pengurangan: 300 - 150 = 150." },
{ id: 12, kat: 1, text: "Hasil dari 5.000 - (1.200 + 800) : 4 adalah...", options: ["4.500", "4.700", "950", "4.200"], ans: 0, exp: "Hitung dalam kurung: 1.200 + 800 = 2.000. Pembagian: 2.000 : 4 = 500. Pengurangan: 5.000 - 500 = 4.500." },
{ id: 13, kat: 1, text: "Hasil dari 75 × 8 + 360 : 12 adalah...", options: ["630", "650", "800", "570"], ans: 0, exp: "Perkalian & pembagian: 75 × 8 = 600 dan 360 : 12 = 30. Jumlahkan: 600 + 30 = 630." },
{ id: 14, kat: 1, text: "Hasil dari 3.600 : 40 + 120 × 5 adalah...", options: ["690", "750", "1.050", "590"], ans: 0, exp: "Pembagian & perkalian: 3.600 : 40 = 90 dan 120 × 5 = 600. Jumlahkan: 90 + 600 = 690." },
{ id: 15, kat: 1, text: "Hasil dari (1.500 + 2.500) : (100 - 20) adalah...", options: ["50", "40", "60", "25"], ans: 0, exp: "Kerjakan kedua tanda kurung: (1.500 + 2.500) = 4.000 dan (100 - 20) = 80. Pembagian: 4.000 : 80 = 50." },
{ id: 16, kat: 1, text: "Hasil dari 2.700 - 150 × 6 + 400 adalah...", options: ["2.200", "1.400", "2.400", "1.800"], ans: 0, exp: "Dahulukan perkalian: 150 × 6 = 900. Pengurangan dan penjumlahan dari kiri: 2.700 - 900 + 400 = 2.200." },
{ id: 17, kat: 1, text: "Hasil dari 800 + 600 : 15 × 5 adalah...", options: ["1.000", "1.200", "840", "960"], ans: 0, exp: "Hitung pembagian dan perkalian dari kiri: 600 : 15 = 40, 40 × 5 = 200. Penjumlahan: 800 + 200 = 1.000." },
{ id: 18, kat: 1, text: "Hasil dari (4.500 - 1.500) × 3 : 90 adalah...", options: ["100", "90", "120", "150"], ans: 0, exp: "Dalam kurung: 4.500 - 1.500 = 3.000. Perkalian: 3.000 × 3 = 9.000. Pembagian: 9.000 : 90 = 100." },
{ id: 19, kat: 1, text: "Hasil dari 1.200 × 5 - 4.500 : 9 adalah...", options: ["5.500", "5.000", "6.500", "4.500"], ans: 0, exp: "Perkalian: 1.200 × 5 = 6.000. Pembagian: 4.500 : 9 = 500. Pengurangan: 6.000 - 500 = 5.500." },
{ id: 20, kat: 1, text: "Hasil dari 3.200 : (80 + 80) × 25 adalah...", options: ["500", "400", "600", "250"], ans: 0, exp: "Dalam kurung: 80 + 80 = 160. Pembagian: 3.200 : 160 = 20. Perkalian: 20 × 25 = 500." },
{ id: 21, kat: 1, text: "Hasil dari 600 + 1.500 : 30 × 8 adalah...", options: ["1.000", "1.100", "560", "900"], ans: 0, exp: "Pembagian dulu: 1.500 : 30 = 50. Perkalian: 50 × 8 = 400. Jumlahkan: 600 + 400 = 1.000." },
{ id: 22, kat: 1, text: "Hasil dari 4.800 - 350 × 4 + 650 adalah...", options: ["4.050", "3.400", "4.150", "3.950"], ans: 0, exp: "Perkalian: 350 × 4 = 1.400. Pengurangan & penjumlahan dari kiri: 4.800 - 1.400 + 650 = 4.050." },
{ id: 23, kat: 1, text: "Hasil dari (1.800 + 600) : 12 × 5 adalah...", options: ["1.000", "800", "1.200", "600"], ans: 0, exp: "Dalam kurung: 1.800 + 600 = 2.400. Pembagian: 2.400 : 12 = 200. Perkalian: 200 × 5 = 1.000." },
{ id: 24, kat: 1, text: "Hasil dari 900 : 15 × (40 + 10) adalah...", options: ["3.000", "2.500", "3.500", "1.200"], ans: 0, exp: "Dalam kurung: 40 + 10 = 50. Dari kiri: 900 : 15 = 60. Perkalian: 60 × 50 = 3.000." },
{ id: 25, kat: 1, text: "Hasil dari 2.500 - 800 : 20 + 350 × 2 adalah...", options: ["3.160", "3.100", "2.460", "3.200"], ans: 0, exp: "Pembagian & perkalian: 800 : 20 = 40 dan 350 × 2 = 700. Dari kiri: 2.500 - 40 + 700 = 3.160." },
// Kategori 2: Soal Cerita Operasi Hitung Campuran (26-30)
{ id: 26, kat: 2, text: "Toko Grosir Jaya memiliki persediaan 45 dus mie instan. Setiap dus berisi 40 bungkus mie. Jika toko tersebut menjual 1.250 bungkus mie, berapa sisa mie instan di toko?", options: ["550 bungkus", "650 bungkus", "450 bungkus", "750 bungkus"], ans: 0, exp: "Total mie = 45 × 40 = 1.800. Sisa mie = 1.800 - 1.250 = 550 bungkus." },
{ id: 27, kat: 2, text: "Pak Budi memanen 1.500 kg apel. Apel tersebut dimasukkan ke dalam 25 keranjang sama banyak. Jika 10 keranjang apel sudah terjual, berapa kg apel yang belum terjual?", options: ["900 kg", "600 kg", "800 kg", "1.000 kg"], ans: 0, exp: "Isi tiap keranjang = 1.500 : 25 = 60 kg. Keranjang terjual = 10 × 60 = 600 kg. Sisa apel = 1.500 - 600 = 900 kg." },
{ id: 28, kat: 2, text: "Sekolah Dasar Harapan Bangsa menerima sumbangan 8 kotak buku cerita. Setiap kotak berisi 75 buku. Buku-buku tersebut dibagikan merata ke 6 kelas. Berapa buku yang diterima setiap kelas?", options: ["100 buku", "120 buku", "90 buku", "150 buku"], ans: 0, exp: "Total seluruh buku = 8 × 75 = 600 buku. Banyak buku per kelas = 600 : 6 = 100 buku." },
{ id: 29, kat: 2, text: "Panitia bakti sosial mengumpulkan uang kas Rp2.500.000,00. Panitia membeli 50 paket sembako seharga Rp35.000,00 per paket dan mendapat tambahan sumbangan uang Rp500.000,00. Berapa sisa uang panitia sekarang?", options: ["Rp1.250.000,00", "Rp1.750.000,00", "Rp750.000,00", "Rp1.500.000,00"], ans: 0, exp: "Belanja sembako = 50 × Rp35.000 = Rp1.750.000. Sisa uang = Rp2.500.000 - Rp1.750.000 + Rp500.000 = Rp1.250.000,00." },
{ id: 30, kat: 2, text: "Perpustakaan memiliki 12 rak buku. Setiap rak berisi 150 buku. Jika perpustakaan menambah 300 buku baru dan seluruh buku dibagikan sama banyak ke 15 sekolah binaan, berapa buku yang diterima setiap sekolah?", options: ["140 buku", "150 buku", "160 buku", "120 buku"], ans: 0, exp: "Buku awal = 12 × 150 = 1.800. Total buku = 1.800 + 300 = 2.100. Buku per sekolah = 2.100 : 15 = 140 buku." }
];
function renderQuiz() {
var labels = ["A", "B", "C", "D"];
for (var i = 0; i < questionsData.length; i++) {
var q = questionsData[i];
var container = document.getElementById("container-kat-" + q.kat);
if (!container) continue;
var card = document.createElement("div");
card.className = "card";
var optionsHTML = "";
for (var j = 0; j < q.options.length; j++) {
optionsHTML += '<label id="label-q' + q.id + '-opt' + j + '" class="opt-label">' +
'<input type="radio" name="question-' + q.id + '" value="' + j + '" onchange="updateProgress()">' +
'<span><strong>' + labels[j] + '.</strong> ' + q.options[j] + '</span>' +
'</label>';
}
card.innerHTML =
'<div>' +
'<div class="card-header">' +
'<span class="tag">Soal #' + q.id + '</span>' +
'<span id="status-' + q.id + '" class="status-badge"></span>' +
'</div>' +
'<p class="question-text">' + q.text + '</p>' +
'</div>' +
'<div>' +
'<div class="options-list">' + optionsHTML + '</div>' +
'<div id="exp-' + q.id + '" class="explanation">' +
'<strong>Pembahasan:</strong> ' + q.exp +
'</div>' +
'</div>';
container.appendChild(card);
}
}
function updateProgress() {
var answered = 0;
for (var i = 0; i < questionsData.length; i++) {
var q = questionsData[i];
var selected = document.querySelector('input[name="question-' + q.id + '"]:checked');
if (selected) answered++;
}
document.getElementById('progress-text').innerText = answered + " / 30 Soal";
}
var TEACHER_PASSWORD = "17081945";
function openPasswordModal() {
document.getElementById('password-input').value = "";
document.getElementById('password-error').style.display = "none";
document.getElementById('password-modal').style.display = "flex";
}
function closePasswordModal() {
document.getElementById('password-modal').style.display = "none";
}
function handlePasswordSubmit(e) {
e.preventDefault();
var input = document.getElementById('password-input').value;
if (input === TEACHER_PASSWORD) {
closePasswordModal();
checkAnswers();
} else {
document.getElementById('password-error').style.display = "block";
}
}
function checkAnswers() {
var correctCount = 0;
for (var i = 0; i < questionsData.length; i++) {
var q = questionsData[i];
var selected = document.querySelector('input[name="question-' + q.id + '"]:checked');
var statusEl = document.getElementById('status-' + q.id);
var expEl = document.getElementById('exp-' + q.id);
expEl.style.display = "block";
for (var j = 0; j < q.options.length; j++) {
var labelEl = document.getElementById('label-q' + q.id + '-opt' + j);
if (labelEl) {
labelEl.classList.remove('opt-correct', 'opt-incorrect');
}
}
if (selected) {
var userAns = parseInt(selected.value);
if (userAns === q.ans) {
correctCount++;
statusEl.className = "status-badge status-correct";
statusEl.innerText = "✓ Benar";
document.getElementById('label-q' + q.id + '-opt' + userAns).classList.add('opt-correct');
} else {
statusEl.className = "status-badge status-incorrect";
statusEl.innerText = "✗ Salah";
document.getElementById('label-q' + q.id + '-opt' + userAns).classList.add('opt-incorrect');
document.getElementById('label-q' + q.id + '-opt' + q.ans).classList.add('opt-correct');
}
} else {
statusEl.className = "status-badge status-empty";
statusEl.innerText = "Belum Diisi";
document.getElementById('label-q' + q.id + '-opt' + q.ans).classList.add('opt-correct');
}
}
var score = Math.round((correctCount / questionsData.length) * 100);
document.getElementById('score-box').style.display = "block";
document.getElementById('final-score').innerText = score + " / 100";
window.scrollTo({ top: 0, behavior: 'smooth' });
}
function resetForm() {
document.getElementById('quiz-form').reset();
for (var i = 0; i < questionsData.length; i++) {
var q = questionsData[i];
var statusEl = document.getElementById('status-' + q.id);
var expEl = document.getElementById('exp-' + q.id);
if (statusEl) statusEl.style.display = "none";
if (expEl) expEl.style.display = "none";
for (var j = 0; j < q.options.length; j++) {
var labelEl = document.getElementById('label-q' + q.id + '-opt' + j);
if (labelEl) {
labelEl.classList.remove('opt-correct', 'opt-incorrect');
}
}
}
document.getElementById('score-box').style.display = "none";
updateProgress();
}
renderQuiz();
</script>
</body>
</html>