Spaces:
Runtime error
Runtime error
IsaacKerson
commited on
Commit
•
21872f9
1
Parent(s):
8de524c
replace form submit assignment
Browse files- pages/quiz.py +1 -5
pages/quiz.py
CHANGED
@@ -14,6 +14,7 @@ def app():
|
|
14 |
DATABASE = os.path.join(BASE_DIR, DATABASE_NAME)
|
15 |
|
16 |
def form_callback(questions):
|
|
|
17 |
num_correct = 0
|
18 |
session_id = random_session_id()
|
19 |
student_id = 'UKWN'
|
@@ -87,9 +88,4 @@ def app():
|
|
87 |
for q in questions:
|
88 |
st.text_input(f'{q[0] + 1}. {q[3]}', key=q[0], placeholder="Type answer here")
|
89 |
submitted = st.form_submit_button(label="Submit", on_click=form_callback, args=(questions,))
|
90 |
-
if submitted:
|
91 |
-
st.write("Submitted")
|
92 |
-
del st.session_state.tags
|
93 |
-
del st.session_state.num_q
|
94 |
-
del st.session_state.form_submit
|
95 |
|
|
|
14 |
DATABASE = os.path.join(BASE_DIR, DATABASE_NAME)
|
15 |
|
16 |
def form_callback(questions):
|
17 |
+
st.session_state.form_submit = True
|
18 |
num_correct = 0
|
19 |
session_id = random_session_id()
|
20 |
student_id = 'UKWN'
|
|
|
88 |
for q in questions:
|
89 |
st.text_input(f'{q[0] + 1}. {q[3]}', key=q[0], placeholder="Type answer here")
|
90 |
submitted = st.form_submit_button(label="Submit", on_click=form_callback, args=(questions,))
|
|
|
|
|
|
|
|
|
|
|
91 |
|