ch6 part12
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Science Quiz – Newton's Third Law of Motion</title>
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
display: flex;
justify-content: center;
align-items: flex-start;
padding: 30px;
min-height: 100vh;
margin: 0;
box-sizing: border-box;
}
.quiz-container {
background: #fff;
padding: 25px;
border-radius: 12px;
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
width: 90%;
max-width: 800px;
}
h2 {
text-align: center;
color: #1e3c72;
}
.question {
font-weight: bold;
margin: 15px 0;
line-height: 1.6;
}
.options label {
display: block;
margin: 8px 0;
padding: 10px;
border-radius: 6px;
border: 1px solid #ccc;
cursor: pointer;
transition: 0.3s;
}
.options label:hover {
background: #f0f0f0;
}
.options input {
margin-right: 8px;
}
.correct {
background-color: #c8f7c5 !important;
border-color: #28a745 !important;
}
.wrong {
background-color: #f8d7da !important;
border-color: #dc3545 !important;
}
.explanation {
background: #e9ecef;
padding: 10px;
margin-top: 10px;
border-left: 5px solid #2a5298;
display: none;
line-height: 1.6;
}
.controls {
text-align: center;
margin-top: 15px;
}
button {
background-color: #2a5298;
color: white;
border: none;
padding: 10px 20px;
border-radius: 6px;
cursor: pointer;
margin: 5px;
}
button:hover {
background-color: #1e3c72;
}
#scoreboard {
margin-top: 25px;
background: #eef3f7;
padding: 15px;
border-radius: 8px;
}
#scoreboard h3 {
text-align: center;
}
ol {
padding-left: 20px;
}
hr {
border: 0;
border-top: 1px solid #ddd;
margin: 20px 0;
}
@media (max-width: 600px) {
body {
padding: 12px;
}
.quiz-container {
width: 100%;
padding: 15px;
}
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠 Science Quiz – Newton's Third Law of Motion</h2>
<div id="nameSection">
<p><strong>Enter your name to start:</strong></p>
<input type="text" id="userName" placeholder="Your Name">
<button onclick="startQuiz()">Start Quiz</button>
</div>
<div id="quizSection" style="display:none;">
<div id="questionContainer"></div>
<div class="controls">
<button onclick="prevQuestion()" id="prevBtn">Previous</button>
<button onclick="nextQuestion()" id="nextBtn">Next</button>
<button onclick="submitQuiz()" id="submitBtn" style="display:none;">Submit</button>
</div>
<div id="result" style="text-align:center; margin-top:20px;"></div>
<div id="scoreboard">
<h3>🏆 Scoreboard</h3>
<ol id="scoreList"></ol>
</div>
</div>
</div>
<script>
const questions = [
{
question: "1. Newton’s Third Law mainly kis situation ko explain karta hai?",
options: [
"A. Sirf ek object par lagne wali force",
"B. Do interacting objects ke force interaction ko",
"C. Sirf gravitational force ko",
"D. Sirf friction ko"
],
correct: 1,
explanation: "Force tab arise hota hai jab at least two objects interact karte hain. Newton’s Third Law in dono objects ke mutual forces ko explain karta hai."
},
{
question: "2. Jab koi person apne foot se ball ko push karta hai, to person ko ball ki taraf se kya experience hota hai?",
options: [
"A. Koi force nahi",
"B. Ball ki taraf se opposite force",
"C. Sirf gravitational force",
"D. Sirf upward force"
],
correct: 1,
explanation: "Person ball par force lagata hai, aur ball bhi person ke foot par opposite direction mein force lagati hai. Ye Newton’s Third Law ka example hai."
},
{
question: "3. Activity 6.5 mein wheeled chair par baitha person table ko forward push karta hai. Chair kis direction mein move karegi?",
options: [
"A. Forward",
"B. Opposite direction, yani backward",
"C. Upward",
"D. Chair move nahi karegi"
],
correct: 1,
explanation: "Person table ko forward force deta hai. Table person par opposite direction mein force lagata hai, isliye wheeled chair backward move karti hai."
},
{
question: "4. Activity 6.5 mein person table ko apni taraf pull karta hai. Is situation mein chair kis direction mein move karegi?",
options: [
"A. Table se opposite direction",
"B. Table ki taraf",
"C. Upward",
"D. Random direction"
],
correct: 1,
explanation: "Jab person table ko apni taraf pull karta hai, table person par opposite direction mein force lagata hai. Isliye chair table ki taraf move karti hai."
},
{
question: "5. Bicycle par bina pedalling ke forward move karne ke liye person ground ko kis direction mein push karta hai?",
options: [
"A. Forward",
"B. Backward",
"C. Upward",
"D. Sideways"
],
correct: 1,
explanation: "Feet se ground ko backward push karne par ground feet par opposite, yani forward frictional force lagata hai. Isse person aur bicycle forward move karte hain."
},
{
question: "6. Walking ya running ke time ground person ko forward kaise move karta hai?",
options: [
"A. Ground person ko gravitational force deta hai",
"B. Ground person ke feet par forward frictional force lagata hai",
"C. Ground person ko upward magnetic force deta hai",
"D. Ground ki force zero hoti hai"
],
correct: 1,
explanation: "Hum feet se ground ko backward push karte hain. Ground friction ke through forward force feet par lagata hai, jisse hum forward move karte hain."
},
{
question: "7. Walking ke time friction normally motion ko oppose karne ke bajay forward movement mein help kyun karta hai?",
options: [
"A. Foot ground ko backward push karta hai aur friction forward act karta hai",
"B. Friction hamesha motion ki direction mein hota hai",
"C. Gravity friction ko cancel kar deti hai",
"D. Foot ground ko forward push karta hai"
],
correct: 0,
explanation: "Walking mein foot ground ko backward push karne ki tendency rakhta hai. Ground ka friction forward direction mein act karta hai aur walking mein help karta hai."
},
{
question: "8. Agar ground aur feet ke beech friction bilkul na ho, to walking ke time kya ho sakta hai?",
options: [
"A. Person bahut fast chalega",
"B. Foot backward slip karega aur person gir sakta hai",
"C. Person automatically jump karega",
"D. Walking aur easy ho jayegi"
],
correct: 1,
explanation: "Friction na hone par foot ground ko effectively push nahi kar paayega aur backward slip kar sakta hai. Isse person gir sakta hai."
},
{
question: "9. Footwear ke soles par grooves kyun banaye jaate hain?",
options: [
"A. Weight reduce karne ke liye",
"B. Friction increase karne ke liye",
"C. Speed increase karne ke liye",
"D. Shoes ko waterproof banane ke liye"
],
correct: 1,
explanation: "Grooves floor aur sole ke beech friction increase karte hain, jisse walking ke time slipping ka risk kam hota hai."
},
{
question: "10. Wet polished floor, ice, ya water/snow-covered road par walking ya driving risky kyun hoti hai?",
options: [
"A. Friction bahut increase ho jaata hai",
"B. Friction decrease ho jaata hai",
"C. Gravitational force zero ho jaata hai",
"D. Objects ka mass increase ho jaata hai"
],
correct: 1,
explanation: "Wet floor, ice aur water/snow surfaces par friction kam ho jaata hai. Isliye feet ya tyres easily slip kar sakte hain, making walking and driving risky."
}
];
let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
function startQuiz() {
userName = document.getElementById("userName").value.trim();
if (!userName) {
alert("Please enter your name.");
return;
}
document.getElementById("nameSection").style.display = "none";
document.getElementById("quizSection").style.display = "block";
showQuestion();
loadScoreboard();
}
function showQuestion() {
const q = questions[currentQuestion];
const container = document.getElementById("questionContainer");
container.innerHTML = `
<div class="question">${q.question}</div>
<div class="options">
${q.options.map((opt, i) => `
<label>
<input type="radio" name="option" value="${i}"
${userAnswers[currentQuestion] === i ? "checked" : ""}>
${opt}
</label>
`).join("")}
</div>
`;
document.getElementById("prevBtn").style.display =
currentQuestion === 0 ? "none" : "inline-block";
document.getElementById("nextBtn").style.display =
currentQuestion === questions.length - 1 ? "none" : "inline-block";
document.getElementById("submitBtn").style.display =
currentQuestion === questions.length - 1 ? "inline-block" : "none";
}
function saveAnswer() {
const selected = document.querySelector('input[name="option"]:checked');
userAnswers[currentQuestion] = selected
? parseInt(selected.value, 10)
: null;
}
function nextQuestion() {
saveAnswer();
if (currentQuestion < questions.length - 1) {
currentQuestion++;
showQuestion();
}
}
function prevQuestion() {
saveAnswer();
if (currentQuestion > 0) {
currentQuestion--;
showQuestion();
}
}
function submitQuiz() {
saveAnswer();
score = 0;
questions.forEach((q, index) => {
if (userAnswers[index] === q.correct) {
score++;
}
});
showResults();
saveScore(userName, score);
loadScoreboard();
}
function showResults() {
const container = document.getElementById("questionContainer");
container.innerHTML = "";
questions.forEach((q, index) => {
const selected = userAnswers[index];
const optsHTML = q.options.map((opt, i) => {
let cls = "";
if (i === q.correct) {
cls = "correct";
}
if (selected === i && selected !== q.correct) {
cls = "wrong";
}
return `<label class="${cls}">${opt}</label>`;
}).join("");
container.innerHTML += `
<div class="question">${q.question}</div>
<div class="options">${optsHTML}</div>
<div class="explanation" style="display:block;">
<strong>Explanation:</strong> ${q.explanation}
</div>
<hr>
`;
});
document.querySelector(".controls").style.display = "none";
document.getElementById("result").innerHTML =
`<h3>Your Score: ${score} / ${questions.length}</h3>`;
}
function escapeHTML(value) {
return String(value).replace(/[&<>"']/g, char => ({
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'"
})[char]);
}
function saveScore(name, score) {
let scores = [];
try {
scores = JSON.parse(localStorage.getItem("quizScores")) || [];
} catch (error) {
scores = [];
}
scores.push({
name,
score,
date: new Date().toLocaleString()
});
localStorage.setItem("quizScores", JSON.stringify(scores));
}
function loadScoreboard() {
let scores = [];
try {
scores = JSON.parse(localStorage.getItem("quizScores")) || [];
} catch (error) {
scores = [];
}
scores.sort((a, b) => b.score - a.score);
document.getElementById("scoreList").innerHTML =
scores.map(s =>
`<li>${escapeHTML(s.name)} - ${s.score}/10 (${escapeHTML(s.date)})</li>`
).join("");
}
</script>
</body>
</html>