ÿþ<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Class 6 Math Assignment Generator  Ganita Prakash</title> <link href="img/logo1.jpg" rel="icon"> <meta name="description" content="Create free online CBSE Class 6 Math assignments for all Ganita Prakash chapters. Generate printable worksheets instantly for practice and homework."> <meta name="keywords" content="CBSE Class 6 Math online assignment maker, Generate Class 6 Math worksheets online,Free Class 6 Math assignment creator,Class 6 Math practice paper generator, Online Class 6 Math homework maker,Create Class 6 Math assignments instantly,Custom Class 6 Math worksheets online,CBSE Class 6 Math question generator,Ganita Prakash Class 6 online assignments,Generate Ganita Prakash Class 6 Math worksheets,Class 6 Ganita Prakash assignment maker,Ganita Prakash chapter-wise assignment generator,CBSE Class 6 Math assignments Ganita Prakash,Patterns in Mathematics online assignment,Class 6 math patterns worksheet generator,CBSE Class 6 patterns in mathematics online,Lines and Angles online assignment generator,Class 6 geometry worksheet maker,CBSE Class 6 lines and angles online exercises,Number Play assignment generator online,Class 6 number practice worksheet creator,CBSE Class 6 number play exercises online,Data Handling online worksheet generator,Class 6 data presentation assignment maker,CBSE Class 6 charts and graphs assignment online,Prime Time Math worksheet generator,Class 6 prime numbers online assignment,CBSE Class 6 prime number exercises generator,Perimeter and Area online assignment generator,Class 6 geometry worksheet maker,CBSE Class 6 perimeter and area practice online,Fractions assignment generator online,Class 6 fraction practice worksheet creator,CBSE Class 6 fractions online exercises,Constructions worksheet generator online,Class 6 geometric constructions assignment maker,CBSE Class 6 constructions exercises online,Symmetry assignment generator online,Class 6 symmetry worksheet creator,CBSE Class 6 symmetry exercises online,The Other Side of Zero worksheet generator,Class 6 number system online assignment,CBSE Class 6 zero and integers exercises generator,Generate free CBSE Class 6 Math assignments online,Online Class 6 Math practice worksheets for homework,Customizable Class 6 Math assignments for exams,Instant Class 6 Math worksheets generator,CBSE Class 6 chapter-wise Math assignment creator,Create Ganita Prakash Class 6 Math worksheets instantly"> <meta name="robots" content="index, follow"> <meta name="author" content="Routera.in"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Open Graph Tags --> <meta property="og:site_name" content="routera.in"> <meta property="og:title" content="Class 6 Math Assignment Generator  Ganita Prakash"> <meta property="og:description" content="Create free online CBSE Class 6 Math assignments for all Ganita Prakash chapters. Generate printable worksheets instantly for practice and homework."> <meta property="og:image" content="https://www.routera.in/img/cat-2.png"> <!-- Replace with actual image URL --> <meta property="og:image:width" content="600" /> <meta property="og:image:height" content="400" /> <meta property="og:url" content="https://routera.in/cbse-class-6-Mathematics-assignment-generator.html"> <meta property="og:type" content="website"> <!-- Twitter Card Tags --> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:title" content="Class 6 Math Assignment Generator  Ganita Prakash"> <meta name="twitter:description" content="Create free online CBSE Class 6 Math assignments for all Ganita Prakash chapters. Generate printable worksheets instantly for practice and homework."> <meta name="twitter:image" content="https://www.routera.in/img/cat-2.png"> <!-- Replace with actual image URL --> <!-- Canonical Tag --> <link rel="canonical" href="https://routera.in/cbse-class-6-Mathematics-assignment-generator.html" /> <script type="application/ld+json"> [ { "@context": "https://schema.org", "@type": "WebPage", "name": "Class 6 Math Assignment Generator  Ganita Prakash", "url": "https://routera.in/cbse-class-6-Mathematics-assignment-generator.html", "description": "Generate free online CBSE Class 6 Math assignments for all Ganita Prakash chapters. Chapter-wise worksheets and printable exercises included.", "inLanguage": "en" }, { "@context": "https://schema.org", "@type": "WebSite", "name": "Routera.in", "url": "https://routera.in", "potentialAction": { "@type": "SearchAction", "target": "https://routera.in/search?q={search_term_string}", "query-input": "required name=search_term_string" } }, { "@context": "https://schema.org", "@type": "Organization", "name": "Routera", "url": "https://routera.in", "logo": "https://www.routera.in/img/logo1.jpg", "sameAs": [ "https://www.facebook.com/routera", "https://twitter.com/routera", "https://www.linkedin.com/company/routera" ] }, { "@context": "https://schema.org", "@type": "EducationalOrganization", "name": "Routera Educational Resources", "url": "https://routera.in", "logo": "https://www.routera.in/img/logo1.jpg", "address": { "@type": "PostalAddress", "addressLocality": "India" }, "sameAs": [ "https://www.facebook.com/routera", "https://twitter.com/routera" ] }, { "@context": "https://schema.org", "@type": "Review", "itemReviewed": { "@type": "CreativeWork", "name": "Class 6 Math Assignment Generator" }, "reviewRating": { "@type": "Rating", "ratingValue": "4.9", "bestRating": "5" }, "author": { "@type": "Person", "name": "Routera Team" } }, { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://routera.in" }, { "@type": "ListItem", "position": 2, "name": "Math Assignment Generator", "item": "https://routera.in/cbse-class-6-Mathematics-assignment-generator.html" } ] }, { "@context": "https://schema.org", "@type": "Article", "headline": "Class 6 Math Assignment Generator  Ganita Prakash", "author": { "@type": "Person", "name": "Routera Team" }, "publisher": { "@type": "Organization", "name": "Routera", "logo": { "@type": "ImageObject", "url": "https://www.routera.in/img/logo1.jpg" } }, "datePublished": "2025-08-14", "mainEntityOfPage": "https://routera.in/cbse-class-6-Mathematics-assignment-generator.html", "description": "Generate free online CBSE Class 6 Math assignments for all Ganita Prakash chapters. Chapter-wise worksheets and printable exercises included." }, { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "How can I generate Class 6 Math assignments online?", "acceptedAnswer": { "@type": "Answer", "text": "Use the CBSE Class 6 Math assignment generator on Routera.in to create instant worksheets for Ganita Prakash chapters." } }, { "@type": "Question", "name": "Are these worksheets chapter-wise?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, the generator provides chapter-wise worksheets for all 10 chapters from Ganita Prakash." } } ] }, { "@context": "https://schema.org", "@type": "HowTo", "name": "How to generate CBSE Class 6 Math assignments online", "step": [ {"@type": "HowToStep", "text": "Visit the Class 6 Math assignment generator page on Routera.in"}, {"@type": "HowToStep", "text": "Select the desired chapter from Ganita Prakash"}, {"@type": "HowToStep", "text": "Choose number of questions or difficulty level"}, {"@type": "HowToStep", "text": "Click on Generate Worksheet and download or print"} ] }, { "@context": "https://schema.org", "@type": "Product", "name": "Class 6 Math Assignment Generator PDF", "image": "https://www.routera.in/img/cat-2.png", "description": "Generate free CBSE Class 6 Math worksheets online for all chapters of Ganita Prakash.", "brand": "Routera", "offers": { "@type": "Offer", "url": "https://routera.in/cbse-class-6-Mathematics-assignment-generator.html", "price": "0", "priceCurrency": "INR", "availability": "https://schema.org/InStock" } }, { "@context": "https://schema.org", "@type": "Course", "name": "Class 6 Mathematics  Ganita Prakash", "description": "Generate chapter-wise worksheets and assignments for CBSE Class 6 Math using Ganita Prakash.", "provider": { "@type": "EducationalOrganization", "name": "Routera", "sameAs": "https://routera.in" } }, { "@context": "https://schema.org", "@type": "ItemList", "itemListElement": [ {"@type": "ListItem", "position": 1, "name": "Patterns in Mathematics", "url": "https://routera.in/cbse-class-6-Mathematics-assignment-generator.html#chapter1"}, {"@type": "ListItem", "position": 2, "name": "Lines and Angles", "url": "https://routera.in/cbse-class-6-Mathematics-assignment-generator.html#chapter2"} ] }, { "@context": "https://schema.org", "@type": "EducationalOccupationalProgram", "name": "CBSE Class 6 Math Curriculum", "educationalProgramMode": "online", "programPrerequisites": "Class 5 Mathematics knowledge", "provider": { "@type": "EducationalOrganization", "name": "Routera", "sameAs": "https://routera.in" } } ] </script> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4930137336556867" crossorigin="anonymous"></script> <!-- Google tag (gtag.js) --> <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> <!-- Add jsPDF library --> <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: 900px; 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-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 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(200px, 1fr)); gap: 15px; margin: 25px 0; } .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.95rem; } .generated-paper { padding: 30px; } .paper-header { text-align: center; margin-bottom: 30px; border-bottom: 2px solid var(--primary); padding-bottom: 20px; } .paper-header h2 { color: var(--primary-dark); margin-bottom: 5px; font-size: 1.8rem; } .paper-header h3 { color: var(--gray); margin-bottom: 5px; font-size: 1.2rem; font-weight: 500; } .paper-meta { display: flex; justify-content: space-between; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eee; font-weight: 500; } .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; } @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; } .paper-header h2 { font-size: 1.4rem; } .paper-header h3 { font-size: 1rem; } } @media (max-width: 480px) { .header { padding: 20px 15px; } .section-title { font-size: 1.3rem; } .paper-meta { flex-direction: column; gap: 10px; } .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; } } </style> <style> /* Ensure header styling is preserved */ .header { background: linear-gradient(135deg, #4361ee, #3f37c9) !important; color: white !important; padding: 30px 20px !important; text-align: center !important; position: relative !important; overflow: hidden !important; width: 100% !important; } .header h1, .header h2, .header h3 { color: white !important; font-weight: bold !important; } .temp-pdf-container { font-family: Arial, sans-serif; line-height: 1.5; } .temp-pdf-container * { max-width: 100% !important; background-color: white !important; color: black !important; } /* Page break control */ .question { page-break-inside: avoid; break-inside: avoid; } .question-section { page-break-after: auto; } @media print { body { margin: 0 !important; padding: 0 !important; background: white !important; } .container { width: 100% !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; } .header { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; } } /* Home icon styles */ .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); 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; } } </style> </head> <body> <div class="container" id="startContainer"> <div class="header"> <!-- Home icon added here --> <a href="cbse-class-6-to-8-assignment-generator.html" class="home-icon"> <i class="fas fa-home"></i> </a> <h1>Class VI Mathematics</h1> <p>Generate Customized Assignments</p> </div> <div class="content-area"> <div id="startScreen"> <h2 class="section-title">Math Assignment Generator</h2> <div class="btn-group"> <button class="btn btn-primary" onclick="showMathOptions()">Start Generating</button> </div> </div> <div id="mathOptions" class="hidden"> <h2 class="section-title">Select Math Course</h2> <div class="btn-group"> <button class="btn btn-primary" onclick="showChapters()">Mathematics</button> </div> </div> <div id="chapterSelection" class="hidden"> <h2 class="section-title">Select Chapters</h2> <form id="chapterForm"> <div class="checkbox-container"> <div class="checkbox-item"> <input type="checkbox" id="fullPaper" name="chapter" value="Full Paper" onchange="toggleChapters()"> <label for="fullPaper">Full Syllabus (All Chapters)</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter1" name="chapter" value="Chapter 1"> <label for="chapter1">1. Patterns in Mathematics</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter2" name="chapter" value="Chapter 2"> <label for="chapter2">2. Lines and Angles</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter3" name="chapter" value="Chapter 3"> <label for="chapter3">3. Number Play</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter4" name="chapter" value="Chapter 4"> <label for="chapter4">4. Data Handling and Presentation</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter5" name="chapter" value="Chapter 5"> <label for="chapter5">5. Prime Time</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter6" name="chapter" value="Chapter 6"> <label for="chapter6">6. Perimeter and Area</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter7" name="chapter" value="Chapter 7"> <label for="chapter7">7. Fractions</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter8" name="chapter" value="Chapter 8"> <label for="chapter8">8. Playing with Constructions</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter9" name="chapter" value="Chapter 9"> <label for="chapter9">9. Symmetry</label> </div> <div class="checkbox-item"> <input type="checkbox" id="chapter10" name="chapter" value="Chapter 10"> <label for="chapter10">10. The Other Side of Zero</label> </div> </div> </form> <div id="message" class="hidden"></div> <div class="btn-group"> <button class="btn btn-danger" onclick="backToStart()">Back to Start</button> <button class="btn btn-success" onclick="generateAssignment()">Generate Assignment</button> </div> </div> </div> </div> <div class="container hidden" id="generatedPaperContainer"></div> <script> // Initialize jsPDF const { jsPDF } = window.jspdf; const questions = { "Chapter 1": { mcq: [ { question: "What comes next in the pattern: 2, 4, 6, 8, ___?", options: ["9", "10", "12", "14"], answer: "10" }, { question: "Which of these is a geometric pattern?", options: ["1, 3, 5, 7", "2, 4, 8, 16", "5, 10, 15, 20", "All of these"], answer: "2, 4, 8, 16" }, { question: "What is the rule for the pattern: 5, 10, 15, 20?", options: ["Add 3", "Add 5", "Multiply by 2", "Subtract 5"], answer: "Add 5" } ], fillBlank: [ { question: "The next number in the sequence 3, 6, 9, 12, ___ is __________.", answer: "15" }, { question: "In the pattern of shapes ³%, ¡%, Ë%, ³%, ¡%, Ë%, the next shape should be __________.", answer: "³%" } ], trueFalse: [ { question: "All patterns follow mathematical rules.", answer: "True" }, { question: "Patterns can only be made with numbers.", answer: "False" } ], veryShort: [ "Identify the pattern: 10, 20, 30, 40, ___", "Create a simple number pattern with a rule of adding 7" ], short: [ "Explain how to identify a pattern in a sequence of numbers.", "Create a pattern using shapes and describe its rule." ], long: [ "Discuss the importance of patterns in mathematics with examples.", "Create a complex number pattern and explain its rule in detail." ] }, "Chapter 2": { mcq: [ { question: "What is the measure of a right angle?", options: ["45°", "90°", "180°", "360°"], answer: "90°" }, { question: "Which of these is a pair of complementary angles?", options: ["30° and 60°", "45° and 45°", "90° and 90°", "120° and 60°"], answer: "30° and 60°" }, { question: "What do you call two lines that never meet?", options: ["Intersecting lines", "Parallel lines", "Perpendicular lines", "Curved lines"], answer: "Parallel lines" } ], fillBlank: [ { question: "An angle measuring less than 90° is called an __________ angle.", answer: "acute" }, { question: "The sum of angles on a straight line is __________ degrees.", answer: "180" } ], trueFalse: [ { question: "Two right angles make a straight angle.", answer: "True" }, { question: "Parallel lines intersect at a point.", answer: "False" } ], veryShort: [ "Name the angle that measures exactly 180°.", "What is the complement of a 35° angle?" ], short: [ "Explain the difference between perpendicular and parallel lines with examples.", "Draw two complementary angles and show how they add up to 90°." ], long: [ "Discuss different types of angles and their properties with diagrams.", "Explain how angles are used in real-life situations with examples." ] }, "Chapter 3": { mcq: [ { question: "What is the smallest 4-digit number?", options: ["100", "999", "1000", "9999"], answer: "1000" }, { question: "Which of these numbers is divisible by 3?", options: ["124", "135", "148", "157"], answer: "135" }, { question: "What is the place value of 7 in the number 7,654?", options: ["7", "70", "700", "7000"], answer: "7000" } ], fillBlank: [ { question: "The successor of 999 is __________.", answer: "1000" }, { question: "A number is divisible by 5 if it ends with __________ or __________.", answer: "0,5" } ], trueFalse: [ { question: "All even numbers are divisible by 2.", answer: "True" }, { question: "The predecessor of the smallest 4-digit number is 999.", answer: "True" } ], veryShort: [ "Write the expanded form of 3,045.", "Check if 126 is divisible by 3." ], short: [ "Explain the rules for divisibility by 2, 5, and 10 with examples.", "Compare the place values of digits in numbers 5,678 and 7,856." ], long: [ "Discuss the importance of place value in the number system with examples.", "Explain various number patterns and their applications in real life." ] }, "Chapter 4": { mcq: [ { question: "Which of these is a method of data collection?", options: ["Survey", "Observation", "Experiment", "All of these"], answer: "All of these" }, { question: "What type of graph uses bars to represent data?", options: ["Pie chart", "Bar graph", "Line graph", "Pictograph"], answer: "Bar graph" }, { question: "What is the middle value in a set of ordered numbers called?", options: ["Mean", "Median", "Mode", "Range"], answer: "Median" } ], fillBlank: [ { question: "A __________ represents data using pictures or symbols.", answer: "pictograph" }, { question: "The difference between the highest and lowest values in a data set is called __________.", answer: "range" } ], trueFalse: [ { question: "A pie chart shows parts of a whole.", answer: "True" }, { question: "Data can only be represented numerically.", answer: "False" } ], veryShort: [ "Name two ways to represent data visually.", "What is the mode of the numbers: 5, 3, 5, 7, 9, 5?" ], short: [ "Explain how to construct a bar graph from given data.", "Describe the difference between qualitative and quantitative data." ], long: [ "Discuss various methods of data collection and their importance.", "Explain different types of graphs and when each is most appropriate to use." ] }, "Chapter 5": { mcq: [ { question: "Which of these is a prime number?", options: ["1", "4", "11", "15"], answer: "11" }, { question: "What is the HCF of 12 and 18?", options: ["2", "3", "6", "12"], answer: "6" }, { question: "Which of these numbers has exactly three factors?", options: ["4", "9", "16", "25"], answer: "9" } ], fillBlank: [ { question: "The smallest prime number is __________.", answer: "2" }, { question: "Two numbers having only 1 as their common factor are called __________ numbers.", answer: "coprime" } ], trueFalse: [ { question: "1 is a prime number.", answer: "False" }, { question: "All prime numbers are odd.", answer: "False" } ], veryShort: [ "List the prime numbers between 10 and 20.", "Find the LCM of 4 and 6." ], short: [ "Explain the Sieve of Eratosthenes method to find prime numbers.", "Describe how to find HCF using prime factorization." ], long: [ "Discuss the importance of prime numbers in mathematics.", "Explain the concepts of HCF and LCM with real-life applications." ] }, "Chapter 6": { mcq: [ { question: "What is the perimeter of a square with side 5 cm?", options: ["10 cm", "15 cm", "20 cm", "25 cm"], answer: "20 cm" }, { question: "What is the area of a rectangle with length 8 cm and width 3 cm?", options: ["11 cm²", "22 cm²", "24 cm²", "32 cm²"], answer: "24 cm²" }, { question: "Which formula is used to find the area of a triangle?", options: ["½ × base × height", "length × width", "side × side", "À × radius²"], answer: "½ × base × height" } ], fillBlank: [ { question: "The perimeter of a rectangle is calculated as __________ × (length + width).", answer: "2" }, { question: "1 square meter = __________ square centimeters.", answer: "10000" } ], trueFalse: [ { question: "Perimeter is measured in square units.", answer: "False" }, { question: "The area of a square is side × side.", answer: "True" } ], veryShort: [ "Find the perimeter of a triangle with sides 3 cm, 4 cm, and 5 cm.", "Calculate the area of a square with side 7 cm." ], short: [ "Explain the difference between perimeter and area with examples.", "Describe how to find the area of irregular shapes by dividing them into regular shapes." ], long: [ "Discuss real-life applications of perimeter and area calculations.", "Explain how to calculate the area of a parallelogram and relate it to the area of a rectangle." ] }, "Chapter 7": { mcq: [ { question: "What is the equivalent fraction of 1/2 with denominator 10?", options: ["2/10", "5/10", "10/10", "1/10"], answer: "5/10" }, { question: "Which of these fractions is in simplest form?", options: ["2/4", "3/9", "5/8", "6/12"], answer: "5/8" }, { question: "What is 3/4 + 1/4?", options: ["1", "4/8", "4/4", "1/2"], answer: "1" } ], fillBlank: [ { question: "The fraction __________ is equal to 0.5.", answer: "1/2" }, { question: "To add two fractions, they must have the same __________.", answer: "denominator" } ], trueFalse: [ { question: "1/3 is greater than 1/2.", answer: "False" }, { question: "All fractions can be converted to decimals.", answer: "True" } ], veryShort: [ "Simplify the fraction 6/18.", "Convert 3/5 to a decimal." ], short: [ "Explain how to compare two fractions with different denominators.", "Describe the process of adding fractions with unlike denominators." ], long: [ "Discuss different types of fractions and their properties with examples.", "Explain the concept of equivalent fractions and how they are useful in calculations." ] }, "Chapter 8": { mcq: [ { question: "Which tool is used to draw circles?", options: ["Ruler", "Protractor", "Compass", "Set square"], answer: "Compass" }, { question: "What angle is formed when two perpendicular lines intersect?", options: ["30°", "45°", "90°", "180°"], answer: "90°" }, { question: "Which of these is used to measure angles?", options: ["Ruler", "Protractor", "Compass", "Divider"], answer: "Protractor" } ], fillBlank: [ { question: "A __________ is used to draw straight lines.", answer: "ruler" }, { question: "The instrument used to bisect a line segment is __________.", answer: "compass" } ], trueFalse: [ { question: "A set square can be used to draw 60° angles.", answer: "True" }, { question: "A divider is used to measure lengths.", answer: "False" } ], veryShort: [ "Name two instruments used in geometric constructions.", "What angle is formed when a line is bisected perpendicularly?" ], short: [ "Explain how to construct a 60° angle using a compass and ruler.", "Describe the steps to bisect a given line segment." ], long: [ "Discuss the importance of geometric constructions in mathematics.", "Explain the step-by-step process to construct a perpendicular bisector of a line segment." ] }, "Chapter 9": { mcq: [ { question: "How many lines of symmetry does an equilateral triangle have?", options: ["1", "2", "3", "4"], answer: "3" }, { question: "Which letter has both horizontal and vertical symmetry?", options: ["A", "B", "O", "D"], answer: "O" }, { question: "What type of symmetry does the letter 'Z' have?", options: ["Horizontal", "Vertical", "Rotational", "None"], answer: "None" } ], fillBlank: [ { question: "A figure has __________ symmetry if it looks the same after rotation.", answer: "rotational" }, { question: "The number of times a figure matches itself in one full rotation is called its __________.", answer: "order" } ], trueFalse: [ { question: "A rectangle has four lines of symmetry.", answer: "False" }, { question: "All regular polygons have rotational symmetry.", answer: "True" } ], veryShort: [ "How many lines of symmetry does a square have?", "Give an example of a shape with only one line of symmetry." ], short: [ "Explain the difference between line symmetry and rotational symmetry.", "Draw a shape with both horizontal and vertical symmetry." ], long: [ "Discuss the concept of symmetry in nature and man-made objects with examples.", "Explain different types of symmetry with appropriate diagrams." ] }, "Chapter 10": { mcq: [ { question: "What is the sum of a number and its additive inverse?", options: ["0", "1", "The number itself", "Undefined"], answer: "0" }, { question: "Which of these is a negative integer?", options: ["0", "5", "-3", "1/2"], answer: "-3" }, { question: "On the number line, numbers to the left of zero are __________.", options: ["Positive", "Negative", "Zero", "Fractions"], answer: "Negative" } ], fillBlank: [ { question: "The additive inverse of 7 is __________.", answer: "-7" }, { question: "Zero is __________ than all negative integers.", answer: "greater" } ], trueFalse: [ { question: "Negative numbers are used to represent temperatures below zero.", answer: "True" }, { question: "The sum of two negative integers is always positive.", answer: "False" } ], veryShort: [ "Arrange in ascending order: -3, 0, -5, 2", "Find the sum of -8 and 5." ], short: [ "Explain how negative numbers are used in real-life situations.", "Describe the rules for adding and subtracting integers." ], long: [ "Discuss the concept of negative numbers and their importance in mathematics.", "Explain the properties of integers with examples." ] } }; function getRandomQuestions(chapters, type, count) { try { let allQuestions = []; chapters.forEach(chapter => { if (questions[chapter] && questions[chapter][type]) { allQuestions = allQuestions.concat(questions[chapter][type]); } }); allQuestions = allQuestions.sort(() => Math.random() - 0.5); return allQuestions.slice(0, count); } catch (error) { console.error("Error in getRandomQuestions:", error); return []; } } function showMathOptions() { document.getElementById('startScreen').classList.add('hidden'); document.getElementById('mathOptions').classList.remove('hidden'); } function showChapters() { document.getElementById('mathOptions').classList.add('hidden'); document.getElementById('chapterSelection').classList.remove('hidden'); } function toggleChapters() { const fullPaperCheckbox = document.getElementById('fullPaper'); const checkboxes = document.querySelectorAll('input[name="chapter"]:not(#fullPaper)'); checkboxes.forEach(cb => cb.disabled = fullPaperCheckbox.checked); } function backToStart() { document.getElementById('generatedPaperContainer').classList.add('hidden'); document.getElementById('startContainer').classList.remove('hidden'); document.getElementById('chapterSelection').classList.add('hidden'); document.getElementById('startScreen').classList.remove('hidden'); } function generateAssignment() { try { console.log("Generating assignment..."); // Hide start container and show assignment container document.getElementById('startContainer').classList.add('hidden'); const generatedPaperContainer = document.getElementById('generatedPaperContainer'); generatedPaperContainer.classList.remove('hidden'); generatedPaperContainer.innerHTML = ''; // Get selected chapters const selectedChapters = document.getElementById('fullPaper').checked ? Object.keys(questions) : Array.from(document.querySelectorAll('input[name="chapter"]:checked')).map(cb => cb.value); if (selectedChapters.length === 0) { alert("Please select at least one chapter!"); document.getElementById('startContainer').classList.remove('hidden'); return; } console.log("Selected chapters:", selectedChapters); const chapterNames = selectedChapters.map(ch => { if (ch === "Full Paper") return "Full Syllabus"; const label = document.querySelector(`label[for="${ch.toLowerCase()}"]`); return label ? ch + ". " + label.textContent.split(". ")[1] : ch; }).join(", "); console.log("Chapter names:", chapterNames); // Create assignment content let paperContent = ` <div class="header"> <h2>Class VI Mathematics Assignment</h2> <h3>${selectedChapters.length === Object.keys(questions).length ? "Full Syllabus" : chapterNames}</h3> </div> <div class="content-area"> <div class="instructions"> <p><strong>General Instructions:</strong></p> <ol> <li>Complete all questions in your math notebook.</li> <li>Show all your workings clearly.</li> <li>Draw diagrams wherever necessary.</li> <li>Submit the assignment by the due date.</li> <li>Use blue or black ink only.</li> </ol> </div> `; // Get random questions const mcqs = getRandomQuestions(selectedChapters, 'mcq', 10); const fillBlanks = getRandomQuestions(selectedChapters, 'fillBlank', 5); const trueFalse = getRandomQuestions(selectedChapters, 'trueFalse', 5); const veryShort = getRandomQuestions(selectedChapters, 'veryShort', 5); const short = getRandomQuestions(selectedChapters, 'short', 5); const long = getRandomQuestions(selectedChapters, 'long', 5); console.log("Questions retrieved:", { mcqs, fillBlanks, trueFalse, veryShort, short, long }); let questionNumber = 1; // Section A - MCQ paperContent += ` <div class="question-section"> <h4 class="section-heading">Section A - Multiple Choice Questions (1 mark each)</h4> <p>Choose the correct option for each question:</p> `; mcqs.forEach(mcq => { paperContent += ` <div class="question"> <p class="question-text">${questionNumber++}. ${mcq.question}</p> ${mcq.options.map((opt, idx) => `<p class="option">${String.fromCharCode(65 + idx)}. ${opt}</p>` ).join('')} </div> `; }); // Section B - Fill in the blanks paperContent += ` </div> <div class="question-section"> <h4 class="section-heading">Section B - Fill in the Blanks (1 mark each)</h4> <p>Fill in the blanks with appropriate words:</p> `; fillBlanks.forEach(fb => { paperContent += ` <div class="question"> <p class="question-text">${questionNumber++}. ${fb.question}</p> </div> `; }); // Section C - True/False paperContent += ` </div> <div class="question-section"> <h4 class="section-heading">Section C - True/False Questions (1 mark each)</h4> <p>State whether the following statements are True or False:</p> `; trueFalse.forEach(tf => { paperContent += ` <div class="question"> <p class="question-text">${questionNumber++}. ${tf.question}</p> </div> `; }); // Section D - Very Short Questions paperContent += ` </div> <div class="question-section"> <h4 class="section-heading">Section D - Very Short Answer Questions (2 marks each)</h4> `; veryShort.forEach(q => { paperContent += ` <div class="question"> <p class="question-text">${questionNumber++}. ${q}</p> </div> `; }); // Section E - Short Questions paperContent += ` </div> <div class="question-section"> <h4 class="section-heading">Section E - Short Answer Questions (3 marks each)</h4> `; short.forEach(q => { paperContent += ` <div class="question"> <p class="question-text">${questionNumber++}. ${q}</p> </div> `; }); // Section F - Long Questions paperContent += ` </div> <div class="question-section"> <h4 class="section-heading">Section F - Long Answer Questions (5 marks each)</h4> `; long.forEach(q => { paperContent += ` <div class="question"> <p class="question-text">${questionNumber++}. ${q}</p> </div> `; }); // Add buttons below the generated paper paperContent += ` </div> <div class="action-buttons"> <button class="btn btn-primary" onclick="downloadPDF()">Download as PDF</button> <button class="btn btn-success" onclick="window.print()">Print</button> <button class="btn btn-danger" onclick="backToStart()">Back to Start</button> </div> </div> `; console.log("Final paper content generated"); generatedPaperContainer.innerHTML = paperContent; console.log("Assignment generated successfully"); } catch (error) { console.error("Error generating assignment:", error); alert("An error occurred while generating the assignment. Please check the console for details."); backToStart(); } } async function downloadPDF() { const element = document.getElementById('generatedPaperContainer'); // Create a temporary div with optimized settings const tempDiv = document.createElement('div'); tempDiv.style.position = 'absolute'; tempDiv.style.left = '-9999px'; tempDiv.style.width = '794px'; // A4 width in pVIIIels (210mm) 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; // 0.5" margins const pageHeight = pdf.internal.pageSize.getHeight() - 25.4; // Split content into pages let position = 12.7; // Start with 0.5" top margin let remainingHeight = tempDiv.scrollHeight; let pageNum = 1; while (remainingHeight > 0) { // Capture the current page section const canvas = await html2canvas(tempDiv, { scale: 2, windowHeight: pageHeight * 3.78, // mm to px windowWidth: pageWidth * 3.78, y: position * 3.78, // mm to px height: pageHeight * 3.78, useCORS: true, backgroundColor: '#ffffff', logging: false }); const imgData = canvas.toDataURL('image/jpeg', 0.92); // Add page to PDF 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; // px pageNum++; } // Save PDF pdf.save('Class_6_Math_Assignment.pdf'); console.log("PDF saved successfully"); } catch (error) { console.error('PDF generation error:', error); alert('Error generating PDF. Please check the console for details.'); // Remove temporary div if it exists const tempDiv = document.querySelector('.temp-pdf-container'); if (tempDiv) { document.body.removeChild(tempDiv); } } } </script> </body> </html>