Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -285,4 +285,22 @@ if uploaded_files or manual_input:
|
|
| 285 |
grade = st.selectbox("Select the target grade level:", [f"Grade {i}" for i in range(1, 17)])
|
| 286 |
if st.button("Adapt Lesson"):
|
| 287 |
adapted_lessons = [adapt_lesson_for_grade(chunk, grade) for chunk in text_chunks]
|
| 288 |
-
st.write(f"### Lesson Adapted for {grade
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
grade = st.selectbox("Select the target grade level:", [f"Grade {i}" for i in range(1, 17)])
|
| 286 |
if st.button("Adapt Lesson"):
|
| 287 |
adapted_lessons = [adapt_lesson_for_grade(chunk, grade) for chunk in text_chunks]
|
| 288 |
+
st.write(f"### Lesson Adapted for {grade}")
|
| 289 |
+
st.write("\n\n".join(adapted_lessons))
|
| 290 |
+
elif task == "Generate Conceptual Assignment":
|
| 291 |
+
topic = st.text_input("Enter the topic for assignment generation:")
|
| 292 |
+
if st.button("Generate Assignment"):
|
| 293 |
+
assignments = [generate_assignment(chunk, topic) for chunk in text_chunks]
|
| 294 |
+
assignment_text = "\n\n".join(assignments)
|
| 295 |
+
st.write("### Conceptual Assignment")
|
| 296 |
+
st.write(assignment_text)
|
| 297 |
+
docx_file = save_to_docx(assignment_text)
|
| 298 |
+
st.download_button("Download Assignment as DOCX", docx_file, file_name="assignment.docx", mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document")
|
| 299 |
+
elif task == "Provide Learning Resources":
|
| 300 |
+
topic = st.text_input("Enter the topic for learning resources:")
|
| 301 |
+
if st.button("Generate Resources"):
|
| 302 |
+
resources = provide_learning_resources(topic)
|
| 303 |
+
st.write("### Learning Resources")
|
| 304 |
+
st.write(resources)
|
| 305 |
+
else:
|
| 306 |
+
st.info("Please upload files or enter lesson text to begin.")
|