BillBojangeles2000 commited on
Commit
db212dc
·
1 Parent(s): c30dd36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -123,14 +123,16 @@ class SubjectiveTest:
123
 
124
  questions = []
125
 
126
- for entity_label, entity_questions in question_answer_dict.items():
127
  entity_questions = entity_questions[:self.noOfQues]
128
  questions.extend(entity_questions)
129
 
130
  return questions
131
 
132
- # Create a button to initiate quiz generation
133
- generate_quiz = st.button("Generate Quiz")
 
 
134
 
135
  if generate_quiz:
136
  st.write("Generating the quiz...")
@@ -147,7 +149,7 @@ if generate_quiz:
147
  res = st.text_input(f'Q{i + 1}: {question}')
148
  answers[f'Q{i + 1}'] = res
149
 
150
- if st.button("Submit"):
151
  scores = []
152
  client = Client("https://billbojangeles2000-zephyr-7b-alpha-chatbot-karki.hf.space/")
153
 
 
123
 
124
  questions = []
125
 
126
+ for entity_label, entity_questions in question_answer_dict.items:
127
  entity_questions = entity_questions[:self.noOfQues]
128
  questions.extend(entity_questions)
129
 
130
  return questions
131
 
132
+ # Use st.form to encapsulate the quiz generation and submission
133
+ with st.form("quiz_form"):
134
+ # Create a button to initiate quiz generation
135
+ generate_quiz = st.form_submit_button("Generate Quiz")
136
 
137
  if generate_quiz:
138
  st.write("Generating the quiz...")
 
149
  res = st.text_input(f'Q{i + 1}: {question}')
150
  answers[f'Q{i + 1}'] = res
151
 
152
+ if st.form_submit_button("Submit"):
153
  scores = []
154
  client = Client("https://billbojangeles2000-zephyr-7b-alpha-chatbot-karki.hf.space/")
155