amkj84 commited on
Commit
4edad20
Β·
verified Β·
1 Parent(s): 215cbc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -3
app.py CHANGED
@@ -1,5 +1,18 @@
1
  import streamlit as st
2
  import time
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  # Page Configurations
5
  st.set_page_config(
@@ -10,8 +23,9 @@ st.set_page_config(
10
  # Title and Description
11
  st.title("🌟 CBT: Digestive System 🌟")
12
  st.write("This Computer-Based Tutorial (CBT) is designed for Class 6 students to learn about the digestive system in a fun and interactive way.")
 
13
 
14
- # Sidebar
15
  st.sidebar.header("Navigation")
16
  sections = ["Introduction", "Organs of the Digestive System", "Process of Digestion", "Quiz"]
17
  selected_section = st.sidebar.radio("Select Section:", sections)
@@ -19,7 +33,7 @@ selected_section = st.sidebar.radio("Select Section:", sections)
19
  if selected_section == "Introduction":
20
  st.header("Introduction")
21
  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.")
22
- 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")
23
  st.balloons()
24
 
25
  elif selected_section == "Organs of the Digestive System":
@@ -89,4 +103,4 @@ elif selected_section == "Quiz":
89
  st.error("❌ Incorrect. The correct answer is 'Pancreas'.")
90
 
91
  st.write("πŸŽ‰ Keep learning and practicing! Great job!")
92
- st.image("https://cdn.pixabay.com/photo/2016/06/15/15/44/school-1457364_960_720.png", caption="Well Done!")
 
1
  import streamlit as st
2
  import time
3
+ from streamlit_lottie import st_lottie
4
+ import requests
5
+
6
+ # Function to load Lottie animations
7
+ def load_lottie_url(url):
8
+ response = requests.get(url)
9
+ if response.status_code != 200:
10
+ return None
11
+ return response.json()
12
+
13
+ # Load Lottie animations
14
+ lottie_digestive_system = load_lottie_url("https://assets9.lottiefiles.com/packages/lf20_4xm9m9ic.json")
15
+ lottie_quiz_complete = load_lottie_url("https://assets8.lottiefiles.com/packages/lf20_s2lryxtd.json")
16
 
17
  # Page Configurations
18
  st.set_page_config(
 
23
  # Title and Description
24
  st.title("🌟 CBT: Digestive System 🌟")
25
  st.write("This Computer-Based Tutorial (CBT) is designed for Class 6 students to learn about the digestive system in a fun and interactive way.")
26
+ st.image("https://upload.wikimedia.org/wikipedia/commons/thumb/e/e5/Digestive_system_diagram_en.svg/1200px-Digestive_system_diagram_en.svg.png", caption="Digestive System Overview")
27
 
28
+ # Sidebar Navigation
29
  st.sidebar.header("Navigation")
30
  sections = ["Introduction", "Organs of the Digestive System", "Process of Digestion", "Quiz"]
31
  selected_section = st.sidebar.radio("Select Section:", sections)
 
33
  if selected_section == "Introduction":
34
  st.header("Introduction")
35
  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.")
36
+ st_lottie(lottie_digestive_system, height=300, key="intro_animation")
37
  st.balloons()
38
 
39
  elif selected_section == "Organs of the Digestive System":
 
103
  st.error("❌ Incorrect. The correct answer is 'Pancreas'.")
104
 
105
  st.write("πŸŽ‰ Keep learning and practicing! Great job!")
106
+ st_lottie(lottie_quiz_complete, height=300, key="quiz_animation")