Spaces:
Runtime error
Runtime error
Commit
·
7158136
1
Parent(s):
c7545c0
added template
Browse files- 0_Introduction.py +15 -10
- pages/1_Step_1.py +3 -1
- pages/2_Step_2.py +4 -1
- pages/3_Congratulations.py +4 -1
- utils/levels.py +3 -2
0_Introduction.py
CHANGED
@@ -1,18 +1,23 @@
|
|
1 |
import streamlit as st
|
2 |
import os
|
3 |
-
from utils import
|
|
|
|
|
4 |
|
5 |
LEVEL=0
|
6 |
|
7 |
-
|
8 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
st.
|
11 |
-
The template is divided into levels, and each level has a set of tasks that you need to complete before you can move on to the next level.
|
12 |
-
You can use this template to create your own tutorial by completing the tasks in each level and adding your own content. You can also use
|
13 |
-
this template to learn how to use AI Eye by completing the tasks in each level.""")
|
14 |
|
15 |
-
st.
|
|
|
16 |
|
17 |
-
|
18 |
-
levels.complete_level(LEVEL)
|
|
|
1 |
import streamlit as st
|
2 |
import os
|
3 |
+
from utils.levels import complete_level, initialize_level, render_page
|
4 |
+
|
5 |
+
initialize_level()
|
6 |
|
7 |
LEVEL=0
|
8 |
|
9 |
+
def intro_page():
|
10 |
+
st.header("AI Eye Tutorial Template")
|
11 |
+
st.subheader("Level 0: Introduction")
|
12 |
+
|
13 |
+
st.write("""Welcome to the AI Eye Tutorial Template! This template is designed to help you create your own AI Eye tutorial.
|
14 |
+
The template is divided into levels, and each level has a set of tasks that you need to complete before you can move on to the next level.
|
15 |
+
You can use this template to create your own tutorial by completing the tasks in each level and adding your own content. You can also use
|
16 |
+
this template to learn how to use AI Eye by completing the tasks in each level.""")
|
17 |
|
18 |
+
st.info(f"Current Level: {levels.get_level()}")
|
|
|
|
|
|
|
19 |
|
20 |
+
if st.button("Complete"):
|
21 |
+
complete_level(LEVEL)
|
22 |
|
23 |
+
render_page(intro_page, LEVEL)
|
|
pages/1_Step_1.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
import streamlit as st
|
2 |
-
from utils.levels import complete_level, render_page
|
3 |
LEVEL = 1
|
4 |
|
|
|
|
|
5 |
def step1_page():
|
6 |
st.header("Step 1")
|
7 |
st.subheader("Level 1: Introduction")
|
|
|
1 |
import streamlit as st
|
2 |
+
from utils.levels import complete_level, render_page, initialize_level
|
3 |
LEVEL = 1
|
4 |
|
5 |
+
initialize_level()
|
6 |
+
|
7 |
def step1_page():
|
8 |
st.header("Step 1")
|
9 |
st.subheader("Level 1: Introduction")
|
pages/2_Step_2.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
import streamlit as st
|
2 |
-
from utils.levels import complete_level, render_page
|
|
|
|
|
|
|
3 |
LEVEL = 2
|
4 |
|
5 |
def step2_page():
|
|
|
1 |
import streamlit as st
|
2 |
+
from utils.levels import complete_level, render_page, initialize_level
|
3 |
+
|
4 |
+
initialize_level()
|
5 |
+
|
6 |
LEVEL = 2
|
7 |
|
8 |
def step2_page():
|
pages/3_Congratulations.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
import streamlit as st
|
2 |
-
from utils.levels import complete_level, render_page
|
|
|
|
|
|
|
3 |
LEVEL = 3
|
4 |
|
5 |
def step1_page():
|
|
|
1 |
import streamlit as st
|
2 |
+
from utils.levels import complete_level, render_page, initialize_level
|
3 |
+
|
4 |
+
initialize_level()
|
5 |
+
|
6 |
LEVEL = 3
|
7 |
|
8 |
def step1_page():
|
utils/levels.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
|
4 |
-
|
|
|
5 |
|
6 |
def get_level():
|
7 |
return st.session_state['level']
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
def initialize_level():
|
4 |
+
if 'level' not in st.session_state:
|
5 |
+
st.session_state['level'] = 0
|
6 |
|
7 |
def get_level():
|
8 |
return st.session_state['level']
|