Sina Media Lab commited on
Commit
217e8f9
·
1 Parent(s): f1969d5
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -165,7 +165,8 @@ if not current_question.get('answered', False):
165
  st.session_state.correct_count += 1
166
  st.session_state.module_correct_count[module_name] += 1
167
 
168
- st.experimental_rerun()
 
169
  else:
170
  for option in current_question['options']:
171
  st.markdown(f"<div style='{get_option_style(option)}'>{option}</div>", unsafe_allow_html=True)
@@ -182,12 +183,10 @@ col1, col2, col3 = st.columns([1, 1, 2])
182
  with col1:
183
  if st.button("⬅️ Prev", disabled=st.session_state.current_index == 0):
184
  navigate_question("prev")
185
- st.experimental_rerun()
186
 
187
  with col2:
188
  if st.button("➡️ Next"):
189
  navigate_question("next")
190
- st.experimental_rerun()
191
 
192
  with col3:
193
  if len(st.session_state.questions) > 0:
 
165
  st.session_state.correct_count += 1
166
  st.session_state.module_correct_count[module_name] += 1
167
 
168
+ # Instead of st.experimental_rerun(), force a refresh by updating a dummy session state variable
169
+ st.session_state.dummy = not st.session_state.get('dummy', False)
170
  else:
171
  for option in current_question['options']:
172
  st.markdown(f"<div style='{get_option_style(option)}'>{option}</div>", unsafe_allow_html=True)
 
183
  with col1:
184
  if st.button("⬅️ Prev", disabled=st.session_state.current_index == 0):
185
  navigate_question("prev")
 
186
 
187
  with col2:
188
  if st.button("➡️ Next"):
189
  navigate_question("next")
 
190
 
191
  with col3:
192
  if len(st.session_state.questions) > 0: