Navya-Sree commited on
Commit
9af805a
·
verified ·
1 Parent(s): 62bb808

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -578,7 +578,8 @@ elif menu == "Learn":
578
 
579
  with col2:
580
  if st.button(f"View Mind Map", key=f"mindmap_{module_name}"):
581
- st.session_state.mind_maps[module_name] = module_info['topics']
 
582
 
583
  with col3:
584
  if st.button(f"Take Quiz", key=f"quiz_{module_name}"):
@@ -635,7 +636,7 @@ elif menu == "Practice":
635
 
636
  with col3:
637
  if st.button("View Solution"):
638
- st.code(challenge["solution"])
639
 
640
  elif menu == "Projects":
641
  st.markdown("<h1 class='main-header'>🛠️ Hands-on Projects</h1>", unsafe_allow_html=True)
@@ -1045,7 +1046,8 @@ elif menu == "Mind Maps":
1045
  if new_map_topic and new_concepts:
1046
  concepts_dict = {concept.strip(): f"Description of {concept.strip()}"
1047
  for concept in new_concepts.split(",")}
1048
- st.session_state.mind_maps[new_map_topic] = concepts_dict
 
1049
  st.success("Mind map created!")
1050
 
1051
  with col2:
@@ -1054,9 +1056,10 @@ elif menu == "Mind Maps":
1054
  fig = create_mind_map(selected_map, MIND_MAP_DB[selected_map])
1055
  st.plotly_chart(fig, use_container_width=True)
1056
 
1057
- if st.session_state.mind_maps:
 
1058
  st.markdown("### 🗂️ Your Custom Maps")
1059
- for topic, concepts in st.session_state.mind_maps.items():
1060
  with st.expander(topic):
1061
  fig = create_mind_map(topic, concepts)
1062
  st.plotly_chart(fig, use_container_width=True)
 
578
 
579
  with col2:
580
  if st.button(f"View Mind Map", key=f"mindmap_{module_name}"):
581
+ # Fixed: Store under user_progress
582
+ st.session_state.user_progress['mind_maps'][module_name] = module_info['topics']
583
 
584
  with col3:
585
  if st.button(f"Take Quiz", key=f"quiz_{module_name}"):
 
636
 
637
  with col3:
638
  if st.button("View Solution"):
639
+ st.code(challenge['solution'])
640
 
641
  elif menu == "Projects":
642
  st.markdown("<h1 class='main-header'>🛠️ Hands-on Projects</h1>", unsafe_allow_html=True)
 
1046
  if new_map_topic and new_concepts:
1047
  concepts_dict = {concept.strip(): f"Description of {concept.strip()}"
1048
  for concept in new_concepts.split(",")}
1049
+ # Fixed: Store under user_progress
1050
+ st.session_state.user_progress['mind_maps'][new_map_topic] = concepts_dict
1051
  st.success("Mind map created!")
1052
 
1053
  with col2:
 
1056
  fig = create_mind_map(selected_map, MIND_MAP_DB[selected_map])
1057
  st.plotly_chart(fig, use_container_width=True)
1058
 
1059
+ # Fixed: Access through user_progress
1060
+ if st.session_state.user_progress['mind_maps']:
1061
  st.markdown("### 🗂️ Your Custom Maps")
1062
+ for topic, concepts in st.session_state.user_progress['mind_maps'].items():
1063
  with st.expander(topic):
1064
  fig = create_mind_map(topic, concepts)
1065
  st.plotly_chart(fig, use_container_width=True)