This Chat is read-only. Login to resume chatting.
<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>De wet van Ohm</title>
<style>
body { font-family: Arial, sans-serif; background-color: #f0f8ff; color: #333; margin: 0; padding: 0; }
.container { max-width: 800px; margin: auto; padding: 20px; background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); }
h1 { text-align: center; color: #0066cc; }
.question { margin-bottom: 20px; }
.options { list-style-type: none; padding: 0; }
.options li { margin-bottom: 10px; }
.feedback { margin-top: 10px; display: none; }
.feedback.correct { color: green; }
.feedback.incorrect { color: red; }
.score { text-align: center; margin-top: 20px; }
.retry-button { display: block; width: 100%; max-width: 300px; margin: 20px auto; padding: 10px; background-color: #0066cc; color: #fff; text-align: center; text-decoration: none; border-radius: 5px; }
</style>
</head>
<body>
<div class="container">
<h1>De wet van Ohm</h1>
<div id="quiz"></div>
<div class="score" id="score"></div>
<a href="#" class="retry-button" id="retry">Probeer opnieuw</a>
</div>
<script>
const quizData = {
"title": "De wet van Ohm",
"questions": [
{
"question": "Wat is de wet van Ohm?",
"options": [
"De spanning is gelijk aan de stroomsterkte maal de weerstand.",
"De stroomsterkte is gelijk aan de spanning gedeeld door de weerstand.",
"De weerstand is gelijk aan de spanning maal de stroomsterkte.",
"Geen van de bovenstaande."
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. De wet van Ohm zegt dat V = IR, dus de stroomsterkte I is gelijk aan de spanning V gedeeld door de weerstand R.",
"1": "Goed zo! De wet van Ohm zegt dat V = IR, dus de stroomsterkte I is gelijk aan de spanning V gedeeld door de weerstand R.",
"2": "Dat is niet correct. De wet van Ohm zegt dat V = IR, dus de stroomsterkte I is gelijk aan de spanning V gedeeld door de weerstand R.",
"3": "Dat is niet correct. De wet van Ohm zegt dat V = IR, dus de stroomsterkte I is gelijk aan de spanning V gedeeld door de weerstand R."
}
},
{
"question": "Welke formule gebruik je om de stroomsterkte te berekenen?",
"options": [
"I = VR",
"I = V/R",
"I = R/V",
"I = V + R"
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. De juiste formule is I = V/R.",
"1": "Goed zo! De juiste formule is I = V/R.",
"2": "Dat is niet correct. De juiste formule is I = V/R.",
"3": "Dat is niet correct. De juiste formule is I = V/R."
}
},
{
"question": "Wat gebeurt er met de stroomsterkte als de weerstand toeneemt (met een constante spanning)?",
"options": [
"De stroomsterkte neemt toe.",
"De stroomsterkte neemt af.",
"De stroomsterkte blijft hetzelfde.",
"De stroomsterkte fluctueert."
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"1": "Goed zo! Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"2": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"3": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning."
}
},
{
"question": "Welke eenheid heeft de elektrische weerstand?",
"options": [
"Ampère",
"Volt",
"Ohm",
"Watt"
],
"correct_answer": 2,
"feedback": {
"0": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm.",
"1": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm.",
"2": "Goed zo! De eenheid van elektrische weerstand is Ohm.",
"3": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm."
}
},
{
"question": "Wat is de formule voor de spanning (V) volgens de wet van Ohm?",
"options": [
"V = IR",
"V = I/R",
"V = R/I",
"V = I + R"
],
"correct_answer": 0,
"feedback": {
"0": "Goed zo! De juiste formule is V = IR.",
"1": "Dat is niet correct. De juiste formule is V = IR.",
"2": "Dat is niet correct. De juiste formule is V = IR.",
"3": "Dat is niet correct. De juiste formule is V = IR."
}
}
]
};
let currentQuestion = 0;
let score = 0;
function loadQuestion() {
const question = quizData.questions[currentQuestion];
let optionsHtml = question.options.map((option, index) =>
`<li><label><input type="radio" name="option" value="${index}"> ${option}</label></li>`
).join('');
document.getElementById('quiz').innerHTML = `
<div class="question">
<h2>Vraag ${currentQuestion + 1}: ${question.question}</h2>
<ul class="options">${optionsHtml}</ul>
<div class="feedback" id="feedback"></div>
<button onclick="submitAnswer()">Verzenden</button>
</div>
`;
}
function submitAnswer() {
const selectedOption = document.querySelector('input[name="option"]:checked');
if (!selectedOption) return;
const question = quizData.questions[currentQuestion];
const feedbackElement = document.getElementById('feedback');
if (parseInt(selectedOption.value) === question.correct_answer) {
score++;
feedbackElement.className = 'feedback correct';
} else {
feedbackElement.className = 'feedback incorrect';
}
feedbackElement.innerHTML = question.feedback[selectedOption.value];
feedbackElement.style.display = 'block';
setTimeout(() => {
feedbackElement.style.display = 'none';
currentQuestion++;
if (currentQuestion < quizData.questions.length) {
loadQuestion();
} else {
showScore();
}
}, 2000);
}
function showScore() {
document.getElementById('quiz').innerHTML = '';
document.getElementById('score').innerHTML = `Je hebt ${score} van de ${quizData.questions.length} vragen correct beantwoord.`;
document.getElementById('retry').style.display = 'block';
}
document.getElementById('retry').onclick = function() {
currentQuestion = 0;
score = 0;
document.getElementById('score').innerHTML = '';
document.getElementById('retry').style.display = 'none';
loadQuestion();
return false;
};
loadQuestion();
</script>
</body>
</html><!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>De wet van Ohm</title>
<style>
body { font-family: Arial, sans-serif; background-color: #f0f8ff; color: #333; margin: 0; padding: 0; }
.container { max-width: 800px; margin: auto; padding: 20px; background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); }
h1 { text-align: center; color: #0066cc; }
.question { margin-bottom: 20px; }
.options { list-style-type: none; padding: 0; }
.options li { margin-bottom: 10px; }
.feedback { margin-top: 10px; display: none; }
.feedback.correct { color: green; }
.feedback.incorrect { color: red; }
.score { text-align: center; margin-top: 20px; }
.retry-button { display: block; width: 100%; max-width: 300px; margin: 20px auto; padding: 10px; background-color: #0066cc; color: #fff; text-align: center; text-decoration: none; border-radius: 5px; }
</style>
</head>
<body>
<div class="container">
<h1>De wet van Ohm</h1>
<div id="quiz"></div>
<div class="score" id="score"></div>
<a href="#" class="retry-button" id="retry">Probeer opnieuw</a>
</div>
<script>
const quizData = {
"title": "De wet van Ohm",
"questions": [
{
"question": "Wat is de wet van Ohm?",
"options": [
"De spanning is gelijk aan de stroomsterkte maal de weerstand.",
"De stroomsterkte is gelijk aan de spanning gedeeld door de weerstand.",
"De weerstand is gelijk aan de spanning maal de stroomsterkte.",
"Geen van de bovenstaande."
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. De wet van Ohm zegt dat U = IR, dus de stroomsterkte I is gelijk aan de spanning U gedeeld door de weerstand R.",
"1": "Goed zo! De wet van Ohm zegt dat U = IR, dus de stroomsterkte I is gelijk aan de spanning U gedeeld door de weerstand R.",
"2": "Dat is niet correct. De wet van Ohm zegt dat U = IR, dus de stroomsterkte I is gelijk aan de spanning U gedeeld door de weerstand R.",
"3": "Dat is niet correct. De wet van Ohm zegt dat U = IR, dus de stroomsterkte I is gelijk aan de spanning U gedeeld door de weerstand R."
}
},
{
"question": "Welke formule gebruik je om de stroomsterkte te berekenen?",
"options": [
"I = UR",
"I = U/R",
"I = R/U",
"I = U + R"
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. De juiste formule is I = U/R.",
"1": "Goed zo! De juiste formule is I = U/R.",
"2": "Dat is niet correct. De juiste formule is I = U/R.",
"3": "Dat is niet correct. De juiste formule is I = U/R."
}
},
{
"question": "Wat gebeurt er met de stroomsterkte als de weerstand toeneemt (met een constante spanning)?",
"options": [
"De stroomsterkte neemt toe.",
"De stroomsterkte neemt af.",
"De stroomsterkte blijft hetzelfde.",
"De stroomsterkte fluctueert."
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"1": "Goed zo! Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"2": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"3": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning."
}
},
{
"question": "Welke eenheid heeft de elektrische weerstand?",
"options": [
"Ampère",
"Volt",
"Ohm",
"Watt"
],
"correct_answer": 2,
"feedback": {
"0": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm.",
"1": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm.",
"2": "Goed zo! De eenheid van elektrische weerstand is Ohm.",
"3": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm."
}
},
{
"question": "Wat is de formule voor de spanning (U) volgens de wet van Ohm?",
"options": [
"U = IR",
"U = I/R",
"U = R/I",
"U = I + R"
],
"correct_answer": 0,
"feedback": {
"0": "Goed zo! De juiste formule is U = IR.",
"1": "Dat is niet correct. De juiste formule is U = IR.",
"2": "Dat is niet correct. De juiste formule is U = IR.",
"3": "Dat is niet correct. De juiste formule is U = IR."
}
}
]
};
let currentQuestion = 0;
let score = 0;
function loadQuestion() {
const question = quizData.questions[currentQuestion];
let optionsHtml = question.options.map((option, index) =>
`<li><label><input type="radio" name="option" value="${index}"> ${option}</label></li>`
).join('');
document.getElementById('quiz').innerHTML = `
<div class="question">
<h2>Vraag ${currentQuestion + 1}: ${question.question}</h2>
<ul class="options">${optionsHtml}</ul>
<div class="feedback" id="feedback"></div>
<button onclick="submitAnswer()">Verzenden</button>
</div>
`;
}
function submitAnswer() {
const selectedOption = document.querySelector('input[name="option"]:checked');
if (!selectedOption) return;
const question = quizData.questions[currentQuestion];
const feedbackElement = document.getElementById('feedback');
if (parseInt(selectedOption.value) === question.correct_answer) {
score++;
feedbackElement.className = 'feedback correct';
} else {
feedbackElement.className = 'feedback incorrect';
}
feedbackElement.innerHTML = question.feedback[selectedOption.value];
feedbackElement.style.display = 'block';
setTimeout(() => {
feedbackElement.style.display = 'none';
currentQuestion++;
if (currentQuestion < quizData.questions.length) {
loadQuestion();
} else {
showScore();
}
}, 2000);
}
function showScore() {
document.getElementById('quiz').innerHTML = '';
document.getElementById('score').innerHTML = `Je hebt ${score} van de ${quizData.questions.length} vragen correct beantwoord.`;
document.getElementById('retry').style.display = 'block';
}
document.getElementById('retry').onclick = function() {
currentQuestion = 0;
score = 0;
document.getElementById('score').innerHTML = '';
document.getElementById('retry').style.display = 'none';
loadQuestion();
return false;
};
loadQuestion();
</script>
</body>
</html><!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>De wet van Ohm</title>
<style>
body { font-family: Arial, sans-serif; background-color: #f0f8ff; color: #333; margin: 0; padding: 0; }
.container { max-width: 800px; margin: auto; padding: 20px; background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); }
h1 { text-align: center; color: #0066cc; }
.question { margin-bottom: 20px; }
.options { list-style-type: none; padding: 0; }
.options li { margin-bottom: 10px; }
.feedback { margin-top: 10px; display: none; }
.feedback.correct { color: green; }
.feedback.incorrect { color: red; }
.score { text-align: center; margin-top: 20px; }
.retry-button, .next-button { display: block; width: 100%; max-width: 300px; margin: 20px auto; padding: 10px; background-color: #0066cc; color: #fff; text-align: center; text-decoration: none; border-radius: 5px; }
</style>
</head>
<body>
<div class="container">
<h1>De wet van Ohm</h1>
<div id="quiz"></div>
<div class="score" id="score"></div>
<a href="#" class="retry-button" id="retry">Probeer opnieuw</a>
<a href="#" class="next-button" id="next" style="display: none;">Volgende</a>
</div>
<script>
const quizData = {
"title": "De wet van Ohm",
"questions": [
{
"question": "Wat is de wet van Ohm?",
"options": [
"De spanning is gelijk aan de stroomsterkte maal de weerstand.",
"De stroomsterkte is gelijk aan de spanning gedeeld door de weerstand.",
"De weerstand is gelijk aan de spanning maal de stroomsterkte.",
"Geen van de bovenstaande."
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. De wet van Ohm zegt dat U = I.R, dus de stroomsterkte I is gelijk aan de spanning U gedeeld door de weerstand R.",
"1": "Goed zo! De wet van Ohm zegt dat U = I.R, dus de stroomsterkte I is gelijk aan de spanning U gedeeld door de weerstand R.",
"2": "Dat is niet correct. De wet van Ohm zegt dat U = I.R, dus de stroomsterkte I is gelijk aan de spanning U gedeeld door de weerstand R.",
"3": "Dat is niet correct. De wet van Ohm zegt dat U = I.R, dus de stroomsterkte I is gelijk aan de spanning U gedeeld door de weerstand R."
}
},
{
"question": "Welke formule gebruik je om de stroomsterkte te berekenen?",
"options": [
"I = U.R",
"I = U/R",
"I = R/U",
"I = U + R"
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. De juiste formule is I = U/R.",
"1": "Goed zo! De juiste formule is I = U/R.",
"2": "Dat is niet correct. De juiste formule is I = U/R.",
"3": "Dat is niet correct. De juiste formule is I = U/R."
}
},
{
"question": "Wat gebeurt er met de stroomsterkte als de weerstand toeneemt (met een constante spanning)?",
"options": [
"De stroomsterkte neemt toe.",
"De stroomsterkte neemt af.",
"De stroomsterkte blijft hetzelfde.",
"De stroomsterkte fluctueert."
],
"correct_answer": 1,
"feedback": {
"0": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"1": "Goed zo! Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"2": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning.",
"3": "Dat is niet correct. Volgens de wet van Ohm neemt de stroomsterkte af als de weerstand toeneemt bij een constante spanning."
}
},
{
"question": "Welke eenheid heeft de elektrische weerstand?",
"options": [
"Ampère",
"Volt",
"Ohm",
"Watt"
],
"correct_answer": 2,
"feedback": {
"0": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm.",
"1": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm.",
"2": "Goed zo! De eenheid van elektrische weerstand is Ohm.",
"3": "Dat is niet correct. De eenheid van elektrische weerstand is Ohm."
}
},
{
"question": "Wat is de formule voor de spanning (U) volgens de wet van Ohm?",
"options": [
"U = I.R",
"U = I/R",
"U = R/I",
"U = I + R"
],
"correct_answer": 0,
"feedback": {
"0": "Goed zo! De juiste formule is U = I.R.",
"1": "Dat is niet correct. De juiste formule is U = I.R.",
"2": "Dat is niet correct. De juiste formule is U = I.R.",
"3": "Dat is niet correct. De juiste formule is U = I.R."
}
}
]
};
let currentQuestion = 0;
let score = 0;
function loadQuestion() {
const question = quizData.questions[currentQuestion];
let optionsHtml = question.options.map((option, index) =>
`<li><label><input type="radio" name="option" value="${index}"> ${option}</label></li>`
).join('');
document.getElementById('quiz').innerHTML = `
<div class="question">
<h2>Vraag ${currentQuestion + 1}: ${question.question}</h2>
<ul class="options">${optionsHtml}</ul>
<div class="feedback" id="feedback"></div>
<button onclick="submitAnswer()">Verzenden</button>
</div>
`;
document.getElementById('next').style.display = 'none';
}
function submitAnswer() {
const selectedOption = document.querySelector('input[name="option"]:checked');
if (!selectedOption) return;
const question = quizData.questions[currentQuestion];
const feedbackElement = document.getElementById('feedback');
if (parseInt(selectedOption.value) === question.correct_answer) {
score++;
feedbackElement.className = 'feedback correct';
} else {
feedbackElement.className = 'feedback incorrect';
}
feedbackElement.innerHTML = question.feedback[selectedOption.value];
feedbackElement.style.display = 'block';
document.getElementById('next').style.display = 'block';
}
function nextQuestion() {
const feedbackElement = document.getElementById('feedback');
feedbackElement.style.display = 'none';
currentQuestion++;
if (currentQuestion < quizData.questions.length) {
loadQuestion();
} else {
showScore();
}
}
function showScore() {
document.getElementById('quiz').innerHTML = '';
document.getElementById('score').innerHTML = `Je hebt ${score} van de ${quizData.questions.length} vragen correct beantwoord.`;
document.getElementById('retry').style.display = 'block';
document.getElementById('next').style.display = 'none';
}
document.getElementById('retry').onclick = function() {
currentQuestion = 0;
score = 0;
document.getElementById('score').innerHTML = '';
document.getElementById('retry').style.display = 'none';
loadQuestion();
return false;
};
document.getElementById('next').onclick = function() {
nextQuestion();
return false;
};
loadQuestion();
</script>
</body>
</html>