BISE Sahiwal - Chemistry Paper Generator /* --- GLOBAL RESET --- */ * { box-sizing: border-box; } body { margin: 0; padding: 0; background-color: #f0f0f0; font-family: 'Times New Roman', serif; -webkit-print-color-adjust: exact; } /* --- DASHBOARD --- */ #ui-dashboard { background: white; padding: 20px; max-width: 850px; margin: 20px auto; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border-top: 5px solid #27ae60; } h2 { margin-top: 0; color: #2c3e50; font-family: sans-serif; } .controls { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 15px; } .control-group { flex: 1; min-width: 200px; } .control-group label { display: block; font-weight: bold; margin-bottom: 5px; font-family: sans-serif; font-size: 13px; } .control-group input, .control-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; } .actions { display: flex; gap: 10px; margin-top: 20px; } button { flex: 1; padding: 12px; font-weight: bold; cursor: pointer; border: none; border-radius: 4px; color: white; font-size: 16px; } .btn-gen { background-color: #2980b9; } .btn-print { background-color: #27ae60; } button:hover { opacity: 0.9; } /* --- PAPER SHEET --- */ #paper-sheet { width: 210mm; min-height: 297mm; margin: 0 auto 50px auto; background: white; padding: 10mm 12mm; /* Standard Margins */ position: relative; box-shadow: 0 0 15px rgba(0,0,0,0.2); } /* --- BLANK HEADER SPACER (Hidden by default) --- */ .blank-spacer { width: 100%; height: 140mm; display: none; border-bottom: 1px dashed #ccc; margin-bottom: 10mm; position: relative; } .blank-spacer::after { content: "(Space reserved for Letterhead)"; position: absolute; bottom: 5px; width: 100%; text-align: center; font-size: 10px; color: #ccc; } /* --- PRINT SETTINGS --- */ @media print { body { background: white; } #ui-dashboard { display: none; } #paper-sheet { width: 100%; margin: 0; box-shadow: none; padding: 0; } .page-break { page-break-before: always; } } /* --- CONTENT STYLES --- */ .header-table { width: 100%; border-bottom: 2px solid #000; margin-bottom: 5px; } .inst-name { font-size: 24px; font-weight: 900; text-transform: uppercase; text-align: center; } .paper-title { font-size: 16px; font-weight: bold; text-align: center; text-transform: uppercase; margin-top: 5px; } .meta-strip { display: flex; justify-content: space-between; font-weight: bold; font-size: 14px; margin-bottom: 10px; border-bottom: 1px solid #000; padding-bottom: 2px; } .section-head { background: #000; color: white; padding: 3px 10px; font-weight: bold; font-size: 15px; margin: 10px 0; display: flex; justify-content: space-between; -webkit-print-color-adjust: exact; } .urdu { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; margin-left: 8px; font-size: 15px; line-height: 1.4; } /* MCQs */ .mcq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; } .mcq-item { border-bottom: 1px dashed #aaa; padding-bottom: 2px; break-inside: avoid; } .mcq-q { font-weight: bold; font-size: 13px; display: flex; justify-content: space-between; } .mcq-opts { display: flex; font-size: 12px; justify-content: space-between; margin-top: 3px; } .mcq-opts span { width: 25%; } /* Subjective */ .q-title { font-weight: bold; text-decoration: underline; margin: 10px 0 5px 0; font-size: 14px; } .sq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .sq-item { border: 1px solid #ccc; padding: 4px; font-size: 13px; display: flex; flex-direction: column; justify-content: space-between; background: #fff; break-inside: avoid; } .lq-item { margin-bottom: 12px; border-bottom: 1px solid #000; padding-bottom: 8px; break-inside: avoid; } .lq-part { display: flex; justify-content: space-between; font-size: 14px; margin-top: 4px; } /* Key */ .key-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; text-align: center; margin-top: 10px; } .key-box { border: 1px solid #000; background: #eee; font-size: 12px; padding: 2px; font-weight: bold; } 🧪 Paper Generator (Chapter 11) Institute Name: Paper Type: Full Board Pattern (60 Marks) Objective Only (12 Marks) Subjective Only (48 Marks) Start Space: No (Standard Top) Leave Top Half Blank Answer Key: Include Answer Key No Key 🔄 Generate Paper 🖨️ Print Paper // ========================================== // DATABASE: CHAPTER 11 ORGANIC CHEMISTRY // ========================================== const db_mcqs = [ {q: "Vital Force Theory was proposed by:", u: "وائٹل فورس تھیوری کس نے پیش کی؟", o: ["Wohler", "Berzelius", "Dalton", "Bohr"], c: 1}, {q: "Who synthesized the first organic compound?", u: "پہلا نامیاتی مرکب کس نے تیار کیا؟", o: ["Kolbe", "Wohler", "Berzelius", "Lavoisier"], c: 1}, {q: "First organic compound prepared in lab was:", u: "لیبارٹری میں تیار ہونے والا پہلا نامیاتی مرکب تھا:", o: ["Urea", "Methane", "Acetic Acid", "Glucose"], c: 0}, {q: "Formula of Urea is:", u: "یوریا کا فارمولا ہے:", o: ["NH₂CONH₂", "CH₄N₂O", "Both A & B", "NH₄CNO"], c: 2}, {q: "Organic compounds are compounds of:", u: "نامیاتی مرکبات کن کے کمپاؤنڈز ہیں؟", o: ["Carbon", "Nitrogen", "Oxygen", "Sulfur"], c: 0}, {q: "Self-linking property of Carbon is called:", u: "کاربن کے خود سے جڑنے کی خاصیت کہلاتی ہے:", o: ["Catenation", "Isomerism", "Hydration", "Sublimation"], c: 0}, {q: "Which element is essential for organic compounds?", u: "نامیاتی مرکبات کے لیے کون سا عنصر ضروری ہے؟", o: ["N", "O", "C", "H"], c: 2}, {q: "Rate of reaction of organic compounds is:", u: "نامیاتی مرکبات کے ری ایکشن کی رفتار ہوتی ہے:", o: ["Fast", "Very Slow", "Moderate", "Explosive"], c: 1}, {q: "Organic compounds are generally soluble in:", u: "نامیاتی مرکبات عام طور پر حل پذیر ہوتے ہیں:", o: ["Water", "Polar Solvents", "Non-polar Solvents", "Acids"], c: 2}, {q: "Isomerism is shown by:", u: "آئسومرزم ظاہر کرتے ہیں:", o: ["Ionic compounds", "Covalent compounds", "Organic compounds", "Both B & C"], c: 3}, {q: "Main component of Natural Gas is:", u: "قدرتی گیس کا اہم جزو ہے:", o: ["Methane", "Propane", "Butane", "Ethane"], c: 0}, {q: "Methane content in Natural Gas is about:", u: "قدرتی گیس میں میتھین کی مقدار ہے:", o: ["85%", "95%", "60%", "50%"], c: 0}, {q: "Percentage of Carbon in Anthracite is:", u: "اینتھراسائٹ میں کاربن کی فیصد مقدار ہے:", o: ["90%", "80%", "70%", "60%"], c: 0}, {q: "Lowest quality of coal is:", u: "کوئلے کی سب سے گھٹیا قسم ہے:", o: ["Peat", "Lignite", "Bituminous", "Anthracite"], c: 0}, {q: "Destructive distillation of coal produces:", u: "کوئلے کی ڈسٹرکٹو ڈسٹیلیشن سے بنتا ہے:", o: ["Coal Tar", "Coke", "Coal Gas", "All of these"], c: 3}, {q: "Petroleum is a mixture of:", u: "پیٹرولیم کس کا آمیزہ ہے؟", o: ["Salts", "Hydrocarbons", "Acids", "Bases"], c: 1}, {q: "General formula of Alkanes is:", u: "الکینز کا جنرل فارمولا ہے:", o: ["CₙH₂ₙ₊₂", "CₙH₂ₙ", "CₙH₂ₙ₋₂", "CₙH₂ₙ₊₁"], c: 0}, {q: "General formula of Alkyl Radical is:", u: "الکائل ریڈیکل کا جنرل فارمولا ہے:", o: ["CₙH₂ₙ₊₂", "CₙH₂ₙ", "CₙH₂ₙ₊₁", "CₙH₂ₙ₋₁"], c: 2}, {q: "Formula of Ethyl radical is:", u: "ایتھائل ریڈیکل کا فارمولا ہے:", o: ["C₂H₅", "CH₃", "C₃H₇", "C₄H₉"], c: 0}, {q: "Which one is Isopropyl?", u: "ان میں سے آئسو پروپائل کون سا ہے؟", o: ["CH₃-CH₂-CH₂-", "(CH₃)₂CH-", "CH₃-CH₂-", "CH₃-"], c: 1}, {q: "Functional group of Alcohol is:", u: "الکحل کا فنکشنل گروپ ہے:", o: ["-OH", "-CHO", "-COOH", "-X"], c: 0}, {q: "General formula of Ether is:", u: "ایتھر کا جنرل فارمولا ہے:", o: ["R-O-R", "R-OH", "R-CO-R", "R-CHO"], c: 0}, {q: "Functional group -CHO is called:", u: "-CHO فنکشنل گروپ کہلاتا ہے:", o: ["Aldehydic", "Ketonic", "Carboxyl", "Amino"], c: 0}, {q: "Which one is a Ketone?", u: "ان میں سے کیٹون کون سا ہے؟", o: ["CH₃COCH₃", "CH₃CHO", "CH₃COOH", "CH₃OCH₃"], c: 0}, {q: "Formula of Acetone is:", u: "ایسیٹون کا فارمولا ہے:", o: ["CH₃COCH₃", "C₂H₅OH", "CH₃COOH", "HCHO"], c: 0}, {q: "Functional group of Carboxylic acid is:", u: "کاربوکسالک ایسڈ کا فنکشنل گروپ ہے:", o: ["-COOH", "-OH", "-CHO", "-CO-"], c: 0}, {q: "Formula of Formic Acid is:", u: "فارمک ایسڈ کا فارمولا ہے:", o: ["HCOOH", "CH₃COOH", "CH₃OH", "HCHO"], c: 0}, {q: "Functional group containing Nitrogen is:", u: "نائٹروجن رکھنے والا فنکشنل گروپ ہے:", o: ["Amine", "Ether", "Alcohol", "Ester"], c: 0}, {q: "General formula of Primary Amine is:", u: "پرائمری امین کا جنرل فارمولا ہے:", o: ["R-NH₂", "R-NH-R", "R₃N", "R-NO₂"], c: 0}, {q: "Formula of Ethyl Alcohol is:", u: "ایتھائل الکحل کا فارمولا ہے:", o: ["C₂H₅OH", "CH₃OH", "CH₃COOH", "C₆H₆"], c: 0}, {q: "Functional group of Alkyl Halides is:", u: "الکائل ہلائڈز کا فنکشنل گروپ ہے:", o: ["-X", "-OH", "-SH", "-CN"], c: 0}, {q: "Condensed formula of n-Butane is:", u: "این-بیوٹین کا کنڈینسڈ فارمولا ہے:", o: ["CH₃(CH₂)₂CH₃", "CH₃CH₂CH₃", "C₄H₁₀", "CH₃(CH₂)₃CH₃"], c: 0} ]; const db_shorts = [ {e: "Define Organic Chemistry.", u: "آرگینک کیمسٹری کی تعریف کریں۔"}, {e: "What is Vital Force Theory?", u: "وائٹل فورس تھیوری کیا ہے؟"}, {e: "Who rejected Vital Force Theory and how?", u: "وائٹل فورس تھیوری کو کس نے اور کیسے مسترد کیا؟"}, {e: "Why organic compounds are large in number?", u: "آرگینک کمپاؤنڈز کی تعداد زیادہ کیوں ہے؟"}, {e: "Define Catenation.", u: "کیٹینیشن کی تعریف کریں۔"}, {e: "What are the necessary conditions for Catenation?", u: "کیٹینیشن کے لیے ضروری شرائط کیا ہیں؟"}, {e: "Define Isomerism. Give one example.", u: "آئسومرزم کی تعریف کریں۔ ایک مثال دیں۔"}, {e: "Why are organic compounds poor conductors?", u: "آرگینک کمپاؤنڈز بجلی کے ناقص کنڈکٹر کیوں ہوتے ہیں؟"}, {e: "Differentiate between Open Chain and Closed Chain compounds.", u: "اوپن چین اور کلوزڈ چین کمپاؤنڈز میں فرق کریں۔"}, {e: "What are Heterocyclic compounds? Give example.", u: "ہیٹروسائیکلک کمپاؤنڈز کیا ہیں؟"}, {e: "Define Aromatic compounds with example.", u: "ایرومیٹک کمپاؤنڈز کی تعریف کریں۔"}, {e: "Write the molecular and structural formula of n-Butane.", u: "این-بیوٹین کا مالیکیولر اور سٹرکچرل فارمولا لکھیں۔"}, {e: "Define Coal. How is it formed?", u: "کوئلہ کی تعریف کریں۔ یہ کیسے بنتا ہے؟"}, {e: "What is Carbonization?", u: "کاربونائزیشن کیا ہے؟"}, {e: "Name the four types of Coal.", u: "کوئلے کی چار اقسام کے نام لکھیں۔"}, {e: "Write two uses of Bituminous coal.", u: "بیٹومینس کوئلے کے دو استعمالات لکھیں۔"}, {e: "What is Destructive Distillation of coal?", u: "کوئلے کی ڈسٹرکٹو ڈسٹیلیشن کیا ہے؟"}, {e: "Write the components of Coal Gas.", u: "کول گیس کے اجزاء لکھیں۔"}, {e: "Define Petroleum.", u: "پیٹرولیم کی تعریف کریں۔"}, {e: "What is Natural Gas? Why is it important?", u: "قدرتی گیس کیا ہے؟ یہ کیوں اہم ہے؟"}, {e: "What is Coke? How is it used?", u: "کوک کیا ہے؟ یہ کیسے استعمال ہوتا ہے؟"}, {e: "What is Coal Tar? Give its uses.", u: "کول تار کیا ہے؟ اس کے استعمالات لکھیں۔"}, {e: "Define Homologous Series.", u: "ہومولوگس سیریز کی تعریف کریں۔"}, {e: "Define Alkyl Radical. Give its general formula.", u: "الکائل ریڈیکل کی تعریف کریں۔ اس کا جنرل فارمولا لکھیں۔"}, {e: "How are Propyl radicals formed?", u: "پروپائل ریڈیکلز کیسے بنتے ہیں؟"}, {e: "Differentiate between n-Propyl and Isopropyl.", u: "این-پروپائل اور آئسو پروپائل میں فرق کریں۔"}, {e: "Convert Methane into Methyl radical.", u: "میتھین کو میتھائل ریڈیکل میں تبدیل کریں۔"}, {e: "Define Functional Group. Give an example.", u: "فنکشنل گروپ کی تعریف کریں۔ ایک مثال دیں۔"}, {e: "What is the functional group of Alcohols?", u: "الکوحل کا فنکشنل گروپ کیا ہے؟"}, {e: "Differentiate between Aldehydic and Ketonic groups.", u: "الڈیہائڈک اور کیٹونک گروپس میں فرق کریں۔"}, {e: "Write the general formula of Carboxylic Acids.", u: "کاربوکسالک ایسڈز کا جنرل فارمولا لکھیں۔"}, {e: "What is the functional group of Esters?", u: "ایسٹرز کا فنکشنل گروپ کیا ہے؟"}, {e: "What are Amines? Give formula of Primary Amine.", u: "امینز کیا ہیں؟ پرائمری امین کا فارمولا لکھیں۔"}, {e: "What is an Ether Linkage? Give example.", u: "ایتھر لنکیج کیا ہے؟ مثال دیں۔"}, {e: "Write the formula of Acetone and Acetaldehyde.", u: "ایسیٹون اور ایسیٹ الڈیہائڈ کا فارمولا لکھیں۔"}, {e: "Identify the functional group in CH₃-O-CH₃.", u: "CH₃-O-CH₃ میں فنکشنل گروپ کی نشاندہی کریں۔"}, {e: "Define Alkyl Halides. Give an example.", u: "الکائل ہلائڈز کی تعریف کریں۔ ایک مثال دیں۔"} ]; const db_longs = [ {a: "Explain four characteristics of Organic Compounds.", u: "آرگینک کمپاؤنڈز کی چار خصوصیات بیان کریں۔", b: "Define Functional Group. Explain Alcohol and Ether.", u: "فنکشنل گروپ کی تعریف کریں۔ الکحل اور ایتھر کی وضاحت کریں۔"}, {a: "What is Coal? Explain different types of Coal.", u: "کوئلہ کیا ہے؟ کوئلے کی مختلف اقسام بیان کریں۔", b: "Write a note on Homologous Series.", u: "ہومولوگس سیریز پر نوٹ لکھیں۔"}, {a: "Describe classification of Organic Compounds.", u: "آرگینک کمپاؤنڈز کی کلاسیفیکیشن بیان کریں۔", b: "Explain formation of Alkyl Radicals of Propane.", u: "پروپین کے الکائل ریڈیکلز بننے کا عمل بیان کریں۔"}, {a: "What is Destructive Distillation of Coal? Explain.", u: "کوئلے کی ڈسٹرکٹو ڈسٹیلیشن کیا ہے؟ وضاحت کریں۔", b: "Write functional groups containing C, H and O.", u: "کاربن، ہائیڈروجن اور آکسیجن رکھنے والے فنکشنل گروپس لکھیں۔"}, {a: "Explain importance of Natural Gas and Petroleum.", u: "قدرتی گیس اور پیٹرولیم کی اہمیت بیان کریں۔", b: "Differentiate between Molecular and Condensed formulas.", u: "مالیکیولر اور کنڈینسڈ فارمولوں میں فرق کریں۔"} ]; // ========================================== // LOGIC // ========================================== function getRandom(arr, n) { let result = new Array(n), len = arr.length, taken = new Array(len); if (n > len) n = len; while (n--) { let x = Math.floor(Math.random() * len); result[n] = arr[x in taken ? taken[x] : x]; taken[x] = --len in taken ? taken[len] : len; } return result; } function generatePaper() { const inst = document.getElementById('inp-inst').value; const type = document.getElementById('inp-type').value; const useSpacer = document.getElementById('inp-spacer').value; const showKey = document.getElementById('inp-key').value === 'yes'; const sheet = document.getElementById('paper-sheet'); let currentKey = []; let html = ''; // Spacer Logic let spacerStyle = (useSpacer === 'yes') ? 'display:block;' : 'display:none;'; html += ``; // Header let totalMarks = (type==='obj')?12:(type==='subj')?48:60; let time = (type==='obj')?"20 Min":(type==='subj')?"1:45 Hours":"2:00 Hours"; html += ` ${inst} Chemistry (9th/10th) - Chapter 11 Roll No: Time: ${time} Total Marks: ${totalMarks} `; // Objective if(type === 'full' || type === 'obj') { const mcqs = getRandom(db_mcqs, 12); html += ` PART - I (Objective) Marks: 12 Q.1: Choose the correct answer. (12 x 1 = 12) `; const opts = ['A', 'B', 'C', 'D']; mcqs.forEach((m, i) => { currentKey.push({n: i+1, k: opts[m.c]}); html += ` ${i+1}. ${m.q} ${m.u} (A) ${m.o[0]} (B) ${m.o[1]} (C) ${m.o[2]} (D) ${m.o[3]} `; }); html += ``; } // Subjective if(type === 'full' || type === 'subj') { html += ` PART - II (Subjective) Marks: 48 SECTION - I `; let shortsPool = getRandom(db_shorts, 24); // If pool < 24, fill with randoms while(shortsPool.length < 24) { shortsPool.push(db_shorts[Math.floor(Math.random() * db_shorts.length)]); } let qIdx = 0; [2, 3, 4].forEach(qNum => { html += ` Q.${qNum}: Write short answers to any FIVE (5) questions. (5 x 2 = 10) `; for(let i=0; i { let l = longs[i]; html += ` Q.${qNum}: (a) ${l.a} (5) ${l.u} (b) ${l.b} (4) ${l.b_u || l.u} `; }); } // Key if(showKey && (type === 'full' || type === 'obj')) { html += ` ANSWER KEY `; currentKey.forEach(k => { html += `Q.${k.n}: ${k.k}`; }); html += ``; } sheet.innerHTML = html; } window.onload = generatePaper;