/* Scoped quiz styles (only apply inside #sd-quiz-root) */ #sd-quiz-root { --sd-accent:#1e73be; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; max-width:900px; margin:28px auto; padding:18px; box-shadow:0 6px 20px rgba(0,0,0,0.04); border-radius:10px; background:#fff; color:#111; } #sd-quiz-root h2 { text-align:center; margin-bottom:10px; font-size:1.4rem; } .sd-quiz-meta { text-align:center; font-size:0.95rem; margin-bottom:14px; color:#444; } .sd-question { padding:12px; border-radius:8px; margin-bottom:12px; border:1px solid #f0f0f0; background:#fafafa; } .sd-question p.qtext { margin:0 0 8px 0; font-weight:600; } .sd-options { display:block; margin:0; padding:0; list-style:none; } .sd-options li { margin:4px 0; } .sd-options label { display:inline-flex; gap:8px; align-items:center; cursor:pointer; padding:8px; border-radius:6px; transition:background .12s; width:100%; } .sd-options input[type="radio"] { transform:scale(1.02); } .sd-options label:hover { background:#fff; box-shadow:0 0 0 2px rgba(30,115,190,0.06); } .sd-controls { display:flex; gap:10px; justify-content:center; margin-top:14px; } .sd-btn { border:0; padding:10px 16px; border-radius:8px; cursor:pointer; font-weight:600; } .sd-btn-submit { background:var(--sd-accent); color:#fff; } .sd-btn-reset { background:#eee; color:#111; } .sd-result { margin-top:18px; padding:14px; border-radius:8px; background:#fcfcfc; border:1px solid #eee; } .sd-result .item { margin-bottom:10px; padding:8px; border-radius:6px; } .sd-correct { color: #0b7a3a; font-weight:700; } .sd-wrong { color:#c21b20; font-weight:700; } .sd-notanswered { color:#a47b00; font-weight:700; } @media (max-width:640px){ #sd-quiz-root { padding:12px; } .sd-controls{ flex-direction:column; } } (function () { // All data and code scoped inside IIFE to avoid site conflicts. const root = document.getElementById('sd-quiz-root'); const questions = [ { id: "q1", text: "1. Branch of science in which living beings are studied is known as?", opts: {A:"Chemistry", B:"Physics", C:"Biology", D:"Geology", E:"Ecology"}, ans:"C" }, { id: "q2", text: "2. What is the meaning of bios?", opts: {A:"Study", B:"Life", C:"Earth", D:"Atom", E:"Nature"}, ans:"B" }, { id: "q3", text: "3. What is the meaning of logos?", opts: {A:"Life", B:"Word", C:"Study", D:"Plant", E:"Body"}, ans:"C" }, { id: "q4", text: "4. Who coined the term “biology”?", opts: {A:"Aristotle", B:"Lamarck and Treviranus (1801)", C:"Carl Linnaeus", D:"Theophrastus", E:"R.H. Whittaker"}, ans:"B" }, { id: "q5", text: "5. Study of different aspects of plants is known as?", opts: {A:"Zoology", B:"Anatomy", C:"Botany", D:"Ecology", E:"Anthropology"}, ans:"C" }, { id: "q6", text: "6. Who is known as the father of Botany?", opts: {A:"Aristotle", B:"Carl Linnaeus", C:"Theophrastus", D:"Lamarck", E:"Hooke"}, ans:"C" }, { id: "q7", text: "7. Study of various aspects of animals is known as?", opts: {A:"Botany", B:"Zoology", C:"Microbiology", D:"Anatomy", E:"Physiology"}, ans:"B" }, { id: "q8", text: "8. Who is known as father of Zoology as well as Biology?", opts: {A:"Theophrastus", B:"Aristotle", C:"Linnaeus", D:"Darwin", E:"Mendel"}, ans:"B" }, { id: "q9", text: "9. Study of internal structure of organism is known as?", opts: {A:"Physiology", B:"Cytology", C:"Anatomy", D:"Histology", E:"Pathology"}, ans:"C" }, { id: "q10", text: "10. Soil science dealing especially with production of crops is known as?", opts: {A:"Horticulture", B:"Agrology", C:"Botany", D:"Agronomy", E:"Soilology"}, ans:"B" }, { id: "q11", text: "11. Science of soil management and production of crops is known as?", opts: {A:"Agrology", B:"Horticulture", C:"Forestry", D:"Agronomy", E:"Ecology"}, ans:"D" }, { id: "q12", text: "12. Study of grasses is known as?", opts: {A:"Bryology", B:"Agrostology", C:"Pomology", D:"Olericulture", E:"Arboriculture"}, ans:"B" }, { id: "q13", text: "13. Study of joints is known as?", opts: {A:"Arthrology", B:"Myology", C:"Kinesiology", D:"Osteology", E:"Angiology"}, ans:"A" }, { id: "q14", text: "14. Rearing of honeybee for honey is known as?", opts: {A:"Sericulture", B:"Apiculture", C:"Pisciculture", D:"Poultry", E:"Entomology"}, ans:"B" }, { id: "q15", text: "15. Study of origin, development and relationship between past and present human culture is known as?", opts: {A:"Sociology", B:"Psychology", C:"Anthropology", D:"Archaeology", E:"Ethnology"}, ans:"C" }, { id: "q16", text: "16. Study of flower and flowering plants is known as?", opts: {A:"Anthology", B:"Anatomy", C:"Phytology", D:"Floristics", E:"Horticulture"}, ans:"A" }, { id: "q17", text: "17. Study of blood vascular system including arteries and veins is known as?", opts: {A:"Cardiology", B:"Angiology", C:"Haematology", D:"Phlebology", E:"Vascularology"}, ans:"B" }, { id: "q18", text: "18. Study of male reproductive organs is known as?", opts: {A:"Gynecology", B:"Urology", C:"Andrology", D:"Endocrinology", E:"Reproductive biology"}, ans:"C" }, { id: "q19", text: "19. Study of bryophytes is known as?", opts: {A:"Pteridology", B:"Bryology", C:"Mycology", D:"Phycology", E:"Lichenology"}, ans:"B" }, { id: "q20", text: "20. Statistical study of biological problems is known as?", opts: {A:"Ecology", B:"Biochemistry", C:"Biometrics", D:"Biostatistics", E:"Bioinformatics"}, ans:"C" }, { id: "q21", text: "21. Which characteristics distinguish living from non-living?", opts: {A:"Growth, reproduction, metabolism, response to stimuli", B:"Movement, color, size, shape", C:"Temperature, density, weight, mass", D:"Reactivity, hardness, elasticity, magnetism", E:"Photosynthesis, digestion, respiration, excretion"}, ans:"A" }, { id: "q22", text: "22. Who wrote the book 'Systema Naturae'?", opts: {A:"Charles Darwin", B:"R.H. Whittaker", C:"Carl Linnaeus", D:"Aristotle", E:"Lamarck"}, ans:"C" }, { id: "q23", text: "23. Carl Linnaeus divided all organisms into which two kingdoms?", opts: {A:"Fungi and Protista", B:"Monera and Protista", C:"Plantae and Animalia", D:"Animalia and Fungi", E:"Monera and Fungi"}, ans:"C" }, { id: "q24", text: "24. Who is known as 'Father of Taxonomy'?", opts: {A:"Theophrastus", B:"Carl Linnaeus", C:"Aristotle", D:"Darwin", E:"Whittaker"}, ans:"B" }, { id: "q25", text: "25. Five kingdom classification of organisms was proposed by?", opts: {A:"Carl Linnaeus (1758)", B:"R.H. Whittaker (1969)", C:"Ernst Haeckel (1866)", D:"Robert Hooke (1665)", E:"Charles Darwin (1859)"}, ans:"B" }, { id: "q26", text: "26. Organisms are classified into which five kingdoms?", opts: {A:"Monera, Protista, Fungi, Plantae, Animalia", B:"Bacteria, Archaea, Eukarya, Plantae, Animalia", C:"Fungi, Plantae, Animalia, Virus, Protista", D:"Monera, Algae, Fungi, Plantae, Animalia", E:"Protista, Fungi, Plantae, Animalia, Virus"}, ans:"A" }, { id: "q27", text: "27. Which kingdom includes all prokaryotic organisms like bacteria, cyanobacteria, and archaebacteria?", opts: {A:"Protista", B:"Fungi", C:"Plantae", D:"Monera", E:"Animalia"}, ans:"D" }, { id: "q28", text: "28. What is the general size of organisms in the Monera kingdom?", opts: {A:"Macroscopic (visible)", B:"Microscopic", C:"Meter-scale", D:"Centimeter-scale", E:"Nanoscopic only visible with TEM"}, ans:"B" }, { id: "q29", text: "29. Which kingdom includes organisms of unicellular form usually found in aquatic habitats?", opts: {A:"Fungi", B:"Plantae", C:"Protista", D:"Monera", E:"Animalia"}, ans:"C" }, { id: "q30", text: "30. On the basis of mode of nutrition protista kingdom is categorized as?", opts: {A:"Autotrophic only", B:"Parasitic only", C:"Saprophytic only", D:"Autotrophic, Parasitic, Saprophytic", E:"Heterotrophic only"}, ans:"D" }, { id: "q31", text: "31. Which genus of protists have both heterotrophic and autotrophic mode of nutrition and hence placed between plant and animal?", opts: {A:"Amoeba", B:"Paramecium", C:"Euglena", D:"Volvox", E:"Plasmodium"}, ans:"C" }, { id: "q32", text: "32. Which kingdom includes non-green plants?", opts: {A:"Plantae", B:"Monera", C:"Protista", D:"Fungi", E:"Animalia"}, ans:"D" }, { id: "q33", text: "33. Which kingdom of organisms has saprophytic nutrition and grows on dead and decaying organic matter?", opts: {A:"Plantae", B:"Animalia", C:"Monera", D:"Fungi", E:"Protista"}, ans:"D" }, { id: "q34", text: "34. Cell wall of fungi is composed of?", opts: {A:"Cellulose", B:"Lignin", C:"Chitin", D:"Peptidoglycan", E:"Pectin"}, ans:"C" }, { id: "q35", text: "35. Mushroom, Mucor and Albugo are examples of?", opts: {A:"Bacteria", B:"Fungi", C:"Algae", D:"Protozoa", E:"Plants"}, ans:"B" }, { id: "q36", text: "36. Which kingdom of organisms include all plants except some algae, diatoms, fungi and members of Monera and Protista?", opts: {A:"Fungi", B:"Plantae", C:"Animalia", D:"Protista", E:"Monera"}, ans:"B" }, { id: "q37", text: "37. Which kingdom of organisms include all animals except protozoans?", opts: {A:"Plantae", B:"Monera", C:"Animalia", D:"Protista", E:"Fungi"}, ans:"C" }, { id: "q38", text: "38. What type of nomenclature is used to name organisms in biology?", opts: {A:"Polynomial nomenclature", B:"Trinomial nomenclature", C:"Binomial nomenclature", D:"Common-name system", E:"Numerical code system"}, ans:"C" }, { id: "q39", text: "39. How many names are given to organisms in binomial nomenclature?", opts: {A:"One (Species)", B:"Two (Genus and Species)", C:"Three (Family, Genus, Species)", D:"Four (Order, Family, Genus, Species)", E:"Variable number"}, ans:"B" }, { id: "q40", text: "40. What is the scientific name of man?", opts: {A:"Homo erectus", B:"Homo habilis", C:"Homo sapiens", D:"Pan troglodytes", E:"Australopithecus afarensis"}, ans:"C" }, { id: "q41", text: "41. What is the scientific name of frog (common pond frog)?", opts: {A:"Rana temporaria", B:"Rana tigrina", C:"Bufo bufo", D:"Hyla arborea", E:"Xenopus laevis"}, ans:"B" }, { id: "q42", text: "42. What is the scientific name of cat?", opts: {A:"Felis catus", B:"Panthera leo", C:"Canis familiaris", D:"Felis chaus", E:"Panthera tigris"}, ans:"A" }, { id: "q43", text: "43. What is the scientific name of dog?", opts: {A:"Vulpes vulpes", B:"Canis lupus familiaris (Canis familiaris)", C:"Felis catus", D:"Canis aureus", E:"Lycaon pictus"}, ans:"B" }, { id: "q44", text: "44. What is the scientific name of cow?", opts: {A:"Bos taurus", B:"Bos indicus", C:"Bubalus bubalis", D:"Equus caballus", E:"Ovis aries"}, ans:"B" }, { id: "q45", text: "45. What is the scientific name of housefly?", opts: {A:"Drosophila melanogaster", B:"Musca domestica", C:"Anopheles gambiae", D:"Aedes aegypti", E:"Tabanus bovinus"}, ans:"B" }, { id: "q46", text: "46. What is the scientific name of mango?", opts: {A:"Citrus sinensis", B:"Mangifera indica", C:"Musa acuminata", D:"Psidium guajava", E:"Malus domestica"}, ans:"B" }, { id: "q47", text: "47. What is the scientific name of rice?", opts: {A:"Triticum aestivum", B:"Oryza sativa", C:"Zea mays", D:"Hordeum vulgare", E:"Sorghum bicolor"}, ans:"B" } ]; // Build markup function buildQuiz() { const form = document.createElement('form'); form.id = 'sdQuizForm'; form.setAttribute('autocomplete','off'); const title = document.createElement('h2'); title.textContent = 'General Biology Quiz — Studentsdash'; const meta = document.createElement('div'); meta.className = 'sd-quiz-meta'; meta.textContent = 'Answer any number of questions. Tap Submit to check answers.'; form.appendChild(title); form.appendChild(meta); questions.forEach((q, idx) => { const qwrap = document.createElement('div'); qwrap.className = 'sd-question'; qwrap.setAttribute('data-qid', q.id); const qtxt = document.createElement('p'); qtxt.className = 'qtext'; qtxt.textContent = q.text; qwrap.appendChild(qtxt); const ul = document.createElement('ul'); ul.className = 'sd-options'; // options may be variable count for (const key of Object.keys(q.opts)) { const li = document.createElement('li'); const optId = `opt-${q.id}-${key}`; li.innerHTML = ` ${key}. ${escapeHtml(q.opts[key])} `; ul.appendChild(li); } qwrap.appendChild(ul); form.appendChild(qwrap); }); // controls const controls = document.createElement('div'); controls.className = 'sd-controls'; const submitBtn = document.createElement('button'); submitBtn.type = 'button'; submitBtn.className = 'sd-btn sd-btn-submit'; submitBtn.id = 'sdSubmitBtn'; submitBtn.textContent = 'Submit Quiz'; const resetBtn = document.createElement('button'); resetBtn.type = 'button'; resetBtn.className = 'sd-btn sd-btn-reset'; resetBtn.id = 'sdResetBtn'; resetBtn.textContent = 'Reset Answers'; controls.appendChild(submitBtn); controls.appendChild(resetBtn); form.appendChild(controls); // result container const result = document.createElement('div'); result.id = 'sdResult'; result.className = 'sd-result'; result.style.display = 'none'; // hidden until submit root.appendChild(form); root.appendChild(result); // Event listeners submitBtn.addEventListener('click', handleSubmit); resetBtn.addEventListener('click', handleReset); } function escapeHtml(str){ return String(str).replace(/[&"']/g, function(m){ return {'&':'&','':'>','"':'"',"'":'''}[m]; }); } // Submit handler function handleSubmit() { const result = document.getElementById('sdResult'); result.innerHTML = ''; result.style.display = 'block'; let score = 0; const total = questions.length; const fragment = document.createDocumentFragment(); const header = document.createElement('div'); header.className = 'item'; header.innerHTML = `Quiz Result — ${new Date().toLocaleString()}`; fragment.appendChild(header); questions.forEach((q, idx) => { const chosen = document.querySelector(`input[name="${q.id}"]:checked`); const wrapper = document.createElement('div'); wrapper.className = 'item'; const qTitle = document.createElement('div'); qTitle.innerHTML = `Q${idx+1}. ${escapeHtml(q.text)}`; wrapper.appendChild(qTitle); if (!chosen) { const p = document.createElement('div'); p.innerHTML = `Not answeredCorrect: ${q.ans}. ${escapeHtml(q.opts[q.ans])}`; wrapper.appendChild(p); } else { const user = chosen.value; const isCorrect = user === q.ans; if (isCorrect) score++; const p = document.createElement('div'); p.innerHTML = `Your answer: ${user}. ${escapeHtml(q.opts[user])} ${isCorrect ? '✔ Correct' : '✖ Wrong'} Correct answer: ${q.ans}. ${escapeHtml(q.opts[q.ans])}`; wrapper.appendChild(p); } fragment.appendChild(wrapper); }); // summary const hr = document.createElement('hr'); hr.style.margin = '12px 0'; fragment.appendChild(hr); const summary = document.createElement('div'); const percent = Math.round((score/total)*100); summary.innerHTML = `Score: ${score} / ${total} (${percent}%)`; fragment.appendChild(summary); // replace result result.appendChild(fragment); // scroll result into view result.scrollIntoView({behavior:'smooth'}); } function handleReset() { // clear radios questions.forEach(q => { const chosen = document.querySelector(`input[name="${q.id}"]:checked`); if (chosen) chosen.checked = false; }); const result = document.getElementById('sdResult'); if (result) { result.style.display = 'none'; result.innerHTML = ''; } // put focus to top const firstInput = document.querySelector(`#sdQuizForm input`); if (firstInput) firstInput.focus(); } // Initialize buildQuiz(); })();