elkay frontend bb game
Browse files
phase/Student_view/games/budgetbuilder.py
CHANGED
|
@@ -7,6 +7,13 @@ from utils import db as dbapi
|
|
| 7 |
|
| 8 |
DISABLE_DB = os.getenv("DISABLE_DB", "1") == "1"
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
def _refresh_global_xp():
|
| 11 |
user = st.session_state.get("user")
|
| 12 |
if not user:
|
|
@@ -473,7 +480,7 @@ def show_budget_builder():
|
|
| 473 |
# Reset the dictionary in session_state too
|
| 474 |
st.session_state.categories = {cid: 0 for cid in categories_master.keys()}
|
| 475 |
st.session_state.level_completed = False
|
| 476 |
-
st.
|
| 477 |
|
| 478 |
|
| 479 |
# Next Level button
|
|
@@ -483,7 +490,7 @@ def show_budget_builder():
|
|
| 483 |
st.session_state.categories = {cid: 0 for cid in categories_master.keys()}
|
| 484 |
st.session_state.level_completed = False
|
| 485 |
st.session_state.bb_start_ts = time.time() # <-- reset timer
|
| 486 |
-
st.
|
| 487 |
|
| 488 |
|
| 489 |
with right_col:
|
|
@@ -555,4 +562,4 @@ def show_budget_builder():
|
|
| 555 |
st.session_state.categories = {cid: 0 for cid in categories_master.keys()}
|
| 556 |
st.session_state.level_completed = False
|
| 557 |
st.session_state.bb_start_ts = time.time() # <-- reset timer
|
| 558 |
-
st.
|
|
|
|
| 7 |
|
| 8 |
DISABLE_DB = os.getenv("DISABLE_DB", "1") == "1"
|
| 9 |
|
| 10 |
+
def _rerun():
|
| 11 |
+
try:
|
| 12 |
+
st.rerun()
|
| 13 |
+
except AttributeError:
|
| 14 |
+
st.experimental_rerun()
|
| 15 |
+
|
| 16 |
+
|
| 17 |
def _refresh_global_xp():
|
| 18 |
user = st.session_state.get("user")
|
| 19 |
if not user:
|
|
|
|
| 480 |
# Reset the dictionary in session_state too
|
| 481 |
st.session_state.categories = {cid: 0 for cid in categories_master.keys()}
|
| 482 |
st.session_state.level_completed = False
|
| 483 |
+
st.rerun()
|
| 484 |
|
| 485 |
|
| 486 |
# Next Level button
|
|
|
|
| 490 |
st.session_state.categories = {cid: 0 for cid in categories_master.keys()}
|
| 491 |
st.session_state.level_completed = False
|
| 492 |
st.session_state.bb_start_ts = time.time() # <-- reset timer
|
| 493 |
+
st.rerun()
|
| 494 |
|
| 495 |
|
| 496 |
with right_col:
|
|
|
|
| 562 |
st.session_state.categories = {cid: 0 for cid in categories_master.keys()}
|
| 563 |
st.session_state.level_completed = False
|
| 564 |
st.session_state.bb_start_ts = time.time() # <-- reset timer
|
| 565 |
+
st.rerun()
|
phase/Student_view/lesson.py
CHANGED
|
@@ -2,7 +2,8 @@ import os
|
|
| 2 |
import re
|
| 3 |
import random
|
| 4 |
import requests
|
| 5 |
-
from typing import List, Dict, Tuple
|
|
|
|
| 6 |
|
| 7 |
import streamlit as st
|
| 8 |
from utils import db as dbapi
|
|
|
|
| 2 |
import re
|
| 3 |
import random
|
| 4 |
import requests
|
| 5 |
+
from typing import List, Dict, Tuple, Optional
|
| 6 |
+
|
| 7 |
|
| 8 |
import streamlit as st
|
| 9 |
from utils import db as dbapi
|