ÿþ<!DOCTYPE html> <html lang="hi"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>UP TET * G * 0 2 - - > 7 > & M 5 ? $ @ / (   M 0 G  @ )  8 >  ( . G    ( 0 G  0 </title> <link href="img/logo1.jpg" rel="icon"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> :root { --primary: #1d7a5e; --primary-dark: #146b51; --secondary: #38a89d; --danger: #e5533b; --success: #2c7da0; --light: #f0fdf4; --dark: #2d3748; --gray: #718096; --border-radius: 12px; --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); --transition: all 0.3s ease; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background: linear-gradient(135deg, #e0f2fe 0%, #cbd5e1 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; color: var(--dark); line-height: 1.6; } .container { width: 100%; max-width: 950px; background: white; border-radius: var(--border-radius); box-shadow: var(--box-shadow); overflow: hidden; transition: var(--transition); animation: fadeIn 0.5s ease-out; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; padding: 30px 20px; text-align: center; position: relative; overflow: hidden; } .header::before { content: ''; position: absolute; top: -50px; right: -50px; width: 150px; height: 150px; background: rgba(255, 255, 255, 0.1); border-radius: 50%; } .header h1 { font-size: 2rem; margin-bottom: 10px; font-weight: 700; position: relative; z-index: 1; } .header p { font-size: 1rem; opacity: 0.9; position: relative; z-index: 1; } .content-area { padding: 30px; } .hidden { display: none !important; } .btn { display: inline-block; padding: 12px 28px; border-radius: 50px; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; text-align: center; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); margin: 10px 5px; } .btn-primary { background: var(--primary); color: white; } .btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 15px rgba(29, 122, 94, 0.3); } .btn-success { background: var(--success); color: white; } .btn-success:hover { background: #1f5e7a; transform: translateY(-2px); } .btn-danger { background: var(--danger); color: white; } .btn-danger:hover { background: #c53a1f; transform: translateY(-2px); } .btn-level { background: var(--light); color: var(--dark); border: 2px solid var(--gray); font-size: 1.2rem; padding: 15px 30px; width: 200px; } .btn-level:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); } .btn-level.selected { background: var(--primary); color: white; border-color: var(--primary); } .btn-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0; } .level-buttons { display: flex; justify-content: center; gap: 20px; margin: 30px 0; } .section-title { text-align: center; margin-bottom: 25px; color: var(--primary-dark); font-size: 1.5rem; position: relative; padding-bottom: 10px; } .section-title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 80px; height: 3px; background: var(--secondary); border-radius: 3px; } .checkbox-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 25px 0; max-height: 500px; overflow-y: auto; padding: 10px; border: 1px solid #eee; border-radius: var(--border-radius); } .checkbox-item { display: flex; align-items: center; } .checkbox-item input { margin-right: 10px; width: 18px; height: 18px; cursor: pointer; } .checkbox-item label { cursor: pointer; font-size: 0.9rem; } .instructions { margin-bottom: 30px; padding: 20px; background: #f8f9fa; border-radius: var(--border-radius); } .instructions ol { padding-left: 20px; margin-top: 10px; } .instructions li { margin-bottom: 8px; } .question-section { margin-bottom: 30px; } .section-heading { font-weight: 600; color: var(--primary-dark); margin-bottom: 15px; padding-bottom: 5px; border-bottom: 1px solid #eee; } .question { margin-bottom: 20px; page-break-inside: avoid; } .question-text { font-weight: 500; margin-bottom: 8px; } .option { margin-left: 20px; margin-bottom: 5px; } .action-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin-top: 40px; } .answer-sheet { margin-top: 40px; padding: 20px; background: #f8f9fa; border-radius: var(--border-radius); } .answer-table { width: 100%; border-collapse: collapse; margin-top: 15px; } .answer-table th, .answer-table td { border: 1px solid #ddd; padding: 8px; text-align: center; } .answer-table th { background-color: var(--primary); color: white; } .answer-table tr:nth-child(even) { background-color: #f2f2f2; } @media (max-width: 768px) { .header h1 { font-size: 1.6rem; } .content-area { padding: 20px; } .checkbox-container { grid-template-columns: 1fr; } .btn { padding: 10px 20px; font-size: 0.9rem; } .btn-level { width: 150px; font-size: 1rem; padding: 12px 20px; } .level-buttons { flex-direction: column; align-items: center; } } @media (max-width: 480px) { .header { padding: 20px 15px; } .section-title { font-size: 1.3rem; } .action-buttons { flex-direction: column; align-items: center; } .btn { width: 100%; max-width: 250px; } } @media print { body { background: none; padding: 0; } .container { box-shadow: none; max-width: 100%; } .action-buttons { display: none; } .question { page-break-inside: avoid; } .header { -webkit-print-color-adjust: exact; print-color-adjust: exact; } } .home-icon { position: absolute; top: 20px; left: 20px; color: white; font-size: 24px; cursor: pointer; transition: var(--transition); z-index: 2; text-decoration: none; display: inline-block; } .home-icon:hover { transform: scale(1.1); color: rgba(255, 255, 255, 0.8); } @media (max-width: 480px) { .home-icon { font-size: 20px; top: 15px; left: 15px; } } @media print { .home-icon { display: none; } } .temp-pdf-container { font-family: Arial, sans-serif; line-height: 1.5; width: 794px; background-color: white; color: black; } .question { page-break-inside: avoid; break-inside: avoid; } .text-center { text-align: center; margin-bottom: 15px; } </style> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4930137336556867" crossorigin="anonymous"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-KMZ9RJ62EY"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-KMZ9RJ62EY'); </script> </head> <body> <div class="container" id="startContainer"> <div class="header"> <a href="up-tet-exam-paper2-assignment-generator.html" class="home-icon" id="homeIcon"><i class="fas fa-home"></i></a> <h1>UP TET * G * 0 2 - - > 7 > & M 5 ? $ @ / (   M 0 G  @ )</h1> <p>English Grammar, Pedagogy & Language Skills Assignment Generator</p> </div> <div class="content-area"> <div id="startScreen"> <h2 class="section-title">English Language Assignment Generator</h2> <div class="btn-group"> <button class="btn btn-primary" id="startGeneratingBtn"> 8 >  ( . G   , ( >   </button> </div> </div> <div id="subjectSelection" class="hidden"> <h2 class="section-title">5 ? 7 /  >  / (  0 G  </h2> <div class="btn-group"> <button class="btn btn-primary" id="selectEnglishBtn">- > 7 > & M 5 ? $ @ /     M 0 G  @ (English)</button> </div> </div> <div id="chapterSelection" class="hidden"> <h2 class="section-title">  >  /  ' M / > /  A ( G  </h2> <div id="chapterCheckboxContainer" class="checkbox-container"></div> <div class="btn-group"> <button class="btn btn-danger" id="backToStartBtn">* M 0 > 0  - * 0 5 > * 8  >   </button> <button class="btn btn-success" id="generateAssignmentBtn"> 8 >  ( . G   , ( >   </button> </div> </div> <div id="levelSelection" class="hidden"> <h2 class="section-title"> ? ( >  8 M $ 0  A ( G  </h2> <p class="text-center"> * ( G  8 >  ( . G    G 2 ?  8 M $ 0  >  / (  0 G  :</p> <div class="level-buttons"> <button class="btn btn-level" id="level1Btn">8 M $ 0 1<br><small>, G 8 ?  8 M $ 0 </small></button> <button class="btn btn-level" id="level2Btn">8 M $ 0 2<br><small>. ' M / . 8 M $ 0 </small></button> <button class="btn btn-level" id="level3Btn">8 M $ 0 3<br><small>* 0 @  M 7 > 8 M $ 0 </small></button> </div> <div class="btn-group"> <button class="btn btn-danger" id="backToChaptersBtn">5 ? 7 / K  * 0 5 > * 8  >   </button> <button class="btn btn-success" id="generateFinalBtn"> 8 >  ( . G    ( 0 G   0 G  </button> </div> </div> </div> </div> <div class="container hidden" id="generatedPaperContainer"></div> <script> (function() { const { jsPDF } = window.jspdf; // Complete English Language Question Bank (29 Topics) const questions = { "1. Unseen Passage": { level1: [{ question: "What is an unseen passage?", options: ["A passage not read before", "A story", "A poem", "A drama"], answer: "A" }], level2: [{ question: "What skill does an unseen passage primarily test?", options: ["Reading comprehension", "Writing", "Speaking", "Listening"], answer: "A" }], level3: [{ question: "While reading an unseen passage, the best strategy is:", options: ["Skim first then read carefully", "Read word by word", "Memorize", "Skip difficult words"], answer: "A" }] }, "2. Nouns and its Kinds": { level1: [{ question: "Which word is a noun?", options: ["Happiness", "Run", "Beautiful", "Slowly"], answer: "A" }], level2: [{ question: "Identify the proper noun: 'She lives in Delhi.'", options: ["Delhi", "She", "lives", "in"], answer: "A" }], level3: [{ question: "Which is an abstract noun?", options: ["Honesty", "Table", "School", "River"], answer: "A" }] }, "3. Pronoun and its Kinds": { level1: [{ question: "Identify the pronoun: 'He is my friend.'", options: ["He", "is", "my", "friend"], answer: "A" }], level2: [{ question: "Which is a reflexive pronoun?", options: ["Myself", "You", "They", "We"], answer: "A" }], level3: [{ question: "'This is the book that I wanted.' - 'that' is:", options: ["Relative pronoun", "Demonstrative", "Personal", "Interrogative"], answer: "A" }] }, "4. Verb and its Kinds": { level1: [{ question: "Identify the verb: 'She sings beautifully.'", options: ["sings", "She", "beautifully", "no verb"], answer: "A" }], level2: [{ question: "Which is a transitive verb?", options: ["Eat (I eat an apple)", "Sleep", "Run", "Laugh"], answer: "A" }], level3: [{ question: "Auxiliary verb is also called:", options: ["Helping verb", "Action verb", "Main verb", "Linking verb"], answer: "A" }] }, "5. Adjective and its Kinds & Degrees": { level1: [{ question: "Adjective modifies a:", options: ["Noun", "Verb", "Adverb", "Preposition"], answer: "A" }], level2: [{ question: "Superlative degree of 'good' is:", options: ["Best", "Better", "Gooder", "Most good"], answer: "A" }], level3: [{ question: "Which is a demonstrative adjective?", options: ["This book", "Good book", "My book", "Five books"], answer: "A" }] }, "6. Adverb and its Kinds": { level1: [{ question: "Adverb modifies a:", options: ["Verb", "Noun", "Pronoun", "Interjection"], answer: "A" }], level2: [{ question: "'He runs quickly.' - 'quickly' is:", options: ["Adverb of manner", "Adverb of time", "Adverb of place", "Adverb of frequency"], answer: "A" }], level3: [{ question: "Identify the adverb: 'She will come tomorrow.'", options: ["tomorrow", "She", "will", "come"], answer: "A" }] }, "7. Preposition and its Kinds": { level1: [{ question: "Preposition shows relationship between:", options: ["Noun and other words", "Verb and adverb", "Adjective and noun", "Pronoun and verb"], answer: "A" }], level2: [{ question: "Fill preposition: 'He is sitting ___ the chair.'", options: ["on", "in", "at", "into"], answer: "A" }], level3: [{ question: "Which is a compound preposition?", options: ["Because of", "on", "in", "at"], answer: "A" }] }, "8. Conjunction and its Kinds": { level1: [{ question: "Conjunction connects:", options: ["Words, phrases, clauses", "Nouns only", "Verbs only", "Adjectives only"], answer: "A" }], level2: [{ question: "'He is poor but honest.' - 'but' is:", options: ["Coordinating conjunction", "Subordinating", "Correlative", "Interjection"], answer: "A" }], level3: [{ question: "Which is a subordinating conjunction?", options: ["because", "and", "but", "or"], answer: "A" }] }, "9. Interjection": { level1: [{ question: "Interjection expresses:", options: ["Sudden emotion", "Action", "Place", "Time"], answer: "A" }], level2: [{ question: "Identify interjection: 'Wow! That's amazing.'", options: ["Wow", "That's", "amazing", "Wow! That's"], answer: "A" }], level3: [{ question: "Which punctuation follows an interjection often?", options: ["Exclamation mark", "Question mark", "Full stop", "Comma"], answer: "A" }] }, "10. Singular and Plural": { level1: [{ question: "Plural of 'child' is:", options: ["Children", "Childs", "Childes", "Childrens"], answer: "A" }], level2: [{ question: "Plural of 'ox' is:", options: ["Oxen", "Oxes", "Ox", "Oxens"], answer: "A" }], level3: [{ question: "Plural of 'criterion' is:", options: ["Criteria", "Criterions", "Criterias", "Criterion"], answer: "A" }] }, "11. Subject and Predicate": { level1: [{ question: "Subject of a sentence tells:", options: ["Who or what does the action", "What action is done", "When it happens", "Where it happens"], answer: "A" }], level2: [{ question: "Identify predicate: 'The sun rises in the east.'", options: ["rises in the east", "The sun", "sun rises", "in the east"], answer: "A" }], level3: [{ question: "In 'Barking dogs seldom bite', subject is:", options: ["Barking dogs", "dogs", "Barking", "seldom bite"], answer: "A" }] }, "12. Negative and Interrogative Sentences": { level1: [{ question: "Negative of 'He is honest' is:", options: ["He is not honest", "He no honest", "He never honest", "He isn't honest?"], answer: "A" }], level2: [{ question: "Interrogative of 'She writes a letter' is:", options: ["Does she write a letter?", "She writes a letter?", "Write she a letter?", "Is she write?"], answer: "A" }], level3: [{ question: "Transform: 'Everyone liked the movie' (Negative):", options: ["No one disliked the movie", "Everyone disliked", "None liked", "Not everyone liked"], answer: "A" }] }, "13. Masculine and Feminine Gender": { level1: [{ question: "Feminine of 'actor' is:", options: ["Actress", "Actorine", "Actoress", "Actresss"], answer: "A" }], level2: [{ question: "Masculine of 'duck' is:", options: ["Duck", "Drake", "Duckling", "Hen"], answer: "B" }], level3: [{ question: "Common gender noun is:", options: ["Teacher", "King", "Queen", "Prince"], answer: "A" }] }, "14. Punctuations": { level1: [{ question: "Which punctuation ends a declarative sentence?", options: ["Full stop", "Question mark", "Exclamation", "Comma"], answer: "A" }], level2: [{ question: "Apostrophe is used for:", options: ["Possession or contraction", "Question", "Exclamation", "Listing"], answer: "A" }], level3: [{ question: "Correct punctuation: 'What a beautiful day'", options: ["What a beautiful day!", "What a beautiful day?", "What a beautiful day.", "What a beautiful day,"], answer: "A" }] }, "15. Suffix with Root words": { level1: [{ question: "Suffix is added to:", options: ["End of a word", "Beginning of a word", "Middle", "Anywhere"], answer: "A" }], level2: [{ question: "Which suffix means 'full of'?", options: ["-ful", "-less", "-er", "-ing"], answer: "A" }], level3: [{ question: "Add suffix to 'enjoy' to make adjective:", options: ["enjoyable", "enjoyment", "enjoying", "enjoyed"], answer: "A" }] }, "16. Phrasal Verbs": { level1: [{ question: "Phrasal verb consists of:", options: ["Verb + preposition/adverb", "Verb + noun", "Verb + adjective", "Verb only"], answer: "A" }], level2: [{ question: "'Give up' means:", options: ["Quit", "Surrender", "Submit", "All of these"], answer: "D" }], level3: [{ question: "Choose correct phrasal verb: 'The meeting was ___ due to rain'", options: ["called off", "called out", "called in", "called upon"], answer: "A" }] }, "17. Use of Somebody, Nobody, Anybody": { level1: [{ question: "'Somebody' is used in:", options: ["Affirmative sentences", "Negative only", "Questions only", "Never used"], answer: "A" }], level2: [{ question: "Complete: 'There is ___ in the room.' (negative)", options: ["nobody", "somebody", "anybody", "everybody"], answer: "A" }], level3: [{ question: "Correct: 'Did you see ___ there?'", options: ["anybody", "somebody", "nobody", "everybody"], answer: "A" }] }, "18. Parts of Speech": { level1: [{ question: "How many parts of speech are there in English?", options: ["8", "5", "6", "10"], answer: "A" }], level2: [{ question: "'Quickly' belongs to which part of speech?", options: ["Adverb", "Adjective", "Verb", "Noun"], answer: "A" }], level3: [{ question: "Identify part of speech of 'Oh!':", options: ["Interjection", "Conjunction", "Preposition", "Adverb"], answer: "A" }] }, "19. Narration": { level1: [{ question: "Direct to indirect: He said, 'I am happy.'", options: ["He said that he was happy", "He said that I am happy", "He said he is happy", "He says he is happy"], answer: "A" }], level2: [{ question: "Indirect of 'He said, 'Will you come?''", options: ["He asked if I would come", "He said will you come", "He asked will you come", "He said that I will come"], answer: "A" }], level3: [{ question: "Change: 'He said, 'Bravo! You have won.''", options: ["He applauded me saying that I had won", "He said bravo I have won", "He exclaimed that I won", "He said hurrah you won"], answer: "A" }] }, "20. Active Voice and Passive Voice": { level1: [{ question: "Active to passive: 'She writes a letter.'", options: ["A letter is written by her", "A letter was written", "Letter is wrote", "A letter wrote"], answer: "A" }], level2: [{ question: "Passive of 'They will finish the work.'", options: ["The work will be finished by them", "Work will finish", "They will be finished work", "The work is finished"], answer: "A" }], level3: [{ question: "Identify passive: 'The thief was caught.'", options: ["Passive", "Active", "Imperative", "Interrogative"], answer: "A" }] }, "21. Antonyms & Synonyms": { level1: [{ question: "Synonym of 'Happy' is:", options: ["Joyful", "Sad", "Angry", "Tired"], answer: "A" }], level2: [{ question: "Antonym of 'Increase' is:", options: ["Decrease", "Grow", "Rise", "Expand"], answer: "A" }], level3: [{ question: "Synonym of 'Brave' is:", options: ["Courageous", "Coward", "Timid", "Fearful"], answer: "A" }] }, "22. Use of Homophones": { level1: [{ question: "Homophones are words with:", options: ["Same sound different meaning", "Same spelling", "Same meaning", "Same pronunciation and spelling"], answer: "A" }], level2: [{ question: "Choose correct: 'Please ___ the door.' (close)", options: ["close", "clothes", "cloze", "clous"], answer: "A" }], level3: [{ question: "Which pair is a homophone?", options: ["See/Sea", "Cat/Bat", "Run/Red", "Pen/Paper"], answer: "A" }] }, "23. Use of request in sentences": { level1: [{ question: "A request sentence often begins with:", options: ["Please", "Go", "Stop", "Don't"], answer: "A" }], level2: [{ question: "Request: '___ you help me?'", options: ["Could", "Will", "Would", "All of these"], answer: "D" }], level3: [{ question: "Which is a polite request?", options: ["Would you mind closing the door?", "Close the door", "Shut the door", "Door close"], answer: "A" }] }, "24. Silent Letter in words": { level1: [{ question: "Which letter is silent in 'knee'?", options: ["k", "n", "e", "ee"], answer: "A" }], level2: [{ question: "Silent letter in 'write' is:", options: ["w", "r", "i", "t"], answer: "A" }], level3: [{ question: "Identify silent letter: 'doubt'", options: ["b", "d", "o", "u"], answer: "A" }] }, "25. Pedagogy of English language": { level1: [{ question: "What is the aim of teaching English as a second language?", options: ["Communication", "Grammar only", "Writing only", "Reading only"], answer: "A" }], level2: [{ question: "Communicative Language Teaching (CLT) focuses on:", options: ["Real life communication", "Grammar rules", "Translation", "Memorization"], answer: "A" }], level3: [{ question: "Best method for teaching English at primary level is:", options: ["Activity-based learning", "Grammar translation", "Lecture method", "Rote learning"], answer: "A" }] }, "26. Role of grammar in language teaching": { level1: [{ question: "Grammar helps to:", options: ["Use language correctly", "Increase vocabulary", "Improve handwriting", "Learn spelling"], answer: "A" }], level2: [{ question: "Inductive method of grammar teaching means:", options: ["Examples first then rules", "Rules first then examples", "No rules", "Only examples"], answer: "A" }], level3: [{ question: "Functional grammar emphasizes:", options: ["Use of grammar in context", "Rote memorization", "Translation only", "Writing only"], answer: "A" }] }, "27. Language skills": { level1: [{ question: "Which is a receptive skill?", options: ["Listening", "Speaking", "Writing", "All of these"], answer: "A" }], level2: [{ question: "Productive skills are:", options: ["Speaking and Writing", "Listening and Reading", "Listening and Speaking", "Reading and Writing"], answer: "A" }], level3: [{ question: "Integrated language teaching means:", options: ["Combining all four skills", "Only grammar", "Only vocabulary", "Only speaking"], answer: "A" }] }, "28. Diagnostic and remedial teaching": { level1: [{ question: "Diagnostic test identifies:", options: ["Learning difficulties", "Intelligence", "Memory", "Creativity"], answer: "A" }], level2: [{ question: "Remedial teaching aims to:", options: ["Correct learning errors", "Speed up learning", "Skip topics", "Increase difficulty"], answer: "A" }], level3: [{ question: "First step in remedial teaching is:", options: ["Diagnosis", "Remediation", "Evaluation", "Motivation"], answer: "A" }] }, "29. Assessment and evaluation": { level1: [{ question: "Formative assessment is:", options: ["Ongoing during instruction", "At the end of term", "Summative", "Final exam"], answer: "A" }], level2: [{ question: "CCE stands for:", options: ["Continuous and Comprehensive Evaluation", "Central Evaluation", "Comprehensive Exam", "Course Evaluation"], answer: "A" }], level3: [{ question: "Which is a tool of assessment?", options: ["Rubric", "Lecture", "Home work only", "Classroom management"], answer: "A" }] } }; const allTopics = [ "1. Unseen Passage", "2. Nouns and its Kinds", "3. Pronoun and its Kinds", "4. Verb and its Kinds", "5. Adjective and its Kinds & Degrees", "6. Adverb and its Kinds", "7. Preposition and its Kinds", "8. Conjunction and its Kinds", "9. Interjection", "10. Singular and Plural", "11. Subject and Predicate", "12. Negative and Interrogative Sentences", "13. Masculine and Feminine Gender", "14. Punctuations", "15. Suffix with Root words", "16. Phrasal Verbs", "17. Use of Somebody, Nobody, Anybody", "18. Parts of Speech", "19. Narration", "20. Active Voice and Passive Voice", "21. Antonyms & Synonyms", "22. Use of Homophones", "23. Use of request in sentences", "24. Silent Letter in words", "25. Pedagogy of English language", "26. Role of grammar in language teaching", "27. Language skills", "28. Diagnostic and remedial teaching", "29. Assessment and evaluation" ]; // Fallback for missing topics allTopics.forEach(topic => { if (!questions[topic]) { questions[topic] = { level1: [{ question: topic + " - Basic question", options: ["A","B","C","D"], answer:"A"}], level2: [{ question: topic + " - Medium", options: ["A","B","C","D"], answer:"B"}], level3: [{ question: topic + " - Advanced", options: ["A","B","C","D"], answer:"C"}] }; } }); // DOM Elements const startContainer = document.getElementById('startContainer'); const startScreen = document.getElementById('startScreen'); const subjectSelection = document.getElementById('subjectSelection'); const chapterSelection = document.getElementById('chapterSelection'); const levelSelection = document.getElementById('levelSelection'); const generatedPaperContainer = document.getElementById('generatedPaperContainer'); const startGeneratingBtn = document.getElementById('startGeneratingBtn'); const selectEnglishBtn = document.getElementById('selectEnglishBtn'); const backToStartBtn = document.getElementById('backToStartBtn'); const generateAssignmentBtn = document.getElementById('generateAssignmentBtn'); const backToChaptersBtn = document.getElementById('backToChaptersBtn'); const generateFinalBtn = document.getElementById('generateFinalBtn'); const level1Btn = document.getElementById('level1Btn'); const level2Btn = document.getElementById('level2Btn'); const level3Btn = document.getElementById('level3Btn'); const homeIcon = document.getElementById('homeIcon'); let selectedChapters = []; let selectedLevel = null; function populateChapters() { const container = document.getElementById('chapterCheckboxContainer'); if (!container) return; container.innerHTML = `<div class="checkbox-item"><input type="checkbox" id="fullPaper" value="full"><label for="fullPaper">* B 0 M # * > M /  M 0 . (8 - @ ${allTopics.length} 5 ? 7 / )</label></div>`; allTopics.forEach((topic, idx) => { container.innerHTML += `<div class="checkbox-item"><input type="checkbox" id="topic_${idx}" name="chapter" value="${topic}"><label for="topic_${idx}">${idx+1}. ${topic}</label></div>`; }); const fullPaperCheckbox = document.getElementById('fullPaper'); if(fullPaperCheckbox) fullPaperCheckbox.addEventListener('change', function() { document.querySelectorAll('input[name="chapter"]').forEach(cb => cb.disabled = this.checked); }); } function getRandomQuestions(chapters, level, count) { let allQuestions = []; chapters.forEach(ch => { if(questions[ch] && questions[ch][`level${level}`]) allQuestions = allQuestions.concat(questions[ch][`level${level}`]); }); if(allQuestions.length === 0) return [{ question: "Questions not available. Please select other chapters.", options: ["A","B","C","D"], answer:"A" }]; allQuestions = allQuestions.sort(() => Math.random() - 0.5); return allQuestions.slice(0, Math.min(count, allQuestions.length)); } function resetToStart() { generatedPaperContainer.classList.add('hidden'); startContainer.classList.remove('hidden'); chapterSelection.classList.add('hidden'); levelSelection.classList.add('hidden'); startScreen.classList.remove('hidden'); subjectSelection.classList.add('hidden'); selectedLevel = null; if(level1Btn) level1Btn.classList.remove('selected'); if(level2Btn) level2Btn.classList.remove('selected'); if(level3Btn) level3Btn.classList.remove('selected'); } if(startGeneratingBtn) startGeneratingBtn.onclick = () => { startScreen.classList.add('hidden'); subjectSelection.classList.remove('hidden'); }; if(selectEnglishBtn) selectEnglishBtn.onclick = () => { subjectSelection.classList.add('hidden'); populateChapters(); chapterSelection.classList.remove('hidden'); }; if(backToStartBtn) backToStartBtn.onclick = resetToStart; if(homeIcon) homeIcon.onclick = resetToStart; if(generateAssignmentBtn) { generateAssignmentBtn.onclick = () => { const fullPaper = document.getElementById('fullPaper'); if(fullPaper && fullPaper.checked) selectedChapters = [...allTopics]; else selectedChapters = Array.from(document.querySelectorAll('input[name="chapter"]:checked')).map(cb => cb.value); if(selectedChapters.length === 0) { alert(" C * / >  . 8 G  .    ' M / > / /5 ? 7 /  A ( G  !"); return; } chapterSelection.classList.add('hidden'); levelSelection.classList.remove('hidden'); }; } if(backToChaptersBtn) backToChaptersBtn.onclick = () => { levelSelection.classList.add('hidden'); chapterSelection.classList.remove('hidden'); }; function selectLevel(level) { if(level1Btn) level1Btn.classList.remove('selected'); if(level2Btn) level2Btn.classList.remove('selected'); if(level3Btn) level3Btn.classList.remove('selected'); const btn = document.getElementById(`level${level}Btn`); if(btn) btn.classList.add('selected'); selectedLevel = level; } if(level1Btn) level1Btn.onclick = () => selectLevel(1); if(level2Btn) level2Btn.onclick = () => selectLevel(2); if(level3Btn) level3Btn.onclick = () => selectLevel(3); if(generateFinalBtn) { generateFinalBtn.onclick = () => { if(!selectedLevel) { alert(" C * / >  ? ( >  8 M $ 0  A ( G  !"); return; } startContainer.classList.add('hidden'); levelSelection.classList.add('hidden'); generatedPaperContainer.classList.remove('hidden'); const mcqs = getRandomQuestions(selectedChapters, selectedLevel, 45); let qNum = 1; let html = `<div class="header"><h2>UP TET Paper 2 - Language II (English) Assignment</h2><h3>${selectedChapters.length === allTopics.length ? "Complete Syllabus (English Grammar & Pedagogy)" : selectedChapters.slice(0,3).join(", ")+ (selectedChapters.length>3?"...":"")}</h3><p>Level ${selectedLevel} - ${selectedLevel === 1 ? "Basic" : selectedLevel === 2 ? "Medium" : "Advanced"}</p></div><div class="content-area"><div class="instructions"><p><strong>Instructions:</strong></p><ol><li>Total 45 Multiple Choice Questions (MCQs)</li><li>Each question has four options, only one is correct.</li><li>Time: 60 minutes</li><li>Questions cover English Grammar, Language Pedagogy & Skills.</li></ol></div><div class="question-section"><div class="section-heading">Multiple Choice Questions (MCQs)</div>`; mcqs.forEach(mcq => { html += `<div class="question"><div class="question-text">${qNum}. ${mcq.question}</div><div class="option">A. ${mcq.options[0]}</div><div class="option">B. ${mcq.options[1]}</div><div class="option">C. ${mcq.options[2]}</div><div class="option">D. ${mcq.options[3]}</div></div>`; qNum++; }); html += `</div><div class="answer-sheet"><h3 class="section-title">Answer Key</h3><table class="answer-table"><thead><tr><th>Q.No.</th><th>Answer</th><th>Q.No.</th><th>Answer</th><th>Q.No.</th><th>Answer</th></tr></thead><tbody>`; for(let i=0; i<mcqs.length; i+=3) { html += `<tr>`; for(let j=0; j<3; j++) { if(i+j < mcqs.length) html += `<td>${i+j+1}</td><td>${mcqs[i+j].answer}</td>`; else html += `<td></td><td></td>`; } html += `</tr>`; } html += `</tbody></table></div><div class="action-buttons"><button class="btn btn-primary" id="printBtn"><i class="fas fa-print"></i> Print</button><button class="btn btn-success" id="downloadBtn"><i class="fas fa-download"></i> Download PDF</button><button class="btn btn-danger" id="newAssignmentBtn"><i class="fas fa-plus"></i> New Assignment</button></div></div>`; generatedPaperContainer.innerHTML = html; const printBtn = document.getElementById('printBtn'); if(printBtn) printBtn.onclick = () => window.print(); const downloadBtn = document.getElementById('downloadBtn'); if(downloadBtn) downloadBtn.onclick = downloadPDF; const newBtn = document.getElementById('newAssignmentBtn'); if(newBtn) newBtn.onclick = resetToStart; }; } async function downloadPDF() { const element = document.getElementById('generatedPaperContainer'); if(!element) return; const tempDiv = document.createElement('div'); tempDiv.style.position = 'absolute'; tempDiv.style.left = '-9999px'; tempDiv.style.top = '-9999px'; tempDiv.style.width = '794px'; tempDiv.style.backgroundColor = 'white'; tempDiv.style.padding = '20px'; tempDiv.innerHTML = element.innerHTML; document.body.appendChild(tempDiv); try { const pdf = new jsPDF('p', 'mm', 'a4'); const pageWidth = pdf.internal.pageSize.getWidth() - 25.4; const pageHeight = pdf.internal.pageSize.getHeight() - 25.4; let position = 12.7, remainingHeight = tempDiv.scrollHeight, pageNum = 1; while(remainingHeight > 0) { const canvas = await html2canvas(tempDiv, { scale: 2, windowHeight: pageHeight * 3.78, windowWidth: pageWidth * 3.78, y: position * 3.78, height: pageHeight * 3.78, useCORS: true, backgroundColor: '#ffffff', logging: false }); const imgData = canvas.toDataURL('image/jpeg', 0.95); if(pageNum > 1) pdf.addPage('a4', 'portrait'); pdf.addImage(imgData, 'JPEG', 12.7, 12.7, pageWidth, (canvas.height * pageWidth) / canvas.width); position += pageHeight; remainingHeight -= pageHeight * 3.78; pageNum++; } pdf.save('UP_TET_English_Language_Assignment.pdf'); } catch(err) { console.error(err); alert('PDF generation error. Please try again.'); } finally { if(tempDiv && tempDiv.parentNode) document.body.removeChild(tempDiv); } } })(); </script> </body> </html>