ch6 part14
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>APICAL CLASSES - Newton's Third Law Quiz</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;
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: 10px 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;
line-height: 1.5;
}
.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; }
#result { color: #1e3c72; }
@media (max-width: 600px) {
body { padding: 10px; }
.quiz-container { width: 100%; padding: 15px; }
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>đź§ APICAL CLASSES<br>Newton's Third Law of Motion Quiz</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. Activity 6.6 mein do identical spring balances ko table par horizontal position mein rakha gaya aur unke hooks ko aapas mein connect kiya gaya. Ek spring balance ka free end fixed rakha gaya aur doosre ko opposite direction mein pull kiya gaya. Agar dono spring balances stationary hain, unki readings kaisi hongi?",
options: [
"A. Dono readings equal hongi",
"B. Ek reading zero hogi",
"C. Dono readings different hongi",
"D. Dono readings hamesha zero hongi"
],
correct: 0,
explanation: "Experiment mein dono spring balances ki readings same milti hain. Ye equal magnitude wali opposite forces ko show karta hai."
},
{
question: "2. Activity 6.6 mein agar student connected spring balance ko pehle 2 N force se aur phir 5 N force se pull karta hai, to stationary condition mein doosre spring balance ki reading kya hogi?",
options: [
"A. Pehle 2 N, phir 5 N",
"B. Pehle 5 N, phir 2 N",
"C. Dono baar 0 N",
"D. Dono baar 1 N"
],
correct: 0,
explanation: "Do spring balances ek-doosre par equal magnitude ki forces lagate hain. Applied force badhne par doosre balance ki reading bhi same amount se badhegi."
},
{
question: "3. Activity 6.6 mein ek spring balance ko fixed object se hold kiya gaya hai aur doosre spring balance ko 8 N force se pull kiya gaya. Agar system stationary hai, fixed spring balance approximately kya reading show karega?",
options: [
"A. 0 N",
"B. 4 N",
"C. 8 N",
"D. 16 N"
],
correct: 2,
explanation: "Newton’s Third Law ke according second spring balance bhi 8 N equal and opposite force experience karega, isliye reading 8 N hogi."
},
{
question: "4. Activity 6.6 mein dono spring balances ki readings equal milne se kya conclusion nikalta hai?",
options: [
"A. Forces unequal hain",
"B. Forces equal magnitude aur opposite direction mein hain",
"C. Sirf ek object par force act kar raha hai",
"D. Forces same direction mein hain"
],
correct: 1,
explanation: "Equal spring-balance readings indicate karti hain ki interacting objects ek-doosre par equal magnitude ki opposite forces laga rahe hain."
},
{
question: "5. Newton’s Third Law ke according, jab Object A, Object B par force lagata hai, to Object B kya karta hai?",
options: [
"A. Koi force nahi lagata",
"B. A par equal magnitude ki opposite force lagata hai",
"C. A par double force lagata hai",
"D. A par same direction mein force lagata hai"
],
correct: 1,
explanation: "Third Law ke according force pair mein hota hai: equal magnitude, opposite direction, aur dono forces different objects par act karte hain."
},
{
question: "6. Ek person coconut tree climb karte waqt apne legs se tree trunk ko downward push karta hai. Iske response mein tree trunk person par kya force lagata hai?",
options: [
"A. Downward frictional force",
"B. Upward frictional force",
"C. No force",
"D. Horizontal gravitational force"
],
correct: 1,
explanation: "Person trunk ko downward push karta hai. Trunk person ke legs par upward frictional force lagata hai, jo climbing mein help karta hai."
},
{
question: "7. Ek person smooth tree trunk ko climb karne ki koshish karta hai. Smooth trunk par friction kam hone ke kaaran climbing difficult kyun hoti hai?",
options: [
"A. Person ko upward reaction force kam milta hai",
"B. Person ka mass kam ho jaata hai",
"C. Gravity completely disappear ho jaati hai",
"D. Tree person ko downward pull karna band kar deta hai"
],
correct: 0,
explanation: "Smooth surface par friction kam hota hai. Isliye trunk person ke legs ko sufficient upward frictional force nahi de paata."
},
{
question: "8. Ek canoeist paddle se water ko backward push karta hai. Newton’s Third Law ke according water paddle par kya karta hai?",
options: [
"A. Paddle ko backward push karta hai",
"B. Paddle par equal forward force lagata hai",
"C. Paddle par koi force nahi lagata",
"D. Paddle ko downward push karta hai"
],
correct: 1,
explanation: "Canoeist water ko backward push karta hai. Water reaction ke roop mein paddle par equal forward force lagata hai, jisse canoe forward move karti hai."
},
{
question: "9. Ek canoeist normally paddle se water ko backward push karta hai. Agar woh water ko aur zyada force se backward push kare, to canoe ki motion mein kya change expected hai?",
options: [
"A. Forward force increase hogi aur canoe ki velocity increase hogi",
"B. Forward force decrease hogi",
"C. Canoe immediately backward move karegi",
"D. Canoe ki velocity hamesha zero rahegi"
],
correct: 0,
explanation: "Harder push ka matlab water par greater force. Reaction ke roop mein water paddle par greater forward force lagata hai, jisse canoe ki velocity increase hoti hai."
},
{
question: "10. Canoeist paddle ko backward push karta hai aur water paddle ko forward push karta hai. Dono forces equal aur opposite hone ke baad bhi canoe move kyun karti hai?",
options: [
"A. Dono forces same object par act karte hain",
"B. Dono forces different objects par act karte hain",
"C. Reaction force hamesha zero hota hai",
"D. Action force reaction se greater hota hai"
],
correct: 1,
explanation: "Canoeist/paddle ka force water par act karta hai, jabki water ka reaction force paddle par act karta hai. Isliye forces different objects par hain aur ek-doosre ko cancel nahi karte."
}
];
let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
let quizSubmitted = false;
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 = `
<p><strong>Question ${currentQuestion + 1} of ${questions.length}</strong></p>
<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) : null;
}
function nextQuestion() {
saveAnswer();
if (currentQuestion < questions.length - 1) {
currentQuestion++;
showQuestion();
}
}
function prevQuestion() {
saveAnswer();
if (currentQuestion > 0) {
currentQuestion--;
showQuestion();
}
}
function submitQuiz() {
if (quizSubmitted) return;
saveAnswer();
const unanswered = userAnswers.filter(
answer => answer === null || answer === undefined
).length;
if (unanswered > 0) {
const confirmSubmit = confirm(
`You have ${unanswered} unanswered question(s). Do you still want to submit?`
);
if (!confirmSubmit) return;
}
score = 0;
questions.forEach((q, index) => {
if (userAnswers[index] === q.correct) {
score++;
}
});
quizSubmitted = true;
showResults();
saveScore(userName, score);
loadScoreboard();
}
function showResults() {
const container = document.getElementById("questionContainer");
container.innerHTML = "";
questions.forEach((q, index) => {
const selected = userAnswers[index];
const correct = q.correct;
let optsHTML = q.options.map((opt, i) => {
let cls = "";
if (i === correct) cls = "correct";
if (selected === i && selected !== 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>Correct Answer:</strong> ${q.options[correct]}<br>
<strong>Explanation:</strong> ${q.explanation}
</div>
<hr>
`;
});
document.querySelector(".controls").style.display = "none";
document.getElementById("result").innerHTML = `
<h3>Your Score: ${score} / ${questions.length}</h3>
<p><strong>Student:</strong> ${escapeHTML(userName)}</p>
<p>${score === questions.length ? "Excellent! Perfect Score! 🎉" :
score >= 7 ? "Very Good! Keep Practicing! 👏" :
score >= 5 ? "Good Effort! Revise and Try Again! 👍" :
"Keep Practicing! You Can Improve! đź’Ş"}</p>
`;
}
function saveScore(name, score) {
let scores = [];
try {
scores = JSON.parse(localStorage.getItem("quizScores")) || [];
if (!Array.isArray(scores)) scores = [];
} catch (error) {
scores = [];
}
scores.push({
name: name,
score: score,
date: new Date().toLocaleString()
});
localStorage.setItem("quizScores", JSON.stringify(scores));
}
function loadScoreboard() {
let scores = [];
try {
scores = JSON.parse(localStorage.getItem("quizScores")) || [];
if (!Array.isArray(scores)) scores = [];
} 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("");
}
function escapeHTML(value) {
return String(value).replace(/[&<>"']/g, char => ({
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'"
})[char]);
}
</script>
</body>
</html>