ÿþ<!DOCTYPE html> <html lang="hi"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>UP TET Paper 1 - - > 7 > * M 0 % . (9 ? ( M & @ )  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: #4361ee; --primary-dark: #3f37c9; --secondary: #4895ef; --danger: #f72585; --success: #4cc9f0; --light: #f8f9fa; --dark: #212529; --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', Tahoma, Geneva, Verdana, sans-serif; } body { background: linear-gradient(135deg, #f5f7fa 0%, #e2e8f0 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(67, 97, 238, 0.3); } .btn-success { background: var(--success); color: white; } .btn-success:hover { background: #3ab0d6; transform: translateY(-2px); box-shadow: 0 8px 15px rgba(76, 201, 240, 0.3); } .btn-danger { background: var(--danger); color: white; } .btn-danger:hover { background: #d3166b; transform: translateY(-2px); box-shadow: 0 8px 15px rgba(247, 37, 133, 0.3); } .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-paper1-assignment-generator.html" class="home-icon"><i class="fas fa-home"></i></a> <h1>UP TET Paper 1</h1> <p>- > 7 > * M 0 % .  9 ? ( M & @ (Language I - Hindi)  8 >  ( . G    ( 0 G  0 </p> </div> <div class="content-area"> <div id="startScreen"> <h2 class="section-title">9 ? ( M & @  8 >  ( . G    ( 0 G  0 </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="selectHindiBtn">- > 7 > * M 0 % .  9 ? ( M & @ (Language I - Hindi)</button> </div> </div> <div id="chapterSelection" class="hidden"> <h2 class="section-title"> ' M / > / / 5 ? 7 /  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> const { jsPDF } = window.jspdf; // ===================================================== // COMPLETE QUESTIONS DATABASE FOR HINDI (31 TOPICS) // ===================================================== const questions = { " * ? $  ( A  M  G & ": { level1: [ { question: " & M / >  6  K * " <  0 * M 0 6 M ( K   G $ M $ 0 & G ( >  9 2 > $ > 9 H ?", options: [" * ? $  & M / >  6 ", "* ? $  & M / >  6 ", " > 5 M / >  6 ", "( >   >  6 "], answer: "A" }, { question: " * ? $  ( A  M  G &  > . A  M / & M & G 6 M /  M / > 9 K $ > 9 H ?", options: ["8 .  ( G  @  M 7 . $ > * 0  ( > ", "0  ( >  0 ( > ", " 5 ? $ > 2 ?  ( > ", "5 M / >  0 # 8 ?  > ( > "], answer: "A" } ], level2: [ { question: " * ? $  ( A  M  G & * " < ( G  G , > & 8 , 8 G * 9 2 G  M / >  0 ( >  > 9 ?  ?", options: ["* M 0 6 M ( * " < G  ", " ( A  M  G & 2 ?  G  ", " $ M $ 0 / > &  0 G  ", "6 , M & > 0 M % & G  G  "], answer: "A" } ], level3: [ { question: " * ? $  ( A  M  G & . G   ? 8 * M 0  > 0  G * M 0 6 M ( * B  G  > $ G 9 H  ?", options: ["$ % M / > $ M .   5   6 M 0 ? $ ", "5 M / >  0 # ?  ", " $ ? 9 > 8 ?  ", "5 H  M  > ( ?  "], answer: "A" } ] }, "9 ? ( M & @ 5 0 M # . > 2 > (8 M 5 0 , 5 M /   ( )": { level1: [ { question: "9 ? ( M & @ 5 0 M # . > 2 > . G   A 2  ? $ ( G 8 M 5 0 9 K $ G 9 H  ?", options: ["11", "13", "12", "10"], answer: "A" }, { question: "' ' 5 0 M #  ? 8 * M 0  > 0  > 5 M /   ( 9 H ?", options: ["8 M * 0 M 6 ", "  $ 8 M % ", " 7 M . ", "& @ 0 M  "], answer: "A" } ], level2: [ { question: "9 ? ( M & @ 5 0 M # . > 2 > . G   A 2  ? $ ( G 5 M /   ( 9 H  ?", options: ["33", "35", "36", "34"], answer: "A" }, { question: "' '  0 ' ' . G   M / >   $ 0 9 H ?", options: ["9 M 0 8 M 5  0 & @ 0 M  ", "8 M 5 0  0 5 M /   ( ", "  M /  0 $ > 2 5 M / ", " 7 M M /  0 & ( M $ M / "], answer: "A" } ], level3: [ { question: "'6 ', '7 ', '8 '  ? 8 * M 0  > 0  G 5 M /   ( 9 H  ?", options: [" 7 M . ", " ( M $ 8 M % ", "8 M * 0 M 6 ", "8  / A  M $ "], answer: "A" } ] }, "5 0 M # K   G . G 2 8 G . > $ M 0 ?  $ % >  . > $ M 0 ?  6 , M & K   @ * 9  > ( ": { level1: [ { question: "( ? . M ( . G  8 G  . > $ M 0 ?  6 , M &  L ( 8 > 9 H ?", options: [" . 2 ", " 2 ", "0 > . ", " . "], answer: "B" }, { question: "'* A 8 M $  ' . G   ? $ ( @ . > $ M 0 >   9 H  ?", options: ["2", "3", "4", "1"], answer: "A" } ], level2: [ { question: "' >  > ' 6 , M & . G   L ( 8 @ . > $ M 0 >  > * M 0 / K  9 A  9 H ?", options: ["  @ . > $ M 0 > ", "  @ . > $ M 0 > ", "  @ . > $ M 0 > ", "  @ . > $ M 0 > "], answer: "A" } ], level3: [ { question: "( ? . M ( . G  8 G  L ( 8 > 6 , M & & K   M 7 0 K   > 9 H ?", options: ["* $ M 0 ", " . 2 ", "  ( ", "8 0 2 "], answer: "A" } ] }, "5 >  M / 0  ( > ": { level1: [ { question: "8 9 @ 5 >  M /  L ( 8 > 9 H ?", options: ["0 > . * A 8 M $  * " < $ > 9 H ", "0 > . * A 8 M $  * " < ( > 9 H ", "0 > . * A 8 M $  * " < 0 9 G 9 H ", "0 > . * A 8 M $  * " < $ G 9 H "], answer: "A" }, { question: "'. K 9 (  > ( >  > $ > 9 H ' 5 >  M / . G   M 0 ? / >  M / > 9 H ?", options: [" > $ > 9 H ", ". K 9 ( ", " > ( > ", "9 H "], answer: "A" } ], level2: [ { question: "( ? . M ( . G  8 G  6 A & M ' 5 >  M /  >   ?  :", options: ["5 9   5 ? & M / > 2 / ( 9 @   / > ", "5 9   5 ? & M / > 2 / ( 9 @     > ", "5 9   5 ? & M / > 2 / ( 9 @   $ > ", "5 9   5 ? & M / > 2 / ( 9 @    "], answer: "D" } ], level3: [ { question: "8  / A  M $ 5 >  M /  > & > 9 0 #  L ( 8 > 9 H ?", options: ["5 9  / >  0  2 >  / > ", "5 9   0  2 >  / > ", " $ G 9 @ 5 9  2 >  / > ", "5 9  2 >  / > "], answer: "A" } ] }, "9 ? ( M & @  @ 8 - @ ' M 5 ( ? / K   G * > 0 8 M * 0 ?    $ 0  @  > (  > 0 @ ": { level1: [ { question: "' '  0 ' ' . G   M / >   $ 0 9 H ?", options: [" 2 M * * M 0 > #  0 . 9 > * M 0 > # ", "8 M 5 0  0 5 M /   ( ", "  M /  0 $ > 2 5 M / ", " K 7  0   K 7 "], answer: "A" }, { question: "'* ' ' M 5 ( ?  9 >  8 G  M  0 ? $ 9 K $ @ 9 H ?", options: [" 7 M M / ", "& ( M $ M / ", "  M / ", ". B 0 M ' ( M / "], answer: "A" } ], level2: [ { question: "' '  0 '! < ' . G    $ 0  M / > 9 H ?", options: [". B 0 M ' ( M /  0 & ( M $ M / ", "  K 7  0  K 7 ", "8 M * 0 M 6  0  ( M $ 8 M % ", " 2 M * * M 0 > #  0 . 9 > * M 0 > # "], answer: "B" } ], level3: [ { question: "'6 ', '7 ', '8 '  G  M  > 0 # 8 M % > (  M 0 . 6   M / > 9 H  ?", options: ["$ > 2 A , . B 0 M ' > , & ( M $ ", "  , $ > 2 A , & ( M $ ", " 7 M ,   , $ > 2 A ", ". B 0 M ' > , & ( M $ , $ > 2 A "], answer: "A" } ] }, "9 ? ( M & @ - > 7 >  @ 8 - @ ' M 5 ( ? / K  , 5 0 M # K  ,  ( A 8 M 5 > 0 ,  ( A ( > 8 ?   5   ( M & M 0 , ? ( M & A . G   ( M $ 0 ": { level1: [ { question: " ( A 8 M 5 > 0  >  ? 9 M (  M / > 9 H ?", options: ["(.)", "(..)", "(d )", "(?)"], answer: "A" }, { question: "'9  8 ( > ' . G   ? 8  ? 9 M (  > * M 0 / K  9 A  9 H ?", options: [" ( M & M 0 , ? ( M & A ", " ( A 8 M 5 > 0 ", "5 ? 8 0 M  ", "5 ? 0 > . "], answer: "A" } ], level2: [ { question: " ( A ( > 8 ?   >  ? 9 M (  M / > 9 H ?", options: [" ( M & M 0 , ? ( M & A ", ", ? ( M & A ", "0 G  > ", "9 2 ( M $ "], answer: "A" } ], level3: [ { question: "'   > ' 6 , M & . G   ? 8  ? 9 M (  > * M 0 / K  9 A  9 H ?", options: [" ( A 8 M 5 > 0 ", " ( A ( > 8 ?  ", "5 ? 8 0 M  ", " ( M & M 0 , ? ( M & A "], answer: "A" } ] }, "5 ? 0 > .  ? ( M 9 K  / % > -  2 M * 5 ? 0 > . ,  0 M ' 5 ? 0 > . , * B 0 M # 5 ? 0 > . , * M 0 6 M ( 5 >   , 5 ? 8 M . / , K '  ,  ? ( M 9 K   > * M 0 / K  ": { level1: [ { question: "5 >  M /  G   $ . G   L ( 8 >  ? ( M 9 2  $ > 9 H ?", options: ["* B 0 M # 5 ? 0 > . ", " 2 M * 5 ? 0 > . ", "* M 0 6 M ( 5 >   ", "5 ? 8 M . / , K '  "], answer: "A" }, { question: "* M 0 6 M ( * B  ( G  G 2 ?   ? 8  ? ( M 9  > * M 0 / K  9 K $ > 9 H ?", options: ["* M 0 6 M ( 5 >   ", "5 ? 8 M . / , K '  ", "* B 0 M # 5 ? 0 > . ", " 2 M * 5 ? 0 > . "], answer: "A" } ], level2: [ { question: "  9 @ * M 0  > 0  G 6 , M & K   G , @   L ( 8 >  ? ( M 9 2  $ > 9 H ?", options: [" 2 M * 5 ? 0 > . ", " 0 M ' 5 ? 0 > . ", "* B 0 M # 5 ? 0 > . ", " & M ' 0 #  ? ( M 9 "], answer: "A" } ], level3: [ { question: " 6 M  0 M / / > 9 0 M 7 & ?  > ( G  G 2 ?   ? 8  ? ( M 9  > * M 0 / K  9 K $ > 9 H ?", options: ["5 ? 8 M . / , K '  ", "* M 0 6 M ( 5 >   ", " 0 M ' 5 ? 0 > . ", "/ K    ? ( M 9 "], answer: "A" } ] }, "8 . > ( ' M 5 ( ? / K  5 > 2 G 6 , M & ": { level1: [ { question: "' A 2 '  0 ' B 2 ' . G   M / >   $ 0 9 H ?", options: [" 0 M % - ? ( M ( ", "  M  > 0 # 8 . > ( ", "5 0 M $ ( @ 8 . > ( ", " K    $ 0 ( 9 @  "], answer: "A" }, { question: "'  6 '  0 '  6 '  >  0 M %  M / > 9 H ?", options: ["  6 -- >  ,   6 -  8 B ", "& K ( K    ", "  6 -  8 B ,   6 -- >  ", " K  ( 9 @  "], answer: "A" } ], level2: [ { question: "( ? . M ( . G  8 G 8 . > ( ' M 5 ( ? 5 > 2 G 6 , M & / A  M .  L ( 8 > 9 H ?", options: [" . 2 - . 2 ", " 2 -% 2 ", "0 > . -6 M / > . ", ". K 0 - K 0 "], answer: "A" } ], level3: [ { question: "' ( '  0 ' ( '  G  M / >  0 M % 9 H  ?", options: [", > & 2  0 K 8 ", "' (  0  0 ", " 9 (  0 9 2 M  > ", ". K  >  0 * $ 2 > "], answer: "A" } ] }, "5 ? 2 K . 6 , M & ": { level1: [ { question: "' / '  > 5 ? 2 K . 6 , M &  M / > 9 H ?", options: ["5 M / / ", "2 > - ", "9 > ( ? ", "  . "], answer: "A" }, { question: "' . C $ '  > 5 ? 2 K .  M / > 9 H ?", options: ["5 ? 7 ", " 9 0 ", ". C $ ", " . 0 "], answer: "A" } ], level2: [ { question: "' & > ( '  > 5 ? 2 K . 6 , M &  M / > 9 H ?", options: ["* M 0 & > ( ", "& > ( ", "$ M / >  ", " M 0 9 # "], answer: "A" } ], level3: [ { question: "' ( M ( $ ? '  > 5 ? 2 K . 6 , M & 9 H ?", options: [" 5 ( $ ? ", "* M 0  $ ? ", "5 ?  > 8 ", " $ M % > ( "], answer: "A" } ] }, "* 0 M / > / 5 >  @ 6 , M & ": { level1: [ { question: "' ( 2 '  > * 0 M / > / 5 >  @ 6 , M &  M / > 9 H ?", options: ["  ", "* > ( @ ", "9 5 > ", "* C % M 5 @ "], answer: "A" }, { question: "'*    '  >  0 M %  M / > 9 H ?", options: [" . 2 ", " @  ! < ", " 2 ", "* $ M $ > "], answer: "A" } ], level2: [ { question: "' 6 M 5 '  > * 0 M / > / 5 >  @  L ( 8 > 9 H ?", options: [" K ! < > ", "9 > % @ ", "8 ?  9 ", ", H 2 "], answer: "A" } ], level3: [ { question: "'  & M 0 '  G 2 ?   L ( 8 > * 0 M / > / 5 >  @ ( 9 @  9 H ?", options: ["5 ? 7 M # A ", "8 A 0 G 6 ", "& G 5 G 6 ", "* A 0  & 0 "], answer: "A" } ] }, "5 >  M / >  6 K   G 2 ?    6 , M & ": { level1: [ { question: "' ? 8  >  ( M . ( 9 A  9 K '  G 2 ?    6 , M & ?", options: ["  ( M . > ", "  > $ ", " ( A $ M * ( M ( ", "  ( M . "], answer: "A" }, { question: "' K  - @ ( . 0 G '  G 2 ?    6 , M & ?", options: [" . 0 ", " 5 ? ( > 6 @ ", " ? 0   @ 5 @ ", "6 > 6 M 5 $ "], answer: "A" } ], level2: [ { question: "' K 8 A ( >  > 8  G '  G 2 ?    6 , M & ?", options: ["6 M 0 5 M / ", "6 M 0 A $ ", "8 A ( ( G / K  M / ", " 0 M # * M 0 ? / "], answer: "A" } ], level3: [ { question: "' ? 8  > * . > ( 9 K '  G 2 ?    6 , M & ?", options: [" ( A * . ", " & M 5 ? $ @ / ", " $ A 2 ", " $ A 2 ( @ / "], answer: "A" } ] }, "8   M  >  5  8  G - G & ": { level1: [ { question: "'0 > . '  ? 8 * M 0  > 0  @ 8   M  > 9 H ?", options: ["5 M /  M $ ? 5 >   ", " > $ ? 5 >   ", "- > 5 5 >   ", "& M 0 5 M / 5 >   "], answer: "A" }, { question: "'. ? > 8 '  ? 8 * M 0  > 0  @ 8   M  > 9 H ?", options: ["- > 5 5 >   ", " > $ ? 5 >   ", "5 M /  M $ ? 5 >   ", "8 . B 9 5 >   "], answer: "A" } ], level2: [ { question: " > $ ? 5 >   8   M  >  > & > 9 0 #  L ( 8 > 9 H ?", options: ["* A 8 M $  ", "   > ", "0 > . ", "& ? 2 M 2 @ "], answer: "A" } ], level3: [ { question: "8 . B 9 5 >   8   M  >  > & > 9 0 # 9 H ?", options: ["8 . >  ", "2 ! <  > ", "8 A  & 0 ", "& L ! < "], answer: "A" } ] }, "8 0 M 5 ( > .  5  8  G - G & ": { level1: [ { question: "'. H  '  ? 8 * M 0  > 0  > 8 0 M 5 ( > . 9 H ?", options: [" $ M $ . * A 0 A 7 ", ". ' M / . * A 0 A 7 ", " ( M / * A 0 A 7 ", "( ?  5 >   "], answer: "A" }, { question: "'$ A . '  ? 8 * A 0 A 7  > 8 0 M 5 ( > . 9 H ?", options: [". ' M / . ", " $ M $ . ", " ( M / ", "( ?  "], answer: "A" } ], level2: [ { question: "( ?  5 >   8 0 M 5 ( > .  > & > 9 0 #  M / > 9 H ?", options: [" * ( > ", ". H  ", "$ B ", "5 9 "], answer: "A" } ], level3: [ { question: "' K '  ? 8 * M 0  > 0  > 8 0 M 5 ( > . 9 H ?", options: ["8  ,  ' 5 >   ", "( ? 6 M  / 5 >   ", " ( ? 6 M  / 5 >   ", "* M 0 6 M ( 5 >   "], answer: "A" } ] }, " M 0 ? / >  5  8  G - G & ": { level1: [ { question: "'* " < ( > '  M 0 ? / >  >  L ( 8 > 0 B * 9 H ?", options: ["  0 M .  ", "8  0 M .  ", "* M 0 G 0 # > 0 M %  ", "& M 5 ?  0 M .  "], answer: "B" }, { question: "'8 K ( > '  ? 8 * M 0  > 0  @  M 0 ? / > 9 H ?", options: ["  0 M .  ", "8  0 M .  ", "* M 0 G 0 # > 0 M %  ", "( > . ' > $ A "], answer: "A" } ], level2: [ { question: "* M 0 G 0 # > 0 M %   M 0 ? / >  > & > 9 0 # 9 H ?", options: ["* " < > ( > ", "* " < ( > ", "2 ?  ( > ", " > ( > "], answer: "A" } ], level3: [ { question: "8  / A  M $  M 0 ? / >  > & > 9 0 # 9 H ?", options: [" > ( > -* 9  > ( > ", "* " < ( > ", "2 ?  ( > ", " G 2 ( > "], answer: "A" } ] }, "5 ? 6 G 7 #  5  8  G - G & ": { level1: [ { question: "'2 > 2 '  ? 8 * M 0  > 0  > 5 ? 6 G 7 # 9 H ?", options: [" A # 5 >   ", "8   M / > 5 >   ", "* 0 ? . > # 5 >   ", "8 > 0 M 5 ( > . ?  "], answer: "A" }, { question: "'& K '  ? 8 * M 0  > 0  > 5 ? 6 G 7 # 9 H ?", options: ["8   M / > 5 >   ", " A # 5 >   ", "* 0 ? . > # 5 >   ", "8 > 0 M 5 ( > . ?  "], answer: "A" } ], level2: [ { question: "' A  '  ? 8 * M 0  > 0  > 5 ? 6 G 7 # 9 H ?", options: ["* 0 ? . > # 5 >   ", " A # 5 >   ", "8   M / > 5 >   ", "8 > 0 M 5 ( > . ?  "], answer: "A" } ], level3: [ { question: "8 > 0 M 5 ( > . ?  5 ? 6 G 7 #  > & > 9 0 # 9 H ?", options: ["/ 9 2 ! <  > ", "  M  > 2 ! <  > ", "* >   2 ! <  G ", "% K ! < > * > ( @ "], answer: "A" } ] }, "5  ( ": { level1: [ { question: "'2 ! <  > '  > , 9 A 5  (  M / > 9 H ?", options: ["2 ! <  G ", "2 ! <  K  ", "2 ! <  ? / >  ", "2 ! <  > "], answer: "A" }, { question: "'* A 8 M $  '  > , 9 A 5  (  M / > 9 K  > ?", options: ["* A 8 M $  G  ", "* A 8 M $  K  ", "* A 8 M $  G ", "* A 8 M $  > "], answer: "A" } ], level2: [ { question: "' A 0 A '  > , 9 A 5  ( 0 B *  M / > 9 H ?", options: [" A 0 A ", " A 0 A   ", " A 0 A  ( ", " A 0 A  # "], answer: "A" } ], level3: [ { question: "'. > $ > '  > , 9 A 5  (  M / > 9 H ?", options: [". > $ >   ", ". > $ >   ", ". > $ C  # ", ". > $ > "], answer: "A" } ] }, "2 ?   ": { level1: [ { question: "* A 2 M 2 ?   6 , M &  L ( 8 > 9 H ?", options: ["* ? $ > ", ". > $ > ", ", 9 ( ", "2 ! <  @ "], answer: "A" }, { question: "'2 G  ?  > '  ? 8 2 ?    > 6 , M & 9 H ?", options: ["8 M $ M 0 @ 2 ?   ", "* A 2 M 2 ?   ", " - / 2 ?   ", " K  ( 9 @  "], answer: "A" } ], level2: [ { question: "'6 G 0 ( @ '  ? 8 2 ?    > 0 B * 9 H ?", options: ["8 M $ M 0 @ 2 ?   ", "* A 2 M 2 ?   ", "( * A  8  ", " - / 2 ?   "], answer: "A" } ], level3: [ { question: "'. K 0 '  > 8 M $ M 0 @ 2 ?   0 B *  M / > 9 H ?", options: [". K 0 ( @ ", ". K 0 ? ( ", ". K 0 @ ", ". K 0 > "], answer: "A" } ] }, " > 2 ": { level1: [ { question: "'0 > .  > $ > 9 H ' . G   L ( 8 >  > 2 9 H ?", options: ["5 0 M $ . > ( ", "- B $ ", "- 5 ? 7 M / ", "* B 0 M # - B $ "], answer: "A" }, { question: "'5 9    > ' . G   L ( 8 >  > 2 9 H ?", options: ["- 5 ? 7 M / $ M ", "5 0 M $ . > ( ", "- B $ ", " * B 0 M # - B $ "], answer: "A" } ], level2: [ { question: "'5 9  >  A  > % > ' . G   L ( 8 >  > 2 9 H ?", options: ["* B 0 M # - B $ ", " 8 ( M ( - B $ ", " * B 0 M # - B $ ", "8 > . > ( M / - B $ "], answer: "A" } ], level3: [ { question: "8  & ?  M ' - B $  > 2  > & > 9 0 # 9 H ?", options: ["5 9  / > 9 K  > ", "5 9  / > % > ", "5 9  0 9 > % > ", "5 9   A  > % > "], answer: "A" } ] }, " > 0  ": { level1: [ { question: "'0 > . ( G  > ( >  > / > ' . G  '( G '  ? 8  > 0   >  ? 9 M ( 9 H ?", options: [" 0 M $ > ", " 0 M . ", " 0 # ", "8  * M 0 & > ( "], answer: "A" }, { question: "'0 > . 8 G * " < >  > $ > 9 H ' . G  '8 G '  ? 8  > 0   >  ? 9 M ( 9 H ?", options: [" 0 # ", " * > & > ( ", "8  * M 0 & > ( ", " ' ?  0 # "], answer: "A" } ], level2: [ { question: "'* A 8 M $  . G  * 0 9 H ' . G  '* 0 '  ? 8  > 0   >  ? 9 M ( 9 H ?", options: [" ' ?  0 # ", " * > & > ( ", "8  * M 0 & > ( ", " 0 # "], answer: "A" } ], level3: [ { question: "'. K 9 (  K * A 8 M $  & K ' . G  ' K '  ? 8  > 0   >  ? 9 M ( 9 H ?", options: ["8  * M 0 & > ( ", " 0 M . ", " 0 M $ > ", " * > & > ( "], answer: "A" } ] }, "* M 0 $ M / / ": { level1: [ { question: "'2 ! <  * ( ' . G   L ( 8 > * M 0 $ M / / 9 H ?", options: ["* ( ", "2 ! < ", " ", "  "], answer: "A" }, { question: "'- > 0 $ @ / ' . G  * M 0 $ M / / 9 H ?", options: [" / ", " ", "$ @ ", "/ "], answer: "A" } ], level2: [ { question: "'* ( @ / ' . G   L ( 8 > * M 0 $ M / / 9 H ?", options: [" ( @ / ", "( @ / ", " / ", "/ "], answer: "A" } ], level3: [ { question: "'8  M  ( $ > ' . G  * M 0 $ M / / 9 H ?", options: ["$ > ", "$ M 5 ", "$ > ", "* ( "], answer: "A" } ] }, " * 8 0 M  ": { level1: [ { question: "' - ? ( / ' . G   L ( 8 > * 8 0 M  9 H ?", options: [" - ? ", " - @ ", " ", " ( A "], answer: "A" }, { question: "'* M 0 , 2 ' . G  * 8 0 M   M / > 9 H ?", options: ["* M 0 ", "* M 0 > ", "* 0 > ", "* M 0 $ ? "], answer: "A" } ], level2: [ { question: "'& A 0 >  > 0 ' . G  * 8 0 M  9 H ?", options: ["& A 0 ", "& A ", "& A 8 ", "& A :"], answer: "A" } ], level3: [ { question: "'8  / K  ' . G  * 8 0 M   M / > 9 H ?", options: ["8 . M ", "8 ", "8 ( M ", "8 9 "], answer: "A" } ] }, "$ $ M 8 .  5  $ & M - 5 ": { level1: [ { question: "'  '  ? 8 * M 0  > 0  > 6 , M & 9 H ?", options: ["$ & M - 5 ", "$ $ M 8 . ", "& G 6  ", "5 ? & G 6 @ "], answer: "A" }, { question: "' M 7 @ 0 '  > $ & M - 5 0 B *  M / > 9 H ?", options: [" @ 0 ", "& B ' ", " M 7 @ 0 ", "& A  M ' "], answer: "A" } ], level2: [ { question: "'0 > $ '  ? 8  > $ & M - 5 0 B * 9 H ?", options: ["0 > $ M 0 ? ", "0  ( @ ", "( ? 6 > ", "/ > . ? ( @ "], answer: "A" } ], level3: [ { question: "' > / ' $ $ M 8 . 0 B *  M / > 9 H ?", options: [" L ", " K ", " 5 ", " >  "], answer: "A" } ] }, "5 0 M $ ( @ ": { level1: [ { question: "6 A & M ' 5 0 M $ ( @ 5 > 2 > 6 , M &  L ( 8 > 9 H ?", options: [" @ 0 M $ ? ", " @ 0 M $ M $ ? ", " ? 0 M $ ? ", " @ 0 M $ @ "], answer: "A" }, { question: "' 0 K  M / ' 6 , M &  @ 6 A & M ' 5 0 M $ ( @  M / > 9 H ?", options: [" 0 K  M / ", " 0 K  M / ", " 0 K  M / ", " 0 K  M / "], answer: "A" } ], level2: [ { question: "'. 0 M / > & > '  @ 6 A & M ' 5 0 M $ ( @ 9 H ?", options: [". 0 M / > & > ", ". 0 M / > & > ", ". 0 M / > & > ", ". 0 M / > & > "], answer: "A" } ], level3: [ { question: "'  M  M 5 2 '  @ 6 A & M ' 5 0 M $ ( @  M / > 9 H ?", options: ["  M  M 5 2 ", "  M  5 2 ", "  M  5 2 ", "  M  M 5 2 "], answer: "A" } ] }, "2 K  K  M $ ? / >   5  . A 9 > 5 0 K   G  0 M % ": { level1: [ { question: "'   > 0 G  2 ( > ' . A 9 > 5 0 G  >  0 M % ?", options: [" M 0 K '  0 ( > ", "* M 0 G .  0 ( > ", "! 0 ( > ", "9  8 ( > "], answer: "A" }, { question: "' K  @  > ' . A 9 > 5 0 G  >  0 M %  M / > 9 H ?", options: [" $ M $ . ", "( ? . M ( ", ", A 0 > ", " 8 $ "], answer: "A" } ], level2: [ { question: "'( >  0  ! < ( > '  >  0 M % ?", options: [" A 6 > . &  0 ( > ", "& A  @ 9 K ( > ", "2 ! < ( > ", "- >  ( > "], answer: "A" } ], level3: [ { question: "'    G . A  9 . G   @ 0 > '  >  0 M % ?", options: [" * 0 M / > * M $ $ > ", " ' ?  $ > ", "8 A  & 0 $ > ", " A 0 B * $ > "], answer: "A" } ] }, "8  ' ? ": { level1: [ { question: "'8 B 0 M / K & / ' . G   L ( 8 @ 8  ' ? 9 H ?", options: [" A # ", "5 C & M ' ? ", "/ # ", " / > & ? "], answer: "A" }, { question: "'( . K ( .  ' . G   L ( 8 @ 8  ' ? 9 H ?", options: ["5 ? 8 0 M  ", "/ # ", " A # ", "& @ 0 M  "], answer: "A" } ], level2: [ { question: "'. 9 0 M 7 ? ' . G   L ( 8 @ 8  ' ? 9 H ?", options: ["/ # ", " A # ", "5 C & M ' ? ", "5 ? 8 0 M  "], answer: "A" } ], level3: [ { question: "'* 5 ( '  > 8  ' ? -5 ?  M  G &  M / > 9 H ?", options: ["* K +  ( ", "* +  ( ", "* L +  ( ", "* K + ( "], answer: "A" } ] }, "5 >  M / ": { level1: [ { question: "'0 > . ( G  > ( >  > / > ' . G   L ( 8 > 5 >  M / 9 H ?", options: [" 0 M $ C 5 >  M / ", " 0 M . 5 >  M / ", "- > 5 5 >  M / ", ". ? 6 M 0 "], answer: "A" }, { question: "'. A  8 G > ( 9 @   > $ > ' . G  5 >  M / 9 H ?", options: ["- > 5 5 >  M / ", " 0 M $ C 5 >  M / ", " 0 M . 5 >  M / ", "* M 0 G 0 # > 0 M %  "], answer: "A" } ], level2: [ { question: "'0 > . 8 G * A 8 M $  * " < @   ' . G  5 >  M / 9 H ?", options: [" 0 M . 5 >  M / ", " 0 M $ C 5 >  M / ", "- > 5 5 >  M / ", "( ? 7 M  M 0 ? / "], answer: "A" } ], level3: [ { question: " 0 M $ C 5 >  M /  > & > 9 0 #  L ( 8 > 9 H ?", options: ["5 9  > $ > 9 H ", " 8 8 G  > / >  > $ > 9 H ", " 8 8 G  > / >  / > ", " > / >  > $ > 9 H "], answer: "A" } ] }, "6 , M & 0 B * ": { level1: [ { question: "'0 > . '  > 8  , K ' (   5  (  M / > 9 H ?", options: ["9 G 0 > . ", "0 > . G # ", "0 > . > / ", "0 > . > $ M "], answer: "A" } ], level2: [ { question: "', > 2  '  G $ C $ @ / > 5 ? -  M $ ? , 9 A 5  (  > 0 B *  M / > 9 H ?", options: [", > 2  H  ", ", > 2  G ( ", ", > 2  G - M /  ", ", > 2  > ( > . M "], answer: "A" } ], level3: [ { question: "'+ 2 '  G *   . @ 5 ? -  M $ ?   5  (  > 0 B *  M / > 9 H ?", options: ["+ 2 > $ M ", "+ 2 G ( ", "+ 2 > / ", "+ 2 G "], answer: "A" } ] }, "8 . > 8 ": { level1: [ { question: "'0 >  * A $ M 0 ' . G   L ( 8 > 8 . > 8 9 H ?", options: ["$ $ M * A 0 A 7 ", "& M 5  & M 5 ", ", 9 A 5 M 0 @ 9 ? ", " 0 M . ' > 0 / "], answer: "A" }, { question: "'( @ 2   ' . G  8 . > 8 9 H ?", options: [", 9 A 5 M 0 @ 9 ? ", "$ $ M * A 0 A 7 ", "& M 5 ?  A ", " 5 M / / @ - > 5 "], answer: "A" } ], level2: [ { question: "'& 6 > ( ( ' . G   L ( 8 > 8 . > 8 9 H ?", options: [", 9 A 5 M 0 @ 9 ? ", " 0 M . ' > 0 / ", "$ $ M * A 0 A 7 ", "& M 5  & M 5 "], answer: "A" } ], level3: [ { question: "'/ % > 6  M $ ? ' . G  8 . > 8 9 H ?", options: [" 5 M / / @ - > 5 ", "$ $ M * A 0 A 7 ", ", 9 A 5 M 0 @ 9 ? ", " 0 M . ' > 0 / "], answer: "A" } ] }, " 2   > 0 ": { level1: [ { question: "'. A   ( M & M 0 . > 8 > 8 A  & 0 9 H ' . G   2   > 0 9 H ?", options: [" * . > ", "0 B *  ", " $ M * M 0 G  M 7 > ", " ( A * M 0 > 8 "], answer: "A" }, { question: " 9 >    9 @ 5 0 M #  @ , > 0 -, > 0  5 C $ M $ ? 9 K , 5 9 >   L ( 8 >  2   > 0 9 K $ > 9 H ?", options: [" ( A * M 0 > 8 ", "/ .  ", "6 M 2 G 7 ", " * . > "], answer: "A" } ], level2: [ { question: "'8 >  0 8 >   - @ 0 9 C & / ' . G   2   > 0 9 H ?", options: [" * . > ", "0 B *  ", " $ M * M 0 G  M 7 > ", " $ ? 6 / K  M $ ? "], answer: "A" } ], level3: [ { question: "'. > ( K . & ( . B 0 $ . A  0 >  ' . G   2   > 0 9 H ?", options: [" $ M * M 0 G  M 7 > ", " * . > ", "0 B *  ", " ( A * M 0 > 8 "], answer: "A" } ] }, " 5 ? / K   5  2 G   K   @ 0  ( >   ": { level1: [ { question: "'0 > .  0 ? $ . > ( 8 '  G 0  / ? $ >  L ( 9 H  ?", options: ["$ A 2 8 @ & > 8 ", "8 B 0 & > 8 ", ". @ 0 > , >  ", " , @ 0 & > 8 "], answer: "A" }, { question: "'. ' A 6 > 2 > '  G 0  ( >  > 0 9 H  ?", options: ["9 0 ? 5  6 0 > / ,  M  ( ", "( ? 0 > 2 > ", "*  $ ", ". 9 > & G 5 @ 5 0 M . > "], answer: "A" } ], level2: [ { question: "' K & > ( '  G 2 G    L ( 9 H  ?", options: ["* M 0 G .   & ", " / 6   0 * M 0 8 > & ", ". H % ? 2 @ 6 0 #  A * M $ ", "0 > .   & M 0 6 A  M 2 "], answer: "A" } ], level3: [ { question: "' > . > / ( @ '  G 0  / ? $ > 9 H  ?", options: [" / 6   0 * M 0 8 > & ", "( ? 0 > 2 > ", "*  $ ", ". 9 > & G 5 @ 5 0 M . > "], answer: "A" } ] }, "- > 7 > 5 ?  > 8  >  ' M / > * ( ": { level1: [ { question: "- > 7 > 5 ?  > 8  > . A  M / & M & G 6 M /  M / > 9 H ?", options: ["8  * M 0 G 7 #  M 7 . $ >  > 5 ?  > 8 ", "5 M / >  0 # 8 ?  > ( > ", "2 ? * ?  M  > ( & G ( > ", " 5 ? $ > 2 ?  ( > "], answer: "A" }, { question: ", > 2  . G  - > 7 > 5 ?  > 8  > 8 0 M 5 * M 0 % . 0 B *  M / > 9 H ?", options: ["8 A ( ( > ", ", K 2 ( > ", "* " < ( > ", "2 ?  ( > "], answer: "A" } ], level2: [ { question: "* M 0 > % . ?  8 M $ 0 * 0 - > 7 > 6 ?  M 7 #  @ 8 , 8 G * / A  M $ 5 ? ' ?  L ( 8 @ 9 H ?", options: [" G 2 5 ? ' ? ", "5 M / >  0 # 5 ? ' ? ", " ( A 5 > & 5 ? ' ? ", "8 B $ M 0 5 ? ' ? "], answer: "A" } ], level3: [ { question: "- > 7 >  L 6 2 K  . G  8 , 8 G   $ . G   L ( 8 >  L 6 2 5 ?  8 ? $ 9 K $ > 9 H ?", options: ["2 G  ( ", "6 M 0 5 # ", "5 >  ( ", "- > 7 # "], answer: "A" } ] } }; // Complete list of 31 Hindi Language I topics const allTopics = [ " * ? $  ( A  M  G & ", "9 ? ( M & @ 5 0 M # . > 2 > (8 M 5 0 , 5 M /   ( )", "5 0 M # K   G . G 2 8 G . > $ M 0 ?  $ % >  . > $ M 0 ?  6 , M & K   @ * 9  > ( ", "5 >  M / 0  ( > ", "9 ? ( M & @  @ 8 - @ ' M 5 ( ? / K   G * > 0 8 M * 0 ?    $ 0  @  > (  > 0 @ ", "9 ? ( M & @ - > 7 >  @ 8 - @ ' M 5 ( ? / K  , 5 0 M # K  ,  ( A 8 M 5 > 0 ,  ( A ( > 8 ?   5   ( M & M 0 , ? ( M & A . G   ( M $ 0 ", "5 ? 0 > .  ? ( M 9 K  / % > -  2 M * 5 ? 0 > . ,  0 M ' 5 ? 0 > . , * B 0 M # 5 ? 0 > . , * M 0 6 M ( 5 >   , 5 ? 8 M . / , K '  ,  ? ( M 9 K   > * M 0 / K  ", "8 . > ( ' M 5 ( ? / K  5 > 2 G 6 , M & ", "5 ? 2 K . 6 , M & ", "* 0 M / > / 5 >  @ 6 , M & ", "5 >  M / >  6 K   G 2 ?    6 , M & ", "8   M  >  5  8  G - G & ", "8 0 M 5 ( > .  5  8  G - G & ", " M 0 ? / >  5  8  G - G & ", "5 ? 6 G 7 #  5  8  G - G & ", "5  ( ", "2 ?   ", " > 2 ", " > 0  ", "* M 0 $ M / / ", " * 8 0 M  ", "$ $ M 8 .  5  $ & M - 5 ", "5 0 M $ ( @ ", "2 K  K  M $ ? / >   5  . A 9 > 5 0 K   G  0 M % ", "8  ' ? ", "5 >  M / ", "6 , M & 0 B * ", "8 . > 8 ", " 2   > 0 ", " 5 ? / K   5  2 G   K   @ 0  ( >   ", "- > 7 > 5 ?  > 8  >  ' M / > * ( " ]; // 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 selectHindiBtn = document.getElementById('selectHindiBtn'); 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'); let selectedChapters = []; let selectedLevel = null; function populateChapters() { const container = document.getElementById('chapterCheckboxContainer'); 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() { const allChapterCheckboxes = document.querySelectorAll('input[name="chapter"]'); allChapterCheckboxes.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: "* M 0 6 M ( * 2 , M ' ( 9 @  9 H  d  C * / >  ( M /  ' M / > /  A ( G  d ", options: ["A", "B", "C", "D"], answer: "A" }]; } allQuestions = allQuestions.sort(() => Math.random() - 0.5); return allQuestions.slice(0, Math.min(count, allQuestions.length)); } // Event Listeners startGeneratingBtn.addEventListener('click', function() { startScreen.classList.add('hidden'); subjectSelection.classList.remove('hidden'); }); selectHindiBtn.addEventListener('click', function() { subjectSelection.classList.add('hidden'); populateChapters(); chapterSelection.classList.remove('hidden'); }); backToStartBtn.addEventListener('click', function() { generatedPaperContainer.classList.add('hidden'); startContainer.classList.remove('hidden'); chapterSelection.classList.add('hidden'); levelSelection.classList.add('hidden'); startScreen.classList.remove('hidden'); subjectSelection.classList.add('hidden'); }); generateAssignmentBtn.addEventListener('click', function() { 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'); }); backToChaptersBtn.addEventListener('click', function() { levelSelection.classList.add('hidden'); chapterSelection.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.addEventListener('click', function() { selectLevel(1); }); level2Btn.addEventListener('click', function() { selectLevel(2); }); level3Btn.addEventListener('click', function() { selectLevel(3); }); generateFinalBtn.addEventListener('click', function() { if(!selectedLevel) { alert(" C * / >  ? ( >  8 M $ 0  A ( G  !"); return; } startContainer.classList.add('hidden'); levelSelection.classList.add('hidden'); generatedPaperContainer.classList.remove('hidden'); generatedPaperContainer.innerHTML = ''; const mcqs = getRandomQuestions(selectedChapters, selectedLevel, 45); let questionNumber = 1; let paperContent = ` <div class="header"> <h2>UP TET Paper 1 - - > 7 > * M 0 % . (9 ? ( M & @ )  8 >  ( . G   </h2> <h3>${selectedChapters.length === allTopics.length ? "* B 0 M # * > M /  M 0 . (8 - @ 5 ? 7 / )" : selectedChapters.slice(0,3).join(", ")+ (selectedChapters.length>3 ? "..." : "")}</h3> <p>8 M $ 0 ${selectedLevel} - ${selectedLevel === 1 ? ", G 8 ?  " : selectedLevel === 2 ? ". ' M / . " : "* 0 @  M 7 > 8 M $ 0 "}</p> </div> <div class="content-area"> <div class="instructions"> <p><strong>( ? 0 M & G 6 :</strong></p> <ol> <li> 8  8 >  ( . G   . G  45 , 9 A 5 ?  2 M * @ / * M 0 6 M ( (MCQs) 9 H  d </li> <li>* M 0 $ M / G  * M 0 6 M (  G  > 0 5 ?  2 M * 9 H  ,  G 5 2   8 9 @ 9 H d </li> <li>  ? $ 5 ?  2 M *  >  / (  0 G  d </li> <li>8 . / : 60 . ? (  </li> </ol> </div> <div class="question-section"> <div class="section-heading">, 9 A 5 ?  2 M * @ / * M 0 6 M ( (MCQs)</div>`; mcqs.forEach(mcq => { paperContent += ` <div class="question"> <div class="question-text">${questionNumber}. ${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>`; questionNumber++; }); paperContent += ` </div> <div class="answer-sheet"> <h3 class="section-title"> $ M $ 0  A   @ (Answer Key)</h3> <table class="answer-table"> <thead> <tr> <th>* M 0 6 M ( 8  .</th><th> $ M $ 0 </th> <th>* M 0 6 M ( 8  .</th><th> $ M $ 0 </th> <th>* M 0 6 M ( 8  .</th><th> $ M $ 0 </th> </tr> </thead> <tbody>`; for(let i=0; i<mcqs.length; i+=3) { paperContent += `<tr>`; for(let j=0; j<3; j++) { if(i+j < mcqs.length) { paperContent += `<td>${i+j+1}</td><td>${mcqs[i+j].answer}</td>`; } else { paperContent += `<td></td><td></td>`; } } paperContent += `</tr>`; } paperContent += ` </tbody> </table> </div> <div class="action-buttons"> <button class="btn btn-primary" id="printBtn"><i class="fas fa-print"></i> * M 0 ?    0 G  </button> <button class="btn btn-success" id="downloadBtn"><i class="fas fa-download"></i> PDF ! > ( 2 K !  0 G  </button> <button class="btn btn-danger" id="newAssignmentBtn"><i class="fas fa-plus"></i> ( / >  8 >  ( . G   </button> </div> </div>`; generatedPaperContainer.innerHTML = paperContent; document.getElementById('printBtn').addEventListener('click', function() { window.print(); }); document.getElementById('downloadBtn').addEventListener('click', downloadPDF); document.getElementById('newAssignmentBtn').addEventListener('click', function() { generatedPaperContainer.classList.add('hidden'); startContainer.classList.remove('hidden'); startScreen.classList.remove('hidden'); subjectSelection.classList.add('hidden'); chapterSelection.classList.add('hidden'); levelSelection.classList.add('hidden'); selectedLevel = null; level1Btn.classList.remove('selected'); level2Btn.classList.remove('selected'); level3Btn.classList.remove('selected'); }); }); 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: 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_Hindi_Assignment.pdf'); } catch(err) { console.error(err); alert('PDF  ( 0 G 6 ( . G  $ M 0 A  ? d  C * / > * A (  * M 0 / > 8  0 G  d '); } finally { if(tempDiv && tempDiv.parentNode) document.body.removeChild(tempDiv); } } </script> </body> </html>