Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,81 +1,83 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import matplotlib.pyplot as plt
|
| 3 |
-
import numpy as np
|
| 4 |
-
import time
|
| 5 |
|
| 6 |
# Page Configurations
|
| 7 |
st.set_page_config(
|
| 8 |
-
page_title="CBT:
|
| 9 |
layout="centered"
|
| 10 |
)
|
| 11 |
|
| 12 |
# Title and Description
|
| 13 |
-
st.title("CBT:
|
| 14 |
-
st.write("This
|
| 15 |
-
|
| 16 |
-
#
|
| 17 |
-
st.sidebar.header("
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
# Page Configurations
|
| 4 |
st.set_page_config(
|
| 5 |
+
page_title="CBT: Digestive System for Class 6",
|
| 6 |
layout="centered"
|
| 7 |
)
|
| 8 |
|
| 9 |
# Title and Description
|
| 10 |
+
st.title("CBT: Digestive System")
|
| 11 |
+
st.write("This Computer-Based Tutorial (CBT) is designed for Class 6 students to learn about the digestive system in an interactive way.")
|
| 12 |
+
|
| 13 |
+
# Sidebar
|
| 14 |
+
st.sidebar.header("Navigation")
|
| 15 |
+
sections = ["Introduction", "Organs of the Digestive System", "Process of Digestion", "Quiz"]
|
| 16 |
+
selected_section = st.sidebar.radio("Select Section:", sections)
|
| 17 |
+
|
| 18 |
+
if selected_section == "Introduction":
|
| 19 |
+
st.header("Introduction")
|
| 20 |
+
st.write("The digestive system is a group of organs that work together to break down food into smaller parts so the body can use them for energy, growth, and repair.")
|
| 21 |
+
st.image("https://upload.wikimedia.org/wikipedia/commons/thumb/e/e5/Digestive_system_diagram_en.svg/1200px-Digestive_system_diagram_en.svg.png", caption="Diagram of the Digestive System")
|
| 22 |
+
|
| 23 |
+
elif selected_section == "Organs of the Digestive System":
|
| 24 |
+
st.header("Organs of the Digestive System")
|
| 25 |
+
st.write("The digestive system includes the following major organs:")
|
| 26 |
+
st.markdown("""
|
| 27 |
+
- **Mouth**: The starting point of digestion where food is chewed and mixed with saliva.
|
| 28 |
+
- **Esophagus**: A tube that connects the mouth to the stomach.
|
| 29 |
+
- **Stomach**: Breaks down food using acids and enzymes.
|
| 30 |
+
- **Small Intestine**: Absorbs nutrients from food.
|
| 31 |
+
- **Large Intestine**: Absorbs water and forms waste products.
|
| 32 |
+
- **Liver**: Produces bile to help digest fats.
|
| 33 |
+
- **Pancreas**: Produces enzymes that help in digestion.
|
| 34 |
+
- **Rectum and Anus**: Store and eliminate waste.
|
| 35 |
+
""")
|
| 36 |
+
|
| 37 |
+
elif selected_section == "Process of Digestion":
|
| 38 |
+
st.header("Process of Digestion")
|
| 39 |
+
st.write("The process of digestion involves several steps:")
|
| 40 |
+
st.markdown("""
|
| 41 |
+
1. **Ingestion**: Food enters the mouth.
|
| 42 |
+
2. **Propulsion**: Food moves through the esophagus to the stomach.
|
| 43 |
+
3. **Mechanical Digestion**: Food is physically broken down into smaller pieces.
|
| 44 |
+
4. **Chemical Digestion**: Enzymes break down food into simpler molecules.
|
| 45 |
+
5. **Absorption**: Nutrients are absorbed into the bloodstream in the small intestine.
|
| 46 |
+
6. **Elimination**: Waste is eliminated through the rectum and anus.
|
| 47 |
+
""")
|
| 48 |
+
|
| 49 |
+
elif selected_section == "Quiz":
|
| 50 |
+
st.header("Quiz: Test Your Knowledge")
|
| 51 |
+
st.write("Answer the following questions to test your knowledge of the digestive system.")
|
| 52 |
+
|
| 53 |
+
# Question 1
|
| 54 |
+
question1 = st.radio(
|
| 55 |
+
"1. Which organ is responsible for absorbing nutrients from food?",
|
| 56 |
+
("Mouth", "Stomach", "Small Intestine", "Large Intestine")
|
| 57 |
+
)
|
| 58 |
+
if question1 == "Small Intestine":
|
| 59 |
+
st.success("Correct! The small intestine absorbs nutrients from food.")
|
| 60 |
+
elif question1:
|
| 61 |
+
st.error("Incorrect. The correct answer is 'Small Intestine'.")
|
| 62 |
+
|
| 63 |
+
# Question 2
|
| 64 |
+
question2 = st.radio(
|
| 65 |
+
"2. What is the function of bile?",
|
| 66 |
+
("To digest proteins", "To help digest fats", "To break down carbohydrates", "To eliminate waste")
|
| 67 |
+
)
|
| 68 |
+
if question2 == "To help digest fats":
|
| 69 |
+
st.success("Correct! Bile helps in the digestion of fats.")
|
| 70 |
+
elif question2:
|
| 71 |
+
st.error("Incorrect. The correct answer is 'To help digest fats'.")
|
| 72 |
+
|
| 73 |
+
# Question 3
|
| 74 |
+
question3 = st.radio(
|
| 75 |
+
"3. Which organ produces enzymes for digestion?",
|
| 76 |
+
("Liver", "Stomach", "Pancreas", "Esophagus")
|
| 77 |
+
)
|
| 78 |
+
if question3 == "Pancreas":
|
| 79 |
+
st.success("Correct! The pancreas produces enzymes that aid in digestion.")
|
| 80 |
+
elif question3:
|
| 81 |
+
st.error("Incorrect. The correct answer is 'Pancreas'.")
|
| 82 |
+
|
| 83 |
+
st.write("Keep learning and practicing!")
|