Spaces:
Runtime error
Runtime error
Update app.py
Browse files123456784 unmodified lines13141516171819208 unmodified lines29303132333435363738394041424344451 unmodified line4748495051525354555657585960616216 unmodified lines7980818283848586878889909192939495import gradio as grfrom docx import Documentfrom docx.shared import Ptfrom datetime import datetimeimport markdowndef generate_lesson_plan(language, grade, subject, topic, students, duration, teacher_name, date):# --------------------- ENGLISH VERSION ---------------------4 unmodified linessection = doc.sections[0]header = section.header.paragraphs[0]header.text = "School Education Department, Gilgit-Baltistan"header.alignment = 1 # center# Titledoc.add_heading("SMART LESSON PLAN", level=1)doc.add_paragraph(f"Grade Level: {grade}")8 unmodified linesdoc.add_heading("Content to be Delivered", level=2)doc.add_paragraph("Explain the concept of Chemical Bonding by introducing ionic and covalent bonds. ""Use real-life examples like the bonding in NaCl and water molecules. ""Demonstrate through molecular models and guide students to identify the type of bonding in given compounds. ""Conclude with a class discussion to reinforce understanding.")# SLOsdoc.add_heading("SLOs (Student Learning Outcomes)", level=2)doc.add_paragraph("By the end of the lesson, students will be able to:\n""1. Define and differentiate between ionic and covalent bonds.\n""2. Describe examples of both bond types.\n""3. Predict the type of bond formed between given elements.")1 unmodified linedoc.add_heading("Home Assignment", level=2)doc.add_paragraph("1. Write short notes on types of chemical bonds.\n""2. Draw Lewis structures for the following compounds: H₂O, CO₂, NaCl.\n""3. Explain how ionic and covalent bonds contribute to compound stability.\n""4. Align responses with today’s lesson SLOs.")# Feedback Sectiondoc.add_heading("Feedback by the Mentor / Principal", level=2)doc.add_paragraph("\n" * 4) # Four blank lines for manual feedback# Footer (Page number text manually)footer = section.footer.paragraphs[0]footer.text = "Page 1 of 3"footer.alignment = 1 # center16 unmodified lines**تاریخ:** {date}## مواد جو پڑھایا جائے گاکیمیائی بندش کے تصور کو مثالوں کے ذریعے واضح کریں، مثلاً سوڈیم کلورائیڈ اور پانی کے سالمے۔ طلبہ کو مختلف مرکبات میں بندش کی نوعیت پہچاننے کے لیے رہنمائی فراہم کریں۔ سبق کے آخر میں بحث کے ذریعے سمجھ کو مضبوط بنائیں۔## مقاصدِ سبق (SLOs)1. طلبہ آئنک اور کوویلنٹ بندش میں فرق بیان کریں۔2. دونوں اقسام کی مثالیں وضاحت سے پیش کریں۔3. مختلف عناصر کے ملاپ سے بندش کی نوعیت بتائیں۔## گھریلو کام1. بندش کی اقسام پر مختصر نوٹ لکھیں۔2. درج ذیل مرکبات کے لیوس اسٹرکچر بنائیں: H₂O، CO₂، NaCl۔3. وضاحت کریں کہ آئنک اور کوویلنٹ بندش کس طرح مرکب کے استحکام میں مددگار ہیں۔## رائے برائے رہنمائی / پرنسپل کی طرف سے(چار سطور خالی جگہ برائے رائے)12345674 unmodified lines12131415161718198 unmodified lines28293031323334353637383940414243441 unmodified line4647484950515253545556575859606116 unmodified lines7879808182838485868788899091929394import gradio as grfrom docx import Documentfrom datetime import datetimefrom docx.shared import Ptdef generate_lesson_plan(language, grade, subject, topic, students, duration, teacher_name, date):# --------------------- ENGLISH VERSION ---------------------4 unmodified linessection = doc.sections[0]header = section.header.paragraphs[0]header.text = "School Education Department, Gilgit-Baltistan"header.alignment = 1 # center alignment# Titledoc.add_heading("SMART LESSON PLAN", level=1)doc.add_paragraph(f"Grade Level: {grade}")8 unmodified linesdoc.add_heading("Content to be Delivered", level=2)doc.add_paragraph("Explain the concept of Chemical Bonding by introducing ionic and covalent bonds. ""Use real-life examples such as sodium chloride and water molecules. ""Demonstrate bonding through molecular models and guide students to classify compounds. ""Encourage participation and conclude with a question-answer discussion.")# SLOsdoc.add_heading("SLOs (Student Learning Outcomes)", level=2)doc.add_paragraph("By the end of this lesson, students will be able to:\n""1. Define ionic and covalent bonds.\n""2. Identify examples of both bond types.\n""3. Predict the type of bond formed between given elements.")1 unmodified linedoc.add_heading("Home Assignment", level=2)doc.add_paragraph("1. Write short notes on types of chemical bonds.\n""2. Draw Lewis structures for H₂O, CO₂, and NaCl.\n""3. Explain how ionic and covalent bonds stabilize compounds.\n""4. Align your responses with today’s SLOs.")# Feedback Sectiondoc.add_heading("Feedback by the Mentor / Principal", level=2)doc.add_paragraph("\n" * 4) # Four blank lines for manual feedback# Footer (manual text for demonstration)footer = section.footer.paragraphs[0]footer.text = "Page 1 of 3"footer.alignment = 1 # center16 unmodified lines**تاریخ:** {date}## مواد جو پڑھایا جائے گاکیمیائی بندش کے تصور کو سادہ مثالوں سے واضح کریں جیسے سوڈیم کلورائیڈ اور پانی کے سالمے۔ طلبہ کو گروپ سرگرمیوں کے ذریعے بندش کی اقسام پہچاننے کی ترغیب دیں۔ سبق کے آخر میں سوال و جواب کے ذریعے فہم کو جانچیں۔## مقاصدِ سبق (SLOs)1. طلبہ آئنک اور کوویلنٹ بندش میں فرق بیان کریں۔2. دونوں اقسام کی مثالیں پیش کریں۔3. مختلف عناصر کے ملاپ سے بندش کی نوعیت بتائیں۔## گھریلو کام1. بندش کی اقسام پر مختصر نوٹ لکھیں۔2. درج ذیل مرکبات کے لیوس اسٹرکچر بنائیں: H₂O، CO₂، NaCl۔3. وضاحت کریں کہ آئنک اور کوویلنٹ بندش کس طرح مرکب کے استحکام میں مدد دیتی ہیں۔## رائے برائے رہنمائی / پرنسپل کی طرف سے(چار سطور خالی جگہ برائے رائے)
app.py+16-17