9th Class Chemistry chapter No 7 PDF Paper 9th Chemistry Ch-7 Paper Generator - BISE Sahiwal /* --- 1. RESET & BASICS --- */ * { box-sizing: border-box; } html, body { margin: 0; padding: 0; background-color: #525659; /* Grey background for screen */ font-family: 'Times New Roman', serif; -webkit-print-color-adjust: exact; } /* --- 2. CONTROL PANEL (INPUT BOXES) --- */ #ui-controls { background: white; padding: 25px; max-width: 900px; margin: 20px auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); border-top: 5px solid #28a745; } .control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; text-align: left; } .input-group label { display: block; font-weight: bold; margin-bottom: 8px; color: #333; } .input-group input, .input-group select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 14px; } .btn-container { display: flex; gap: 15px; } .btn { flex: 1; background-color: #28a745; color: white; border: none; padding: 12px; font-size: 16px; border-radius: 5px; cursor: pointer; font-weight: bold; transition: 0.3s; } .btn:hover { background-color: #218838; } .btn-dl { background-color: #007bff; } .btn-dl:hover { background-color: #0069d9; } /* --- 3. PAPER CONTAINER (A4 Visual) --- */ #paper-preview { width: 210mm; min-height: 297mm; margin: 0 auto 50px auto; background: white; padding: 12mm 12mm; box-shadow: 0 0 20px rgba(0,0,0,0.5); position: relative; height: auto; } /* --- 4. PRINTING STATE (BLANK PAGE FIX) --- */ body.printing-mode { background: white; } body.printing-mode #ui-controls { display: none; } body.printing-mode #paper-preview { margin: 0; box-shadow: none; width: 100%; padding: 5mm; } /* --- 5. TYPOGRAPHY & URDU --- */ .urdu-text { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; display: inline-block; font-size: 15px; line-height: 1.6; margin-left: 10px; vertical-align: middle; } /* --- 6. HEADER LAYOUT --- */ .header-sec { text-align: center; border-bottom: 2px solid #000; padding-bottom: 5px; margin-bottom: 15px; } .bise-title { font-size: 22px; font-weight: 900; text-transform: uppercase; margin: 0; letter-spacing: 1px; } .sub-title { font-size: 16px; font-weight: bold; margin: 5px 0; } .meta-table { width: 100%; border-collapse: collapse; margin-top: 10px; border-top: 1px solid #000; } .meta-table td { padding: 4px 0; font-weight: bold; font-size: 14px; vertical-align: bottom; } .roll-no-box { border-bottom: 1px dotted #000; display: inline-block; width: 150px; } /* --- 7. CONTENT LAYOUTS --- */ .section-header { background-color: #000; color: #fff; padding: 5px 10px; font-weight: bold; font-size: 16px; margin: 15px 0 10px 0; display: flex; justify-content: space-between; align-items: center; } .mcq-container { column-count: 2; column-gap: 20px; } .mcq-box { break-inside: avoid; margin-bottom: 10px; border-bottom: 1px dashed #ccc; padding-bottom: 5px; font-size: 13px; } .mcq-q { font-weight: bold; display: flex; justify-content: space-between; align-items: baseline; } .mcq-opts { display: flex; flex-wrap: wrap; justify-content: space-between; margin-top: 4px; font-size: 12px; } .mcq-opt { width: 48%; } .sub-heading { font-weight: bold; text-decoration: underline; font-size: 15px; margin: 15px 0 5px 0; } .short-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .short-item { border: 1px solid #ddd; padding: 5px 8px; font-size: 13px; background: #fdfdfd; break-inside: avoid; } .long-item { margin-bottom: 15px; border-bottom: 1px solid #000; padding-bottom: 10px; break-inside: avoid; } /* --- 8. NATIVE PRINT --- */ @media print { body { background: white; margin: 0; } #ui-controls { display: none; } #paper-preview { margin: 0; box-shadow: none; width: 100%; } } ⚗️ 9th Chemistry Paper Generator (Chapter 7) Institute Name / Title: Paper Type: Full Paper (Obj + Subj) Objective Only (12 Marks) Subjective Only (48 Marks) 🔄 Generate New Paper 📄 Download PDF // ============================================ // 1. DATABASE (Chapter 7: Electrochemistry) // ============================================ const db_mcqs = [ { q: "Spontaneous chemical reactions take place in:", u: "خودکار کیمیائی ری ایکشنز وقوع پذیر ہوتے ہیں:", o: ["Galvanic cell", "Electrolytic cell", "Nelson's cell", "Down's cell"], k: "A" }, { q: "Formation of water from hydrogen and oxygen is:", u: "ہائیڈروجن اور آکسیجن سے پانی کا بننا ہے:", o: ["Redox reaction", "Acid-base reaction", "Neutralization", "Decomposition"], k: "A" }, { q: "Which one of the following is not an electrolytic cell?", u: "مندرجہ ذیل میں سے کون سا الیکٹرولیٹک سیل نہیں ہے؟", o: ["Down's cell", "Galvanic cell", "Nelson's cell", "Both A & C"], k: "B" }, { q: "The oxidation number of chromium in K2Cr2O7 is:", u: "K2Cr2O7 میں کرومیم کا آکسیڈیشن نمبر ہے:", o: ["+2", "+6", "+7", "+14"], k: "B" }, { q: "Which of the following is a non-electrolyte?", u: "مندرجہ ذیل میں سے کون سا نان الیکٹرولائٹ ہے؟", o: ["Sugar solution", "Sulphuric acid", "Lime solution", "NaCl solution"], k: "A" }, { q: "In which cell chemical energy is converted into electrical energy?", u: "کس سیل میں کیمیائی انرجی برقی انرجی میں تبدیل ہوتی ہے؟", o: ["Electrolytic cell", "Galvanic cell", "Down's cell", "Nelson's cell"], k: "B" }, { q: "The oxidation number of Hydrogen in CaH2 is:", u: "CaH2 میں ہائیڈروجن کا آکسیڈیشن نمبر ہے:", o: ["+1", "-1", "+2", "0"], k: "B" }, { q: "Rusting of iron involves:", u: "لوہے کا زنگ لگنا مشتمل ہے:", o: ["Reduction", "Oxidation", "Redox", "Decomposition"], k: "C" }, { q: "Caustic soda is prepared on industrial scale in:", u: "کاسٹک سوڈا صنعتی پیمانے پر تیار کیا جاتا ہے:", o: ["Down's cell", "Galvanic cell", "Nelson's cell", "Daniel cell"], k: "C" }, { q: "Sodium metal is prepared in:", u: "سوڈیم دھات تیار کی جاتی ہے:", o: ["Down's cell", "Nelson's cell", "Daniel cell", "Voltaic cell"], k: "A" }, { q: "Which is the strongest oxidizing agent?", u: "سب سے طاقتور آکسیڈائزنگ ایجنٹ کون سا ہے؟", o: ["F2", "Cl2", "Br2", "I2"], k: "A" }, { q: "Which element is used for coating iron in galvanizing?", u: "گیلوینائزنگ میں لوہے پر کس دھات کی تہہ جمائی جاتی ہے؟", o: ["Zn", "Sn", "Cr", "Cu"], k: "A" }, { q: "Loss of electrons is called:", u: "الیکٹران کا اخراج کہلاتا ہے:", o: ["Oxidation", "Reduction", "Redox", "None"], k: "A" }, { q: "One Faraday is equal to:", u: "ایک فیراڈے برابر ہوتا ہے:", o: ["96500 C", "9650 C", "965 C", "9.65 C"], k: "A" }, { q: "In Nelson's cell, the anode is made of:", u: "نیلسن سیل میں اینوڈ بنا ہوتا ہے:", o: ["Fe", "Zn", "Graphite", "Steel"], k: "C" }, { q: "Oxidation number of free element is:", u: "آزاد عنصر کا آکسیڈیشن نمبر ہوتا ہے:", o: ["Zero", "+1", "-1", "Valency"], k: "A" } ]; const db_shorts = [ { q: "Define Oxidation and Reduction in terms of electrons.", u: "الیکٹرانز کے حوالے سے آکسیڈیشن اور ریڈکشن کی تعریف کریں۔" }, { q: "What is the difference between Valency and Oxidation State?", u: "ویلینسی اور آکسیڈیشن سٹیٹ میں کیا فرق ہے؟" }, { q: "Define Oxidizing Agent.", u: "آکسیڈائزنگ ایجنٹ کی تعریف کریں۔" }, { q: "What is a Salt Bridge? What is its function?", u: "سالٹ برج کیا ہے؟ اس کا کیا کام ہے؟" }, { q: "Differentiate between Electrolytic and Galvanic cells.", u: "الیکٹرولیٹک اور گیلوانک سیل میں فرق بیان کریں۔" }, { q: "Why is an anode positively charged in an electrolytic cell?", u: "الیکٹرولیٹک سیل میں اینوڈ پر مثبت چارج کیوں ہوتا ہے؟" }, { q: "Define Strong and Weak Electrolytes.", u: "طاقتور اور کمزور الیکٹرولائٹس کی تعریف کریں۔" }, { q: "What is Galvanizing?", u: "گیلوینائزنگ کیا ہے؟" }, { q: "Write the reaction occurring at cathode in Nelson's cell.", u: "نیلسن سیل کے کیتھوڈ پر ہونے والا ری ایکشن لکھیں۔" }, { q: "Define Corrosion.", u: "کورویژن کی تعریف کریں۔" }, { q: "Find the Oxidation number of Nitrogen in HNO3.", u: "HNO3 میں نائٹروجن کا آکسیڈیشن نمبر معلوم کریں۔" }, { q: "How is electroplating of Silver done?", u: "سلور کی الیکٹروپلیٹنگ کیسے کی جاتی ہے؟" }, { q: "What is the principle of Electroplating?", u: "الیکٹروپلیٹنگ کا اصول کیا ہے؟" }, { q: "Why does Iron rust?", u: "لوہے کو زنگ کیوں لگتا ہے؟" }, { q: "Define Non-Electrolytes with examples.", u: "نان الیکٹرولائٹس کی مثالوں کے ساتھ تعریف کریں۔" }, { q: "Write the redox reaction taking place in Daniel Cell.", u: "ڈینیل سیل میں ہونے والا ریڈوکس ری ایکشن لکھیں۔" }, { q: "Find Oxidation number of S in H2SO4.", u: "H2SO4 میں سلفر کا آکسیڈیشن نمبر معلوم کریں۔" }, { q: "Why is O2 necessary for rusting?", u: "زنگ لگنے کے لیے آکسیجن کیوں ضروری ہے؟" }, { q: "Define Electrochemistry.", u: "الیکٹروکیمسٹری کی تعریف کریں۔" }, { q: "What is tin plating?", u: "ٹن پلیٹنگ کیا ہے؟" } ]; const db_longs = [ { q: "Explain the manufacturing of Sodium Hydroxide (NaOH) by Nelson's Cell along with a diagram.", u: "نیلسن سیل کے ذریعے سوڈیم ہائیڈروآکسائیڈ کی تیاری کی وضاحت ڈایاگرام کے ساتھ کریں۔", marks: 5 }, { q: "Describe the electrolysis of water in detail.", u: "پانی کی الیکٹرولائسز کی تفصیل سے وضاحت کریں۔", marks: 4 }, { q: "Explain the process of Rusting of Iron in detail.", u: "لوہے کو زنگ لگنے کے عمل کی تفصیلی وضاحت کریں۔", marks: 5 }, { q: "Write a note on Electroplating of Chromium.", u: "کرومیم کی الیکٹروپلیٹنگ پر نوٹ لکھیں۔", marks: 4 }, { q: "State the rules for assigning Oxidation Numbers.", u: "آکسیڈیشن نمبر دینے کے اصول بیان کریں۔", marks: 5 }, { q: "Comparsion between Electrolytic Cell and Galvanic Cell.", u: "الیکٹرولیٹک سیل اور گیلوانک سیل میں موازنہ کریں۔", marks: 4 }, { q: "Explain the manufacturing of Sodium metal from fused NaCl (Down's Cell).", u: "پگھلے ہوئے NaCl سے سوڈیم کی تیاری (ڈاؤنز سیل) کی وضاحت کریں۔", marks: 5 } ]; // ============================================ // 2. LOGIC FUNCTIONS // ============================================ function shuffle(array) { let currentIndex = array.length, randomIndex; while (currentIndex != 0) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex--; [array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]]; } return array; } function getDualText(eng, urdu) { if (!urdu || eng.trim() == urdu.trim()) return `${eng}`; return `${eng} ${urdu}`; } function generatePaper() { const preview = document.getElementById('paper-preview'); const instName = document.getElementById('instName').value; const pType = document.getElementById('paperType').value; // --- PREPARE DATA --- // 1. MCQs const mcqs = shuffle([...db_mcqs]).slice(0, 12); // 2. Shorts (Need 24 total for Q2, Q3, Q4) let shortsPool = shuffle([...db_shorts]); while(shortsPool.length < 24) { shortsPool = shortsPool.concat(db_shorts); } const q2 = shortsPool.slice(0, 8); const q3 = shortsPool.slice(8, 16); const q4 = shortsPool.slice(16, 24); // 3. Longs (Need 2 full questions, A & B) let longsPool = shuffle([...db_longs]); const longQs = [ { a: longsPool[0], b: longsPool[1] }, { a: longsPool[2], b: longsPool[3] } ]; // --- DETERMINE MARKS/TIME --- let timeAllowed = "2:10 Hours"; let totalMarks = "60"; if(pType === 'obj') { timeAllowed = "15 Mins"; totalMarks = "12"; } if(pType === 'subj') { timeAllowed = "1:55 Hours"; totalMarks = "48"; } // --- BUILD HTML --- let html = ` ${instName} CHEMISTRY - 9th Class (Chapter 7: Electrochemistry) Time Allowed: ${timeAllowed} Total Marks: ${totalMarks} Name: ______________________ Roll No: `; // --- RENDER OBJECTIVE --- if (pType === 'full' || pType === 'obj') { html += ` PART - I (Objective) Marks: 12 Q.1: Choose the correct answer. (12 x 1 = 12) ${mcqs.map((m, i) => ` ${i+1}. ${m.q} ${m.u} (A) ${getDualText(m.o[0], m.o[0])} (B) ${getDualText(m.o[1], m.o[1])} (C) ${getDualText(m.o[2], m.o[2])} (D) ${getDualText(m.o[3], m.o[3])} `).join('')} `; } // --- RENDER SUBJECTIVE --- if (pType === 'full' || pType === 'subj') { if(pType === 'full') html += ``; html += ` PART - II (Subjective) Marks: 48 SECTION - I Note: Attempt any FIVE parts from each question. (5 x 2 = 10 each) ${renderShortBlock(2, q2)} ${renderShortBlock(3, q3)} ${renderShortBlock(4, q4)} SECTION - II Note: Attempt any TWO questions. (9 x 2 = 18) ${longQs.map((q, i) => ` Q.${5+i} (a): ${q.a.q} (${q.a.marks}) ${q.a.u} (b): ${q.b.q} (${q.b.marks}) ${q.b.u} `).join('')} `; } preview.innerHTML = html; } function renderShortBlock(qNum, questions) { return ` Q.${qNum}: ${questions.map((q, i) => ` (${i+1}) ${q.q} ${q.u} `).join('')} `; } function downloadPDF() { document.body.classList.add('printing-mode'); window.scrollTo(0, 0); const element = document.getElementById('paper-preview'); const opt = { margin: [10, 10, 10, 10], filename: 'Chemistry-9th-Ch7-Paper.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true, scrollY: 0 }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }, pagebreak: { mode: ['avoid-all', 'css', 'legacy'] } }; html2pdf().from(element).set(opt).save().then(() => { document.body.classList.remove('printing-mode'); }); } // Initialize on load window.onload = generatePaper;