IsaacKerson commited on
Commit
149f5b0
1 Parent(s): 2610a06

added response table to quiz_maker.db

Browse files
Files changed (2) hide show
  1. pages/quiz_maker.db +0 -0
  2. pages/quiz_new.py +3 -13
pages/quiz_maker.db CHANGED
Binary files a/pages/quiz_maker.db and b/pages/quiz_maker.db differ
 
pages/quiz_new.py CHANGED
@@ -54,18 +54,6 @@ def app():
54
  tag_string = st.session_state.tags
55
  num_q = st.session_state.num_q
56
 
57
- # def clean_string(string):
58
- # return re.sub('[^0-9a-zA-Z\s,]+', '', string)
59
-
60
- # def split_string(string, split_on = ","):
61
- # return [x.strip().upper() for x in string.split(split_on)]
62
-
63
- # def make_subquery(terms, column = 'tags', operator = 'AND'):
64
- # return f' {operator} '.join([f"{column} LIKE '%{x}%'" for x in terms if len(x) > 0])
65
-
66
- # def make_query(subquery, limit = 10):
67
- # return f"""SELECT * FROM vocab WHERE {subquery} ORDER BY RANDOM() LIMIT {str(limit)}"""
68
-
69
  clean_tags = clean_string(tag_string)
70
  terms = split_string(clean_tags)
71
  subquery = make_subquery(terms)
@@ -101,4 +89,6 @@ def app():
101
  st.text_input(f'{q[0] + 1}. {q[3]}', key=q[0], placeholder="Type answer here")
102
  submitted = st.form_submit_button(label="Submit", on_click=form_callback, args=(questions,))
103
  if submitted:
104
- st.write("Submitted")
 
 
 
54
  tag_string = st.session_state.tags
55
  num_q = st.session_state.num_q
56
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  clean_tags = clean_string(tag_string)
58
  terms = split_string(clean_tags)
59
  subquery = make_subquery(terms)
 
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
  if submitted:
92
+ st.write("Submitted")
93
+ del st.session_state.tags
94
+ del st.session_state.num_q