Update app.py
Browse files
app.py
CHANGED
|
@@ -202,13 +202,18 @@ else:
|
|
| 202 |
if st.button("Random Selection"):
|
| 203 |
st.session_state.start_node = random.choice(list(G.nodes))
|
| 204 |
|
| 205 |
-
|
| 206 |
-
start_node = st.number_input(
|
| 207 |
"Enter the starting node ID:",
|
| 208 |
-
value=st.session_state.start_node
|
| 209 |
-
step=1
|
| 210 |
)
|
| 211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
# Input: Student ID
|
| 213 |
student_id = st.text_input("Enter a student ID (optional):", value="")
|
| 214 |
|
|
|
|
| 202 |
if st.button("Random Selection"):
|
| 203 |
st.session_state.start_node = random.choice(list(G.nodes))
|
| 204 |
|
| 205 |
+
start_node = st.text_input(
|
|
|
|
| 206 |
"Enter the starting node ID:",
|
| 207 |
+
value=str(st.session_state.start_node)
|
|
|
|
| 208 |
)
|
| 209 |
|
| 210 |
+
try:
|
| 211 |
+
start_node = int(start_node)
|
| 212 |
+
except ValueError:
|
| 213 |
+
st.error("Please enter a valid numeric content ID.")
|
| 214 |
+
st.stop()
|
| 215 |
+
|
| 216 |
+
|
| 217 |
# Input: Student ID
|
| 218 |
student_id = st.text_input("Enter a student ID (optional):", value="")
|
| 219 |
|