ÿþ<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>UP TET Paper 2 - Language II (English) Practice Set Generator</title> <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232c7da0'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E"> <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: #2c7da0; --primary-dark: #1f5068; --secondary: #61a5c2; --danger: #e63946; --success: #2a9d8f; --light: #f0f9ff; --dark: #2c3e50; --gray: #6c757d; --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', 'Noto Sans', system-ui, -apple-system, sans-serif; } body { background: linear-gradient(135deg, #e8f4f8 0%, #d4eaf0 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; color: var(--dark); } .container { width: 100%; max-width: 1000px; 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: 1.5rem; margin-bottom: 10px; font-weight: 700; position: relative; z-index: 1; } .header p { font-size: 0.9rem; 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); } .btn-success { background: var(--success); color: white; } .btn-success:hover { background: #21867a; transform: translateY(-2px); } .btn-danger { background: var(--danger); color: white; } .btn-danger:hover { background: #c1121f; transform: translateY(-2px); } .btn-level { background: var(--light); color: var(--dark); border: 2px solid var(--gray); font-size: 1rem; 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; flex-wrap: wrap; } .section-title { text-align: center; margin-bottom: 25px; color: var(--primary-dark); font-size: 1.4rem; 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: 400px; overflow-y: auto; padding: 10px; border: 1px solid #eee; border-radius: 12px; } .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; } .practice-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 30px 0; } .option-card { background: white; border-radius: var(--border-radius); padding: 25px; box-shadow: var(--box-shadow); text-align: center; transition: var(--transition); cursor: pointer; border: 2px solid transparent; } .option-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.15); } .option-card.selected { border-color: var(--primary); background: rgba(44,125,160,0.05); } .option-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 15px; } .option-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; color: var(--primary-dark); } .option-description { color: var(--gray); font-size: 0.8rem; } .question-count-selector { display: flex; justify-content: center; align-items: center; gap: 15px; margin: 20px 0; } .count-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--light); border: 2px solid var(--gray); display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: bold; } .count-btn:hover { background: var(--primary); color: white; border-color: var(--primary); } .question-count { font-size: 1.5rem; font-weight: 600; min-width: 60px; text-align: center; } .timer-options { display: flex; justify-content: center; gap: 15px; margin: 20px 0; flex-wrap: wrap; } .timer-btn { padding: 10px 20px; background: var(--light); border: 2px solid var(--gray); border-radius: 30px; cursor: pointer; transition: var(--transition); } .timer-btn.selected { background: var(--primary); color: white; border-color: var(--primary); } .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; } .instructions { margin-bottom: 30px; padding: 20px; background: #f0f9ff; border-radius: var(--border-radius); border-left: 5px solid var(--primary); } .instructions ol { padding-left: 20px; margin-top: 10px; } .home-icon { position: absolute; top: 20px; left: 20px; color: white; font-size: 24px; cursor: pointer; transition: var(--transition); z-index: 2; } .home-icon:hover { transform: scale(1.1); } @media (max-width: 768px) { .checkbox-container { grid-template-columns: 1fr; } .level-buttons { flex-direction: column; align-items: center; } .btn-level { width: 100%; max-width: 250px; } .header h1 { font-size: 1.1rem; } } @media print { .action-buttons { display: none; } .home-icon { display: none; } .question { page-break-inside: avoid; } } .text-center { text-align: center; } </style> </head> <body> <div class="container" id="startContainer"> <div class="header"> <a href="up-tet-exam-paper2-practice-set-generator.html" class="home-icon" ><i class="fas fa-home"></i></a> <h1>=ØÖÜ UP TET PAPER 2 - Language II (English) Practice Set Generator</h1> <p>Grammar, Pedagogy, Comprehension & Language Skills for UP TET Exam</p> </div> <div class="content-area"> <div id="startScreen"> <h2 class="section-title">English Language Practice Set Generator</h2> <p class="text-center">Prepare for UP TET Paper 2 with topic-wise & level-wise English practice sets (Grammar, Pedagogy, Unseen Passages)</p> <div class="btn-group"><button class="btn btn-primary" id="startGeneratingBtn">Start Making Practice Set ’!</button></div> </div> <div id="practiceTypeSelection" class="hidden"> <h2 class="section-title">Choose Practice Type</h2> <div class="practice-options"> <div class="option-card" data-type="chapter-wise"><div class="option-icon"><i class="fas fa-book-open"></i></div><div class="option-title">Topic-wise Practice</div><div class="option-description">Practice specific English grammar or pedagogy topics</div></div> <div class="option-card" data-type="full-length"><div class="option-icon"><i class="fas fa-file-alt"></i></div><div class="option-title">Full Length Test</div><div class="option-description">50 questions as per TET pattern</div></div> <div class="option-card" data-type="previous-year"><div class="option-icon"><i class="fas fa-calendar-alt"></i></div><div class="option-title">Previous Year Pattern</div><div class="option-description">Questions based on TET exam pattern</div></div> </div> <div class="btn-group"><button class="btn btn-danger" id="backToStartBtn">Back</button><button class="btn btn-success" id="proceedToChaptersBtn">Select Topics ’!</button></div> </div> <div id="chapterSelection" class="hidden"> <h2 class="section-title">Select English Topics (Chapters)</h2> <form id="chapterForm"><div class="checkbox-container" id="englishTopicsContainer"></div></form> <div id="questionCountSection"><h3 class="section-title">Number of Questions</h3><div class="question-count-selector"><div class="count-btn" id="decreaseCount">-</div><div class="question-count" id="questionCount">50</div><div class="count-btn" id="increaseCount">+</div></div></div> <div class="btn-group"><button class="btn btn-danger" id="backToPracticeTypeBtn">Back</button><button class="btn btn-success" id="generateAssignmentBtn">Choose Difficulty ’!</button></div> </div> <div id="levelSelection" class="hidden"> <h2 class="section-title">Select Difficulty Level</h2> <p class="text-center">Choose level as per TET standard</p> <div class="level-buttons"><button class="btn btn-level" id="level1Btn">Level 1<br><small>Basic (Concepts & Fundamentals)</small></button><button class="btn btn-level" id="level2Btn">Level 2<br><small>Intermediate (Rules & Application)</small></button><button class="btn btn-level" id="level3Btn">Level 3<br><small>Advanced (Analysis & Pedagogy)</small></button></div> <div id="timerOptions"><h3 class="section-title">Select Time Limit</h3><div class="timer-options"><div class="timer-btn" data-time="30">30 min</div><div class="timer-btn" data-time="45">45 min</div><div class="timer-btn" data-time="60" class="selected">60 min</div><div class="timer-btn" data-time="90">90 min</div></div></div> <div class="btn-group"><button class="btn btn-danger" id="backToChaptersBtn">Back to Topics</button><button class="btn btn-success" id="generateFinalBtn">Generate Practice Set</button></div> </div> </div> </div> <div class="container hidden" id="generatedPaperContainer"></div> <script> const { jsPDF } = window.jspdf; // ========== English Chapters (as per syllabus: 29 topics) ========== const englishChapters = [ "Unseen Passage (Prose/Poetry)", "Nouns and its Kinds", "Pronoun and its Kinds", "Verb and its Kinds", "Adjective and its Kinds & Degrees", "Adverb and its Kinds", "Preposition and its Kinds", "Conjunction and its Kinds", "Interjection", "Singular and Plural", "Subject and Predicate", "Negative and Interrogative Sentences", "Masculine and Feminine Gender", "Punctuations", "Suffix with Root words", "Phrasal Verbs", "Use of Somebody, Nobody, Anybody", "Parts of Speech", "Narration (Direct/Indirect)", "Active Voice and Passive Voice", "Antonyms & Synonyms", "Use of Homophones", "Use of request in sentences", "Silent Letter in words", "Pedagogy of English language", "Role of grammar in language teaching", "Language skills (LSRW)", "Diagnostic and remedial teaching", "Assessment and evaluation" ]; const questions = {}; function addQuestion(chapter, level, qText, opts, ans) { if(!questions[chapter]) questions[chapter] = { level1: [], level2: [], level3: [] }; questions[chapter][`level${level}`].push({ question: qText, options: opts, answer: ans }); } // ===================== QUESTION DATABASE (TET Level English) ===================== // Nouns addQuestion(englishChapters[1],1,"Which of the following is a proper noun?",["City","Book","London","Table"],"C"); addQuestion(englishChapters[1],2,"'Childhood' is which type of noun?",["Proper","Common","Abstract","Collective"],"C"); // Pronoun addQuestion(englishChapters[2],1,"What is the plural form of 'he'?",["They","Them","We","It"],"A"); // Verb addQuestion(englishChapters[3],1,"Identify the verb: She runs fast.",["She","runs","fast","identify"],"B"); addQuestion(englishChapters[3],2,"Which is a transitive verb?",["Sleep","Run","Eat (an apple)","Arrive"],"C"); // Adjective & Degrees addQuestion(englishChapters[4],1,"Comparative degree of 'good' is?",["Gooder","Better","Best","More good"],"B"); addQuestion(englishChapters[4],2,"'This is the tallest building'  'tallest' is which degree?",["Positive","Comparative","Superlative","None"],"C"); // Adverb addQuestion(englishChapters[5],1,"She sings beautifully. 'beautifully' is?",["Adjective","Verb","Adverb","Noun"],"C"); // Preposition addQuestion(englishChapters[6],1,"He is fond ___ music.",["of","off","in","at"],"A"); // Conjunction addQuestion(englishChapters[7],1,"Which conjunction shows contrast?",["And","But","Or","So"],"B"); // Singular-Plural addQuestion(englishChapters[9],1,"Plural of 'child' is?",["Childs","Childes","Children","Childern"],"C"); // Gender addQuestion(englishChapters[12],1,"Feminine of 'actor' is?",["Actress","Actoress","Actorin","Actree"],"A"); // Punctuation addQuestion(englishChapters[13],1,"Which punctuation is used for strong emotion?",["Period",",","!","?"],"C"); // Phrasal Verbs addQuestion(englishChapters[15],1,"'Give up' means:",["Submit","Surrender","Continue","Distribute"],"B"); // Parts of Speech addQuestion(englishChapters[17],1,"'Oh! What a beautiful sight'  'Oh' is:",["Noun","Adverb","Interjection","Conjunction"],"C"); // Narration addQuestion(englishChapters[18],1,"He said, 'I am happy.' Change to indirect:",["He said that I am happy","He said that he was happy","He said that he is happy","He told that I was happy"],"B"); // Active-Passive addQuestion(englishChapters[19],1,"Active: 'Ram writes a letter.' Passive:",["A letter is written by Ram","A letter was written by Ram","A letter writes by Ram","Letter is written"],"A"); // Antonyms/Synonyms addQuestion(englishChapters[20],1,"Synonym of 'Quick' is:",["Slow","Fast","Lazy","Late"],"B"); addQuestion(englishChapters[20],2,"Antonym of 'Increase' is:",["Rise","Grow","Decrease","Expand"],"C"); // Homophones addQuestion(englishChapters[21],1,"Which word sounds like 'knight'?",["Night","Knife","Knee","Know"],"A"); // Silent Letters addQuestion(englishChapters[23],1,"Which letter is silent in 'knee'?",["K","N","E","None"],"A"); // Pedagogy of English addQuestion(englishChapters[24],1,"'Language acquisition' means:",["Learning grammar rules","Natural process of learning language","Memorizing vocabulary","Translation method"],"B"); addQuestion(englishChapters[24],2,"Which method focuses on speaking and listening?",["Grammar Translation","Direct Method","Memorization","Lecture method"],"B"); addQuestion(englishChapters[25],1,"Role of grammar in language teaching is to:",["Memorize rules","Provide structure & accuracy","Only for writing","Only for exams"],"B"); addQuestion(englishChapters[26],1,"Which is a productive language skill?",["Listening","Reading","Speaking","None"],"C"); addQuestion(englishChapters[27],1,"Diagnostic teaching aims to:",["Identify learning difficulties","Finish syllabus","Conduct exams","Group students"],"A"); addQuestion(englishChapters[28],1,"Formative assessment is:",["End of term exam","Ongoing assessment during learning","Final project","Summative only"],"B"); addQuestion(englishChapters[0],2,"Unseen passage primarily tests:",["Vocabulary","Comprehension & inference","Grammar only","Spelling"],"B"); addQuestion(englishChapters[14],1,"'Play' + 'er' = 'Player'  here 'er' is a:",["Prefix","Suffix","Root","Inflection"],"B"); addQuestion(englishChapters[16],1,"'Somebody' is used in:",["Negative sentences","Affirmative sentences","Questions only","Never in affirmative"],"B"); addQuestion(englishChapters[11],1,"Identify the predicate: 'The sun rises in the east.'",["The sun","rises in the east","sun rises","in the east"],"B"); addQuestion(englishChapters[22],1,"'Could you please help me?'  This is a:",["Command","Request","Order","Exclamation"],"B"); // Fallback questions for(let i=0; i<englishChapters.length; i++) { const chap = englishChapters[i]; if(!questions[chap]) questions[chap] = { level1: [], level2: [], level3: [] }; if(questions[chap].level1.length < 2) questions[chap].level1.push({ question:`${chap}: Basic question - Choose correct option.`, options:["Option A","Option B","Option C","Option D"], answer:"A" }); if(questions[chap].level2.length < 2) questions[chap].level2.push({ question:`${chap}: Intermediate level - Which statement is correct?`, options:["Statement 1","Statement 2","Statement 3","Statement 4"], answer:"B" }); if(questions[chap].level3.length < 2) questions[chap].level3.push({ question:`${chap}: Advanced - Identify the most appropriate answer.`, options:["Choice 1","Choice 2","Choice 3","Choice 4"], answer:"C" }); } // DOM elements const startContainer = document.getElementById('startContainer'); const startScreen = document.getElementById('startScreen'); const practiceTypeSelection = document.getElementById('practiceTypeSelection'); const chapterSelection = document.getElementById('chapterSelection'); const levelSelection = document.getElementById('levelSelection'); const generatedPaperContainer = document.getElementById('generatedPaperContainer'); const startGeneratingBtn = document.getElementById('startGeneratingBtn'); const backToStartBtn = document.getElementById('backToStartBtn'); const proceedToChaptersBtn = document.getElementById('proceedToChaptersBtn'); const backToPracticeTypeBtn = document.getElementById('backToPracticeTypeBtn'); 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 decreaseCount = document.getElementById('decreaseCount'); const increaseCount = document.getElementById('increaseCount'); const questionCountSpan = document.getElementById('questionCount'); const homeIconBtn = document.getElementById('homeIconBtn'); let selectedTopics = [], selectedLevel = null, selectedPracticeType = null, questionCount = 50, timeLimit = 60; function loadTopics() { const container = document.getElementById('englishTopicsContainer'); container.innerHTML = `<div class="checkbox-item"><input type="checkbox" id="fullPaper" name="engTopic" value="All Topics"><label for="fullPaper">All Topics (Complete Syllabus)</label></div>`; englishChapters.forEach((topic, idx) => { const id = `engTopic${idx}`; container.innerHTML += `<div class="checkbox-item"><input type="checkbox" id="${id}" name="engTopic" value="${topic}"><label for="${id}">${topic}</label></div>`; }); document.getElementById('fullPaper')?.addEventListener('change', (e) => { const checkboxes = document.querySelectorAll('input[name="engTopic"]:not(#fullPaper)'); checkboxes.forEach(cb => cb.disabled = e.target.checked); if(e.target.checked) checkboxes.forEach(cb => cb.checked = false); }); } function getSelectedTopics() { const full = document.getElementById('fullPaper'); if(full && full.checked) return [...englishChapters]; return Array.from(document.querySelectorAll('input[name="engTopic"]:checked')).filter(cb => cb.id !== 'fullPaper').map(cb => cb.value); } function getRandomQuestions(topics, level, count) { let allQuestions = []; topics.forEach(topic => { if(questions[topic] && questions[topic][`level${level}`]) allQuestions = allQuestions.concat(questions[topic][`level${level}`]); }); if(allQuestions.length === 0) return Array(count).fill({ question: "Question not available. Please try again.", options:["A","B","C","D"], answer:"A" }); allQuestions = allQuestions.sort(() => Math.random() - 0.5); return allQuestions.slice(0, count); } function showPracticeTypeSelection() { startScreen.classList.add('hidden'); practiceTypeSelection.classList.remove('hidden'); } function backToStart() { generatedPaperContainer.classList.add('hidden'); startContainer.classList.remove('hidden'); practiceTypeSelection.classList.add('hidden'); chapterSelection.classList.add('hidden'); levelSelection.classList.add('hidden'); startScreen.classList.remove('hidden'); selectedTopics = []; selectedLevel = null; selectedPracticeType = null; questionCount = 50; timeLimit = 60; questionCountSpan.textContent = "50"; document.querySelectorAll('.option-card').forEach(c=>c.classList.remove('selected')); document.querySelectorAll('.timer-btn').forEach(b=>b.classList.remove('selected')); if(document.querySelector('.timer-btn[data-time="60"]')) document.querySelector('.timer-btn[data-time="60"]').classList.add('selected'); level1Btn.classList.remove('selected'); level2Btn.classList.remove('selected'); level3Btn.classList.remove('selected'); } function backToPracticeType() { chapterSelection.classList.add('hidden'); practiceTypeSelection.classList.remove('hidden'); } function backToChapters() { levelSelection.classList.add('hidden'); chapterSelection.classList.remove('hidden'); } function showChapters() { if(!selectedPracticeType) { alert("Please select a practice type!"); return; } practiceTypeSelection.classList.add('hidden'); chapterSelection.classList.remove('hidden'); loadTopics(); } function showLevelSelection() { selectedTopics = getSelectedTopics(); if(selectedTopics.length === 0) { alert("Please select at least one topic!"); return; } chapterSelection.classList.add('hidden'); levelSelection.classList.remove('hidden'); } function selectLevel(level) { level1Btn.classList.remove('selected'); level2Btn.classList.remove('selected'); level3Btn.classList.remove('selected'); document.getElementById(`level${level}Btn`).classList.add('selected'); selectedLevel = level; } level1Btn.onclick = () => selectLevel(1); level2Btn.onclick = () => selectLevel(2); level3Btn.onclick = () => selectLevel(3); decreaseCount.onclick = () => { if(questionCount > 10) { questionCount -= 5; questionCountSpan.textContent = questionCount; } }; increaseCount.onclick = () => { if(questionCount < 100) { questionCount += 5; questionCountSpan.textContent = questionCount; } }; document.querySelectorAll('.option-card').forEach(card => { card.addEventListener('click', () => { document.querySelectorAll('.option-card').forEach(c=>c.classList.remove('selected')); card.classList.add('selected'); selectedPracticeType = card.dataset.type; if(selectedPracticeType === 'full-length') { questionCount = 50; questionCountSpan.textContent = "50"; } else if(selectedPracticeType === 'previous-year') { questionCount = 45; questionCountSpan.textContent = "45"; } }); }); document.querySelectorAll('.timer-btn').forEach(btn => { btn.addEventListener('click', () => { document.querySelectorAll('.timer-btn').forEach(b=>b.classList.remove('selected')); btn.classList.add('selected'); timeLimit = parseInt(btn.dataset.time); }); }); function getPracticeTypeName(type) { if(type === 'chapter-wise') return 'Topic-wise Practice (English)'; if(type === 'full-length') return 'Full Length Test (UP TET Paper 2 - English)'; if(type === 'previous-year') return 'Previous Year Pattern (English)'; return 'English Practice Set'; } function generateAssignment() { if(!selectedLevel) { alert("Please select difficulty level!"); return; } startContainer.classList.add('hidden'); levelSelection.classList.add('hidden'); generatedPaperContainer.classList.remove('hidden'); generatedPaperContainer.innerHTML = ''; const topicsList = selectedTopics; const mcqs = getRandomQuestions(topicsList, selectedLevel, questionCount); let paperHTML = `<div class="header" style="background: linear-gradient(135deg, #2c7da0, #1f5068);"><h2>=ØÚÜ UP TET PAPER 2 - Language II (English)</h2><h3>${getPracticeTypeName(selectedPracticeType)}</h3><p>Level ${selectedLevel} - ${selectedLevel===1?"Basic (Concepts)":selectedLevel===2?"Intermediate (Rules & Application)":"Advanced (Analysis & Pedagogy)"} | Time: ${timeLimit} minutes</p><p>Total Questions: ${questionCount}</p></div> <div class="content-area"><div class="instructions"><strong>Instructions:</strong><ol><li>This set contains ${questionCount} multiple choice questions on English Language (Grammar, Pedagogy, Comprehension).</li><li>Each question has four options, only one is correct.</li><li>Time limit: ${timeLimit} minutes. Practice for UP TET Paper 2.</li></ol></div> <div class="question-section"><div class="section-heading" style="font-size:1.2rem; font-weight:bold;">English Language Questions</div>`; let qNum = 1; mcqs.forEach(mcq => { paperHTML += `<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++; }); paperHTML += `</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) { paperHTML += `<tr>`; for(let j=0; j<3; j++) { if(i+j < mcqs.length) paperHTML += `<td>${i+j+1}</td><td>${mcqs[i+j].answer}</td>`; else paperHTML += `<td></td><td></td>`; } paperHTML += `</tr>`; } paperHTML += `</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 Practice Set</button></div></div>`; generatedPaperContainer.innerHTML = paperHTML; document.getElementById('printBtn')?.addEventListener('click', () => window.print()); document.getElementById('downloadBtn')?.addEventListener('click', downloadPDF); document.getElementById('newAssignmentBtn')?.addEventListener('click', () => backToStart()); } async function downloadPDF() { const element = document.getElementById('generatedPaperContainer'); const tempDiv = document.createElement('div'); tempDiv.style.position = 'absolute'; tempDiv.style.left = '-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; let remainingHeight = tempDiv.scrollHeight; let pageNum = 1; while(remainingHeight > 0) { const canvas = await html2canvas(tempDiv, { scale: 1.5, windowHeight: pageHeight * 3.78, windowWidth: pageWidth * 3.78, y: position * 3.78, height: pageHeight * 3.78, backgroundColor: '#ffffff' }); const imgData = canvas.toDataURL('image/jpeg', 0.92); if(pageNum > 1) pdf.addPage(); 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_Practice_Set.pdf'); } catch(e) { console.error(e); alert("PDF generation error"); } finally { if(tempDiv) document.body.removeChild(tempDiv); } } startGeneratingBtn.onclick = showPracticeTypeSelection; backToStartBtn.onclick = backToStart; proceedToChaptersBtn.onclick = showChapters; backToPracticeTypeBtn.onclick = backToPracticeType; generateAssignmentBtn.onclick = showLevelSelection; backToChaptersBtn.onclick = backToChapters; generateFinalBtn.onclick = generateAssignment; homeIconBtn.onclick = backToStart; document.querySelector('.timer-btn[data-time="60"]')?.classList.add('selected'); </script> </body> </html>