For Mule
For Mule
DOCTYPE html>
<html lang="ro">
<head>
<meta charset="UTF-8">
<title>Quiz Geometrie</title>
<style>
body { font-family: Arial; background: #f0f0f0; padding: 20px; }
.quiz-container { background: #fff; padding: 20px; border-radius: 10px; max-
width: 800px; margin: auto; }
.question { font-weight: bold; margin-top: 20px; }
.answers button { display: block; margin: 8px 0; padding: 10px; border: 1px
solid #ccc; border-radius: 5px; background: #e7e7e7; cursor: pointer; }
.answers button:hover { background: #d0d0d0; }
.correct { background-color: #c8f7c5; }
.wrong { background-color: #f8d7da; }
#score { margin-top: 20px; font-size: 20px; }
</style>
</head>
<body>
<script>
const intrebari = [
{
intrebare: "Care este formula ariei unui pătrat?",
corect: "A = l^2",
optiuni: ["A = πr^2", "A = (B + b) * h / 2", "A = ab * sin(θ)"]
},
{
intrebare: "Cum se calculează perimetrul unui cerc?",
corect: "P = 2πr",
optiuni: ["P = a + b + c", "P = 4 * l", "P = d^2 + 4"]
},
{
intrebare: "Formula teoremei lui Pitagora este:",
corect: "c^2 = a^2 + b^2",
optiuni: ["A = a * h / 2", "V = l^3", "A = d1 * d2 / 2"]
},
{
intrebare: "Care este aria unui triunghi echilateral?",
corect: "A = (l^2 * √3) / 4",
optiuni: ["A = ab * sin(θ)", "A = l * l", "A = πr^2"]
},
{
intrebare: "Formula ariei unui trapez este:",
corect: "A = (B + b) * h / 2",
optiuni: ["A = l * l", "A = πr^2", "A = ab * sin(θ)"]
}
];
function shuffle(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
shuffle(intrebari);
toate.forEach(opt => {
let btn = document.createElement('button');
btn.textContent = opt;
btn.onclick = () => {
if (btn.classList.contains("selected")) return;
quiz.appendChild(div);
quiz.appendChild(ans);
});
</script>
</body>
</html>