ch6 part 6
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Formation of Winds, Clouds and Lightning 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;
}
.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; }
.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; }
.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;
}
.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; }
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠 Formation of Winds, Clouds and Lightning 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. Jab land heat hoti hai, toh warm aur moist air ke saath kya hota hai?",
options: [
"A. Air neeche sink karti hai.",
"B. Air rise karti hai.",
"C. Air freeze ho jaati hai.",
"D. Air move karna band kar deti hai."
],
correct: 1,
explanation: "Jab land heat hoti hai, toh uske contact mein aane wali warm aur moist air garam hokar lighter ho jaati hai. Isliye air upar rise karti hai aur neeche low-pressure area create hota hai.<br><br><b>Example:</b> Garmiyon mein zameen ke paas ki hawa garam hokar upar uth sakti hai."
},
{
question: "2. Jab warm air rise karti hai, toh uski jagah lene ke liye kaunsi air aati hai?",
options: [
"A. Surrounding high-pressure areas ki cooler air.",
"B. Sirf hot air.",
"C. Vacuum.",
"D. Sirf water vapour."
],
correct: 0,
explanation: "Warm air rise karne se low-pressure area banta hai. Surrounding high-pressure areas ki cooler air us jagah ko fill karne ke liye move karti hai. Is movement se wind circulation hota hai.<br><br><b>Example:</b> Jab kisi jagah hawa ka pressure kam hota hai, toh aas-paas ki air us area ki taraf move kar sakti hai."
},
{
question: "3. Rising warm air thandi hone par clouds kaise form hote hain?",
options: [
"A. Moisture evaporate hona band kar deta hai aur clouds gayab ho jaate hain.",
"B. Moisture condense hokar tiny water droplets banata hai.",
"C. Air solid rock ban jaati hai.",
"D. Water directly soil ban jaata hai."
],
correct: 1,
explanation: "Warm, moist air jab upar rise karti hai, toh expand hokar cool hoti hai. Air mein present water vapour condense hokar chhoti water droplets banata hai, jo clouds form karti hain.<br><br><b>Example:</b> Thande glass ke outer surface par water droplets ban jaana condensation ka example hai."
},
{
question: "4. Clouds mein water droplets merge hokar heavy ho jaati hain. Iske baad kya ho sakta hai?",
options: [
"A. Sirf dust fall hoti hai.",
"B. Rain, hail ya snow fall ho sakti hai.",
"C. Clouds hamesha disappear ho jaate hain.",
"D. Air pressure zero ho jaata hai."
],
correct: 1,
explanation: "Jab water droplets ya ice particles sufficiently heavy ho jaate hain, toh woh clouds se neeche gir sakte hain. Temperature aur atmospheric conditions ke according rain, hail ya snow ho sakti hai.<br><br><b>Example:</b> Monsoon mein rain aur severe thunderstorms mein hailstones gir sakte hain."
},
{
question: "5. Rain ke saath chalne wali strong winds ko kya kaha jaata hai?",
options: [
"A. Breeze.",
"B. Storm.",
"C. Condensation.",
"D. Evaporation."
],
correct: 1,
explanation: "Textbook ke according, rain ke saath chalne wali strong winds ko storm kaha jaata hai. Storm ke dauraan hawa tez chal sakti hai aur heavy rainfall bhi ho sakti hai.<br><br><b>Example:</b> Monsoon ke time tez hawa aur heavy rain ka combination storm ho sakta hai."
},
{
question: "6. Clouds ke andar static electric charges develop hone ka main reason kya hai?",
options: [
"A. Water droplets aur ice particles ka aapas mein rub hona.",
"B. Sunlight ka clouds se reflect hona.",
"C. Rain ka ground par girna.",
"D. Air ka bilkul still rehna."
],
correct: 0,
explanation: "Clouds ke andar strong upward aur downward winds water droplets aur ice particles ko move karati hain. In particles ke interactions se electric charges develop aur separate ho sakte hain.<br><br><b>Example:</b> Do objects ko rub karne se static electricity develop ho sakti hai, jaise plastic comb ko dry hair par rub karna."
},
{
question: "7. Thunderstorm ke cloud ke upper aur lower parts mein charges kaise distribute hote hain, textbook ke according?",
options: [
"A. Upper part negative, lower part positive.",
"B. Upper part positive, lower part negative.",
"C. Dono parts hamesha positive.",
"D. Dono parts hamesha negative."
],
correct: 1,
explanation: "Lighter, positively charged ice particles cloud ke upper part mein move karte hain. Heavier, negatively charged water droplets lower part mein occupy karte hain. Isse cloud mein charge separation hota hai.<br><br><b>Example:</b> Thundercloud ke top par positive charges aur lower region mein negative charges accumulate ho sakte hain."
},
{
question: "8. Lightning kaise produce hoti hai?",
options: [
"A. Jab clouds ka colour black ho jaata hai.",
"B. Jab air ki insulating property break down hoti hai aur charges suddenly flow karte hain.",
"C. Jab rainwater evaporate hota hai.",
"D. Jab wind completely stop ho jaati hai."
],
correct: 1,
explanation: "Normally air electrical insulator ki tarah kaam karti hai. Jab electric charges bahut zyada accumulate ho jaate hain, toh air ki insulating property break down ho sakti hai aur sudden electric discharge hota hai. Is bright flash ko lightning kehte hain.<br><br><b>Example:</b> Cloud-to-ground lightning mein cloud aur ground ke beech electric discharge hota hai."
},
{
question: "9. Lightning ke aas-paas ki air rapidly heat hokar expand hoti hai. Isse kya produce hota hai?",
options: [
"A. Thunder.",
"B. Snowfall.",
"C. Fog only.",
"D. Earthquake."
],
correct: 0,
explanation: "Lightning air ko bahut rapidly heat karti hai. Heated air suddenly expand karti hai, jisse sound waves produce hoti hain. Hum is loud sound ko thunder kehte hain.<br><br><b>Example:</b> Jab lightning flash ke kuch seconds baad loud garaj sunai deti hai, toh woh thunder hota hai."
},
{
question: "10. Lightning aur thunder ke saath aane wale storm ko kya kaha jaata hai?",
options: [
"A. Dust storm.",
"B. Thunderstorm.",
"C. Heat wave.",
"D. Sea breeze."
],
correct: 1,
explanation: "Aise storm jisme lightning aur thunder dono hote hain, use thunderstorm kaha jaata hai. Iske saath strong winds aur heavy rainfall bhi ho sakti hai.<br><br><b>Example:</b> Monsoon ke dauraan dark clouds, lightning, thunder aur heavy rain ek thunderstorm ke signs ho sakte hain.<br><br><b>Safety:</b> Lightning ke time open ground, isolated trees aur electric poles se door raho. Safe building ya closed vehicle ke andar shelter lo."
}
];
let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
function startQuiz() {
userName = document.getElementById("userName").value.trim();
if (!userName) return alert("Please enter your name.");
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>
<div class="explanation" id="explain${currentQuestion}">
${q.explanation}
</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 nextQuestion() {
saveAnswer();
if (currentQuestion < questions.length - 1) {
currentQuestion++;
showQuestion();
}
}
function prevQuestion() {
saveAnswer();
if (currentQuestion > 0) {
currentQuestion--;
showQuestion();
}
}
function saveAnswer() {
const selected = document.querySelector('input[name="option"]:checked');
userAnswers[currentQuestion] =
selected ? parseInt(selected.value) : null;
}
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 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;">
${q.explanation}
</div>
<hr>
`;
});
document.querySelector(".controls").style.display = "none";
document.getElementById("result").innerHTML =
`<h3>Your Score: ${score} / ${questions.length}</h3>`;
}
function saveScore(name, score) {
let scores = JSON.parse(localStorage.getItem("quizScores")) || [];
scores.push({
name,
score,
date: new Date().toLocaleString()
});
localStorage.setItem("quizScores", JSON.stringify(scores));
}
function loadScoreboard() {
let scores = JSON.parse(localStorage.getItem("quizScores")) || [];
scores.sort((a,b) => b.score - a.score);
document.getElementById("scoreList").innerHTML =
scores.map(s =>
`<li>${s.name} - ${s.score}/10 (${s.date})</li>`
).join('');
}
</script>
</body>
</html>
Pages:
1 2 3 4 5 6 7 8 9 10 11 12