ÿþ<!DOCTYPE html> <html lang="hi"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>UP Police Constable - 8 > . > ( M / 9 ?  & @  - M / > 8 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: #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', 'Noto Sans Devanagari', 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); line-height: 1.6; } .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.6rem; 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(44, 125, 160, 0.3); } .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: 1.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.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: 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.2rem; font-weight: 600; margin-bottom: 10px; color: var(--primary-dark); } .option-description { color: var(--gray); font-size: 0.85rem; } .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; transition: var(--transition); } .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.2rem; } } @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-police-constable-practice-set-generator.html" class="home-icon" id="homeIconBtn"> <i class="fas fa-home"></i> </a> <h1>=ØÖÜ UP * A 2 ? 8  >  8 M  G , 2 8 > . > ( M / 9 ?  & @  - M / > 8 8 G   ( 0 G  0 </h1> <p>UP * A 2 ? 8 - 0 M $ @ * 0 @  M 7 >  G 2 ?  5 ? 7 / 5 > 0 & 8 M $ 0 > ( A 8 > 0 9 ?  & @ - > 7 > * M 0 6 M ( 8 G  </p> </div> <div class="content-area"> <div id="startScreen"> <h2 class="section-title">8 > . > ( M / 9 ?  & @  - M / > 8 8 G   ( 0 G  0 </h2> <p class="text-center">UP * A 2 ? 8  >  8 M  G , 2 * 0 @  M 7 > 9 G $ A 5 ? 7 / 5 > 0  5  8 M $ 0 > ( A 8 > 0 9 ?  & @ 5 M / >  0 #  5  8 > 9 ? $ M /  >  - M / > 8 8 G  $ H / > 0  0 G  </p> <div class="btn-group"> <button class="btn btn-primary" id="startGeneratingBtn"> - M / > 8 8 G  , ( > ( > 6 A 0 B  0 G  </button> </div> </div> <div id="practiceTypeSelection" class="hidden"> <h2 class="section-title"> - M / > 8  > * M 0  > 0  A ( G  </h2> <p class="text-center"> * ( @ $ H / > 0 @  G  ( A 8 > 0  - M / > 8 8 G   A ( G  :</p> <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">5 ? 7 / > ( A 8 > 0  - M / > 8 </div> <div class="option-description"> ? 8 @ 5 ? 6 G 7 9 ?  & @ 5 ? 7 / (5 M / >  0 # , 8 > 9 ? $ M /  & ? )  >  - M / > 8  0 G  </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">* B 0 M # 2  , >   G 8 M  </div> <div class="option-description">5 > 8 M $ 5 ?  * 0 @  M 7 >  H 8 > 50 * M 0 6 M ( K   > 8 G  </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">* ?  2 G 5 0 M 7 K   G * M 0 6 M ( </div> <div class="option-description">* ?  2 @ UP * A 2 ? 8 * 0 @  M 7 >    G  ' > 0 * 0 9 ?  & @ * M 0 6 M ( </div> </div> </div> <div class="btn-group"> <button class="btn btn-danger" id="backToStartBtn">* @  G  >   </button> <button class="btn btn-success" id="proceedToChaptersBtn">5 ? 7 /  A ( G  ’!</button> </div> </div> <div id="chapterSelection" class="hidden"> <h2 class="section-title">9 ?  & @  G 5 ? 7 /  A ( G  </h2> <form id="chapterForm"> <div class="checkbox-container" id="hindiTopicsContainer"></div> </form> <div id="questionCountSection"> <h3 class="section-title">* M 0 6 M ( K   @ 8   M / >  A ( G  </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">* @  G </button> <button class="btn btn-success" id="generateAssignmentBtn"> ? ( >  8 M $ 0  A ( G  ’!</button> </div> </div> <div id="levelSelection" class="hidden"> <h2 class="section-title"> ? ( >  8 M $ 0  A ( G  </h2> <p class="text-center">UP * A 2 ? 8 * 0 @  M 7 >  G  ( A 8 > 0 9 ?  & @ 8 M $ 0  A ( G  :</p> <div class="level-buttons"> <button class="btn btn-level" id="level1Btn">Level 1<br><small>, A ( ? / > & @ (. B 2 5 M / >  0 # )</small></button> <button class="btn btn-level" id="level2Btn">Level 2<br><small>. ' M / . ( * 8 0 M  -* M 0 $ M / / , 8  ' ? )</small></button> <button class="btn btn-level" id="level3Btn">Level 3<br><small>  M  (0 8 ,  ( M & , 8 > 9 ? $ M / )</small></button> </div> <div id="timerOptions"> <h3 class="section-title">8 . / 8 @ . >  A ( G  </h3> <div class="timer-options"> <div class="timer-btn" data-time="30">30 . ? (  </div> <div class="timer-btn" data-time="45">45 . ? (  </div> <div class="timer-btn" data-time="60">60 . ? (  </div> <div class="timer-btn" data-time="90">90 . ? (  </div> </div> </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"> - M / > 8 8 G   ( 0 G   0 G  </button> </div> </div> </div> </div> <div class="container hidden" id="generatedPaperContainer"></div> <script> const { jsPDF } = window.jspdf; // ======================== 9 ?  & @ 5 ? 7 / K   @ 8 B  @ (14 Chapters) ======================== const hindiChapters = [ "9 ? ( M & @ 5 0 M # . > 2 >  5  5 0 M $ ( @ ", "$ & M - 5 -$ $ M 8 . ", "* 0 M / > / 5 >  @ , 5 ? 2 K . ,  ( G  > 0 M %  6 , M & ", "5 >  M / >  6 K   G 2 ?    6 , M & ", "8 . 0 B * @ - ? ( M ( > 0 M %  6 , M & ", " 6 A & M ' 5 >  M / K   > 6 A & M ' ?  0 # ", "2 ?   , 5  ( ,  > 0  , 8 0 M 5 ( > . , 5 ? 6 G 7 # ,  M 0 ? / > ,  > 2 , 5 >  M / ,  5 M / / ", " * 8 0 M   5  * M 0 $ M / / ", "8 ( M ' ?  5  8 . > 8 ", "5 ? 0 > . - ? ( M 9 ", ". A 9 > 5 0 G  5  2 K  K  M $ ? / >  ", "0 8 ,  ( M & ,  2   > 0 ", " * ? $  & M / >  6  5  * & M / >  6 * 0  ' > 0 ? $ * M 0 6 M ( ", "* M 0 8 ? & M '  5 ? , 2 G    5  (  @ * M 0 8 ? & M ' 0  ( >   ", "9 ? ( M & @ - > 7 > . G  * A 0 8 M  > 0  5  5 ? 5 ? ' " ]; // ======================== * B 0 M # * M 0 6 M ( ! G  > , G 8 (9 0  ' M / > /  G 2 ?  level1, level2, level3) ======================== 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 }); } // ----------  ' M / > / 1: 9 ? ( M & @ 5 0 M # . > 2 >  5  5 0 M $ ( @ ---------- addQuestion(hindiChapters[0], 1, "9 ? ( M & @ 5 0 M # . > 2 > . G   A 2  ? $ ( G 8 M 5 0 9 K $ G 9 H  ?", ["10", "11", "12", "13"], "B"); addQuestion(hindiChapters[0], 1, "' ( A 8 M 5 > 0 '  >  ? 9 M (  M / > 9 H ?", ["(.)", "(:)", "( )", "( )"], "C"); addQuestion(hindiChapters[0], 2, "( ? . M ( 2 ?  ? $ . G  8 G  ? 8 6 , M &  @ 5 0 M $ ( @ 6 A & M ' 9 H ?", [" 6 @ 0 M 5 > & ", " 6 @ 0 M 5 > & ", " 6 @ 0 M 5 > & ", " 6 @ 0 M 5 > & "], "A"); addQuestion(hindiChapters[0], 2, "'  M  M 5 2 ' 6 , M & . G   L ( 8 > 8  / A  M $ 5 M /   ( 9 H ?", [" M  ", " M  M 5 ", " M 5 ", " M  2 "], "A"); addQuestion(hindiChapters[0], 3, "9 ? ( M & @ 5 0 M # . > 2 >  G  ( A 8 > 0 '! < '  0 '" < '  ? 8 5 0 M   G   M 7 0 9 H  ?", [" 5 0 M  ", "$ 5 0 M  ", "* 5 0 M  ", " 5 0 M  "], "A"); // ----------  ' M / > / 2: $ & M - 5 -$ $ M 8 . ---------- addQuestion(hindiChapters[1], 1, "'  ' 6 , M &  ? 8 6 , M &  > $ & M - 5 0 B * 9 H ?", ["  M ( ? ", "  M 0 ", "  M ( ? ", "  M 0 # @ "], "A"); addQuestion(hindiChapters[1], 1, "' > 0 M / '  ? 8 * M 0  > 0  > 6 , M & 9 H ?", ["$ $ M 8 . ", "$ & M - 5 ", "& G 6  ", "5 ? & G 6 @ "], "A"); addQuestion(hindiChapters[1], 2, "( ? . M ( 2 ?  ? $ . G  8 G  L ( 8 > 6 , M & $ & M - 5 9 H ?", ["* A $ M 0 ", "* B $ ", "8 B 0 M / ", " M 0 > . "], "B"); addQuestion(hindiChapters[1], 2, "' M 7 G $ M 0 '  > $ & M - 5 0 B *  M / > 9 H ?", [" G $ ", " G $ @ ", " M 7 ? $ ?  ", " M 7 G $ M 0 @ / "], "A"); addQuestion(hindiChapters[1], 3, "( ? . M ( 2 ?  ? $ . G   L ( 8 > / A  M . $ $ M 8 . -$ & M - 5  > 8 9 @  K ! < > 9 H ?", ["& A  M ' -& B ' ", "  M ( ? -  M ( ? ", " M 0 > . - M 0 > . @ # ", "8 B 0 M / -8 B 0 M / "], "A"); // ----------  ' M / > / 3: * 0 M / > / 5 >  @ , 5 ? 2 K . ,  ( G  > 0 M %  ---------- addQuestion(hindiChapters[2], 1, "'* 5 ( '  > * 0 M / > / 5 >  @ 6 , M &  M / > 9 H ?", ["5 > / A ", " 2 ", "  M ( ? ", "* C % M 5 @ "], "A"); addQuestion(hindiChapters[2], 1, "' & ? '  > 5 ? 2 K . 6 , M &  M / > 9 H ?", ["  $ ", ". ' M / ", "* M 0 > 0  - ", "6 A 0 B "], "A"); addQuestion(hindiChapters[2], 2, "'  , A ' 6 , M &  G 2 ?   L ( 8 > * 0 M / > / 5 >  @ 6 , M & ( 9 @  9 H ?", ["* > ( @ ", " 2 ", "5 > 0 ? ", " ( 2 "], "D"); addQuestion(hindiChapters[2], 2, "'8 L . M / '  > 5 ? 2 K . 6 , M & 9 H ?", [" M 0 B 0 ", ". C & A ", " K . 2 ", "6 >  $ "], "A"); addQuestion(hindiChapters[2], 3, "'9 0 ? '  G  ? $ ( G  0 M % 9 H  ( ( G  > 0 M % @ )?", ["2", "3", "4", "5"], "B"); // ----------  ' M / > / 4: 5 >  M / >  6 K   G 2 ?    6 , M & ---------- addQuestion(hindiChapters[3], 1, " K   & M 0 ? / K  8 G  > ( >  > 8  G -   6 , M & , $ >   ", [" K  0 ", "  K  0 ", "* M 0 $ M /  M 7 ", " * M 0 $ M /  M 7 "], "A"); addQuestion(hindiChapters[3], 1, " ? 8  > *  > 0 ( 9 K 8  G -", [" 8 > ' M / ", "  ?  ? $ M 8 M / ", " 8 > ' M / ", " ( A *  > 0 M / "], "A"); addQuestion(hindiChapters[3], 2, " K * " < > -2 ?  > ( 9 K -", [" 6 ?  M 7 ? $ ", " ( * " < ", ". B 0 M  ", "  M  > ( @ "], "B"); addQuestion(hindiChapters[3], 2, " ? 8  >  ( M . * 9 2 G 9 A  9 K -", [" M / G 7 M ", " ( ? 7 M ", "* M 0 % .  ", "  M 0  "], "D"); addQuestion(hindiChapters[3], 3, " K  $ ? 9 > 8 8 G 8  ,  ' ? $ 9 K -", [" $ ? 9 > 8 ?  ", "* L 0 > # ?  ", "* M 0 >  @ ( ", "* > 0  * 0 ?  "], "A"); // ----------  ' M / > / 5: 8 . 0 B * @ - ? ( M ( > 0 M %  6 , M & ---------- addQuestion(hindiChapters[4], 1, " (  >  0 M % 9 H ?", [", > & 2 ", " ( > ", " ? ( ", " 9 0 > "], "A"); addQuestion(hindiChapters[4], 1, " A 2  >  0 M % 9 H ?", ["* 0 ? 5 > 0 ", "/ K  ", "8 . B 9 ", "* B 0 > "], "A"); addQuestion(hindiChapters[4], 2, "' 0 '  G  M / >  0 M % 9 H  ?", ["9 > % ,  0 ,  0 ,  0 ", " 0 ,  0 ,  0 ,  0 ", "9 > % ,  0 ,  0 ,  0 ", "9 > % ,  0 ,  0 ,  0 "], "A"); addQuestion(hindiChapters[4], 2, "8 A ' >  >  0 M % 9 H ?", [" . C $ ", "6 A & M ' ", "8 A ' > 0 ", "8 A  & 0 "], "A"); addQuestion(hindiChapters[4], 3, " 2   >  M / >  0 M % 9 K $ > 9 H ?", [" . 2 ", " 2 8 G $ M * ( M ( ", ".  2 @ ", "( > 5 "], "A"); // ----------  ' M / > / 6:  6 A & M ' 5 >  M / K   > 6 A & M ' ?  0 # ---------- addQuestion(hindiChapters[5], 1, "'. H   > ( > % > '  > 6 A & M ' 0 B * 9 H ?", [". H   / > % > ", ". H   > 0 9 > % > ", ". H   > $ > % > ", ". H   / > 9 B  "], "A"); addQuestion(hindiChapters[5], 1, "'5 9  2    > ' . G   L ( 8 @  6 A & M ' ? 9 H ?", ["2 ?   ", " > 2 ", "5  ( ", " > 0  "], "B"); addQuestion(hindiChapters[5], 2, "'. K 9 ( ( G    9 > ( @ * " < @ ' . G  '  '  M / > 9 H ?", ["5 ? 6 G 7 # ", "8   M  > ", "8 0 M 5 ( > . ", " M 0 ? / > "], "A"); addQuestion(hindiChapters[5], 2, "'$ A . ( G  M / K  / 9  ? / > ?' - / 9  ? 8 * M 0  > 0  > 5 >  M / 9 H ?", ["* M 0 6 M ( 5 >   ", "5 ? 8 M . / > & ? , K '  ", "  M  > 5 >   ", "( ? 7 G ' 5 >   "], "A"); addQuestion(hindiChapters[5], 3, "( ? . M ( 2 ?  ? $ . G  8 G  L ( 8 > 5 >  M / 6 A & M ' 9 H ?", ["5 9 8 K 0 9 > 9 H ", "5 9 8 K 0 9 G 9 H ", "5 9 8 K 0 9 @ 9 H ", "5 9 8 K 0 9 G 9 H  "], "A"); // ----------  ' M / > / 7: * 8 0 M   5  * M 0 $ M / / ---------- addQuestion(hindiChapters[6], 1, "'* M 0 $ ? '  M / > 9 H ?", [" * 8 0 M  ", "* M 0 $ M / / ", ". B 2 6 , M & ", "5 ? -  M $ ? "], "A"); addQuestion(hindiChapters[6], 1, "'8 A  & 0 $ > ' . G   L ( 8 > * M 0 $ M / / 9 H ?", ["$ > ", "$ M 5 ", " / ", " 5  "], "A"); addQuestion(hindiChapters[6], 2, "' - ? ' * 8 0 M  8 G , ( > 6 , M & 9 H ?", [" - ? . > ( ", " - ? / > ( ", " - ? ( / ", " - M / > 8 "], "A"); addQuestion(hindiChapters[6], 2, "' * ( > ' . G   L ( 8 > * M 0 $ M / / 9 H ?", ["( > ", " * ", "* ( > ", " * ( > "], "C"); addQuestion(hindiChapters[6], 3, "( ? . M ( . G  8 G  L ( 8 > 8  8 M  C $  > * 8 0 M  ( 9 @  9 H ?", [" * ", " ' ? ", ", G ", "8 A "], "C"); // ----------  ' M / > / 8: 8 ( M ' ?  5  8 . > 8 ---------- addQuestion(hindiChapters[7], 1, "& G 5 +  6 = & G 5 G 6 -  L ( 8 @ 8 ( M ' ? 9 H ?", ["8 M 5 0 8 ( M ' ? ", "5 M /   ( 8 ( M ' ? ", "5 ? 8 0 M  8 ( M ' ? ", "/ # 8 ( M ' ? "], "A"); addQuestion(hindiChapters[7], 1, "( @ 2  . 2 . G   L ( 8 > 8 . > 8 9 H ?", [" 0 M . ' > 0 / ", "& M 5  & M 5 ", "$ $ M * A 0 A 7 ", " 5 M / / @ - > 5 "], "A"); addQuestion(hindiChapters[7], 2, "'0 >  * A $ M 0 ' . G   L ( 8 > 8 . > 8 9 H ?", ["$ $ M * A 0 A 7 ", "& M 5 ?  A ", ", 9 A 5 M 0 @ 9 ? ", " 0 M . ' > 0 / "], "A"); addQuestion(hindiChapters[7], 2, "'( 0 8 ?  9 ' . G   L ( 8 > 8 . > 8 9 H ?", [" 0 M . ' > 0 / ", "& M 5  & M 5 ", "$ $ M * A 0 A 7 ", ", 9 A 5 M 0 @ 9 ? "], "A"); addQuestion(hindiChapters[7], 3, "( ? . M ( . G  8 G  L ( 8 > '& M 5 ?  A 8 . > 8 '  > & > 9 0 # 9 H ?", ["$ M 0 ? 2 K  ", "& K * 9 0 ", " L 0 > 9 > ", "8 * M $ > 9 "], "B"); // ----------  ' M / > / 9: . A 9 > 5 0 G  5  2 K  K  M $ ? / >  ---------- addQuestion(hindiChapters[8], 1, "'   K   > $ > 0 > ' . A 9 > 5 0 G  >  0 M % 9 H ?", [", 9 A $ * M / > 0 > ", "  ' > ", "$ G  (  0 ", " > 2 >  "], "A"); addQuestion(hindiChapters[8], 1, "' >  0 . G  8 >  0 - 0 ( > '  >  0 M % 9 H ?", ["% K ! < G . G  , 9 A $  A   9 ( > ", "8 . A & M 0 / > $ M 0 > ", " 2 8   / ", " ? (  > 0 M / "], "A"); addQuestion(hindiChapters[8], 2, " H 8 >  0 K  G 5 H 8 > - 0 K  G - 2 K  K  M $ ?  >  0 M % ?", [" 0 M .  > + 2 ", "* M 0 $ ? 6 K ' ", "8  > ", " 6 M 5 0  @ . 0 M  @ "], "A"); addQuestion(hindiChapters[8], 2, "' * ( @  ?  ! < @  2  *  > ( > '  >  0 M % 9 H ?", [" 2  0 9 ( > ", "8 M 5 $  $ M 0 9 K ( > ", " * ( >  > .  0 ( > ", "( ? 0 > 2 > 9 K ( > "], "B"); addQuestion(hindiChapters[8], 3, "( >  . G  & .  0 ( > . A 9 > 5 0 G  >  0 M % 9 H ?", ["$    0 ( > ", " A 8 M 8 > & ? 2 > ( > ", "* 0 G 6 > (  0 ( > ", "( > 0 >   0 ( > "], "C"); // ----------  ' M / > / 10: 0 8 ,  ( M & ,  2   > 0 ---------- addQuestion(hindiChapters[9], 1, "0 8  G  ? $ ( G * M 0  > 0 9 K $ G 9 H  ?", ["8", "9", "10", "11"], "B"); addQuestion(hindiChapters[9], 1, "'6 M 0 C   > 0 0 8 '  > 8 M % > / @ - > 5  M / > 9 H ?", ["0 $ ? ", "9 > 8 ", "6 K  ", " M 0 K ' "], "A"); addQuestion(hindiChapters[9], 2, "'8 ?  9 -6 ? 6 A ' . G   L ( 8 >  2   > 0 9 H ?", ["0 B *  ", " * . > ", " $ M * M 0 G  M 7 > ", "& C 7 M  >  $ "], "B"); addQuestion(hindiChapters[9], 2, "& K 9 >   & . G   ? $ ( @ . > $ M 0 >   9 K $ @ 9 H  ?", ["24", "26", "28", "30"], "A"); addQuestion(hindiChapters[9], 3, "'. A   ( M & M 0 . > 8 > 8 A ( M & 0 9 H ' -  2   > 0 , $ >   ", [" * . > ", "0 B *  ", " $ M * M 0 G  M 7 > ", " $ ? 6 / K  M $ ? "], "A"); // ----------  ' M / > / 11: * M 0 8 ? & M '  5 ? , 2 G    5  0  ( >   ---------- addQuestion(hindiChapters[10], 1, "0 > .  0 ? $ . > ( 8  G 0  / ? $ >  L ( 9 H  ?", ["$ A 2 8 @ & > 8 ", "8 B 0 & > 8 ", " , @ 0 & > 8 ", ". @ 0 > , >  "], "A"); addQuestion(hindiChapters[10], 1, ". ' A 6 > 2 >  G 0  ( >  > 0 9 H  ?", ["9 0 ? 5  6 0 > / ,  M  ( ", ". 9 > & G 5 @ 5 0 M . > ", "8 A . ? $ M 0 > (  & ( *  $ ", "( ? 0 > 2 > "], "A"); addQuestion(hindiChapters[10], 2, "' K & > ( ' * ( M / > 8  G 2 G    L ( 9 H  ?", ["* M 0 G .   & ", " / 6   0 * M 0 8 > & ", "+ # @ 6 M 5 0 ( > % 0 G # A ", " . C $ 2 > 2 ( >  0 "], "A"); addQuestion(hindiChapters[10], 2, " > . > / ( @ . 9 >  > 5 M /  G 0  / ? $ > 9 H  ?", [" / 6   0 * M 0 8 > & ", "( ? 0 > 2 > ", ". H % ? 2 @ 6 0 #  A * M $ ", "& ? (  0 "], "A"); addQuestion(hindiChapters[10], 3, "8 B 0 & > 8  @  ? 8  G 6 ? 7 M / % G ?", ["5 2 M 2 - >  > 0 M / ", " H $ ( M / . 9 > * M 0 - A ", "0 > . > ( A  >  > 0 M / ", "( ? . M , > 0 M  "], "A"); // 8 - @  ' M / > / K   G 2 ?  ! ? + < I 2 M  * M 0 6 M ( 8 A ( ? 6 M  ? $ for(let i=0; i<hindiChapters.length; i++) { const chap = hindiChapters[i]; if(!questions[chap]) questions[chap] = { level1: [], level2: [], level3: [] }; if(questions[chap].level1.length < 3) { for(let k=1; k<=3; k++) questions[chap].level1.push({ question: `${chap} 8 G , A ( ? / > & @ * M 0 6 M ( ${k}: 8 9 @ 5 ?  2 M *  A ( G  d `, options: ["5 ?  2 M * A", "5 ?  2 M * B", "5 ?  2 M * C", "5 ?  2 M * D"], answer: "A" }); } if(questions[chap].level2.length < 3) { for(let k=1; k<=3; k++) questions[chap].level2.push({ question: `${chap}  > . ' M / . 8 M $ 0 * M 0 6 M ( ${k}: 8 9 @  % (  A ( ?  d `, options: [" % ( 1", " % ( 2", " % ( 3", " % ( 4"], answer: "B" }); } if(questions[chap].level3.length < 3) { for(let k=1; k<=3; k++) questions[chap].level3.push({ question: `${chap} (  M  8 M $ 0 ) * M 0 6 M ( ${k}: ( ? . M ( . G  8 G  L ( 8 > 8 9 @ 9 H ?`, options: ["5 ?  2 M * 1", "5 ?  2 M * 2", "5 ?  2 M * 3", "5 ?  2 M * 4"], answer: "C" }); } } // DOM 0 G + 0 G  8 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 = []; let selectedLevel = null; let selectedPracticeType = null; let questionCount = 50; let timeLimit = 60; function loadTopics() { const container = document.getElementById('hindiTopicsContainer'); container.innerHTML = `<div class="checkbox-item"><input type="checkbox" id="fullPaper" name="topic" value="8 - @ 5 ? 7 / "><label for="fullPaper">8 - @ 5 ? 7 / (* B 0 M # * > M /  M 0 . )</label></div>`; hindiChapters.forEach((topic, idx) => { const id = `topic${idx}`; container.innerHTML += `<div class="checkbox-item"><input type="checkbox" id="${id}" name="topic" value="${topic}"><label for="${id}">${topic}</label></div>`; }); document.getElementById('fullPaper')?.addEventListener('change', (e) => { const checkboxes = document.querySelectorAll('input[name="topic"]: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 [...hindiChapters]; return Array.from(document.querySelectorAll('input[name="topic"]: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: "( . B ( > * M 0 6 M ( :  C * / > * A (  * M 0 / > 8  0 G  ", 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(" C * / >  - M / > 8  > * M 0  > 0  A ( G  !"); return; } practiceTypeSelection.classList.add('hidden'); chapterSelection.classList.remove('hidden'); loadTopics(); } function showLevelSelection() { selectedTopics = getSelectedTopics(); if(selectedTopics.length === 0) { alert(" C * / >  . 8 G  .   5 ? 7 /  A ( G  !"); 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 '5 ? 7 / > ( A 8 > 0  - M / > 8 (8 > . > ( M / 9 ?  & @ )'; if(type === 'full-length') return '* B 0 M # 2  , >   G 8 M  (UP * A 2 ? 8 9 ?  & @ * H  0 M ( )'; if(type === 'previous-year') return '* ?  2 G 5 0 M 7 K   G * M 0 6 M ( (9 ?  & @ )'; return '8 > . > ( M / 9 ?  & @  - M / > 8 8 G  '; } function generateAssignment() { 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 topicsList = selectedTopics; const mcqs = getRandomQuestions(topicsList, selectedLevel, questionCount); let paperHTML = ` <div class="header" style="background: linear-gradient(135deg, #2c7da0, #1f5068);"> <h2>=ØÖÜ UP * A 2 ? 8  >  8 M  G , 2 8 > . > ( M / 9 ?  & @  - M / > 8 8 G  </h2> <h3>${getPracticeTypeName(selectedPracticeType)}</h3> <p>8 M $ 0 ${selectedLevel} - ${selectedLevel === 1 ? ", A ( ? / > & @ " : selectedLevel === 2 ? ". ' M / . " : "  M  "} | 8 . / : ${timeLimit} . ? (  </p> <p> A 2 * M 0 6 M ( : ${questionCount}</p> </div> <div class="content-area"> <div class="instructions"><p><strong>( ? 0 M & G 6 :</strong></p><ol><li> 8 8 G  . G  ${questionCount} , 9 A 5 ?  2 M * @ / 9 ?  & @ * M 0 6 M ( 9 H  d </li><li>* M 0 $ M / G  * M 0 6 M (  G  > 0 5 ?  2 M * ,  G 5 2   8 9 @ d </li><li>8 . / 8 @ . > : ${timeLimit} . ? (  </li><li>UP * A 2 ? 8  >  8 M  G , 2 * 0 @  M 7 > 9 G $ A 9 ?  & @ - > 7 >  >  - M / > 8 d </li></ol></div> <div class="question-section"><div class="section-heading" style="font-size:1.2rem; font-weight:bold;">8 > . > ( M / 9 ?  & @ * M 0 6 M ( </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"> $ M $ 0  A   @ </h3><table class="answer-table"><thead><tr><th>* M 0 6 M (  M 0 .</th><th> $ M $ 0 </th><th>* M 0 6 M (  M 0 .</th><th> $ M $ 0 </th><th>* M 0 6 M (  M 0 .</th><th> $ M $ 0 </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> * 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> ( / >  - M / > 8 8 G  </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_Police_Hindi_Practice_Set.pdf'); } catch(e) { console.error(e); alert("PDF  ( 0 G 6 ( . G  $ M 0 A  ? "); } 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; </script> </body> </html>