Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -530,57 +530,35 @@ def fetch_student_stage_summary(
|
|
| 530 |
"notable_quotes": notable_quotes,
|
| 531 |
}
|
| 532 |
|
| 533 |
-
|
| 534 |
-
if mongo_uri and student_choice != "(All)" and source_choice != "(All)":
|
| 535 |
-
stage = SOURCE_TO_STAGE.get(source_choice.strip())
|
| 536 |
-
if stage:
|
| 537 |
-
# set to your actual summaries collection name
|
| 538 |
-
summaries_coll_name = "summaries_IFE_2025"
|
| 539 |
-
summary = fetch_student_stage_summary(
|
| 540 |
-
mongo_uri, db_name, summaries_coll_name, coll_name,
|
| 541 |
-
student=student_choice, stage=stage
|
| 542 |
-
)
|
| 543 |
-
if summary:
|
| 544 |
-
st.markdown("---")
|
| 545 |
-
st.subheader(f"Summary β {student_choice} ({stage.replace('_', ' ').title()})")
|
| 546 |
-
c1, c2 = st.columns(2)
|
| 547 |
-
with c1:
|
| 548 |
-
st.markdown(f"**Most Consistent:** {summary.get('most_consistent') or 'β'}")
|
| 549 |
-
st.markdown(f"**Most Developed:** {summary.get('most_developed') or 'β'}")
|
| 550 |
-
with c2:
|
| 551 |
-
strengths = summary.get("top_strengths") or []
|
| 552 |
-
st.markdown("**Top Strengths:** " + (", ".join(strengths) if strengths else "β"))
|
| 553 |
-
|
| 554 |
-
st.markdown("**Notable Quotes:**")
|
| 555 |
-
for q in (summary.get("notable_quotes") or [])[:3]:
|
| 556 |
-
st.markdown(f"> {q}")
|
| 557 |
# # ------------------- Output (Tabs) -------------------
|
| 558 |
-
tab_radar, tab_analyses = st.tabs(["π
|
| 559 |
|
| 560 |
with tab_radar:
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
|
|
|
| 584 |
|
| 585 |
with tab_analyses:
|
| 586 |
st.subheader("Student Analysis (Markdown)")
|
|
|
|
| 530 |
"notable_quotes": notable_quotes,
|
| 531 |
}
|
| 532 |
|
| 533 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 534 |
# # ------------------- Output (Tabs) -------------------
|
| 535 |
+
tab_radar, tab_analyses = st.tabs(["π Summary", "π Analyses"])
|
| 536 |
|
| 537 |
with tab_radar:
|
| 538 |
+
# ---------- Render the summary panel dynamically ----------
|
| 539 |
+
if mongo_uri and student_choice != "(All)" and source_choice != "(All)":
|
| 540 |
+
stage = SOURCE_TO_STAGE.get(source_choice.strip())
|
| 541 |
+
if stage:
|
| 542 |
+
# set to your actual summaries collection name
|
| 543 |
+
summaries_coll_name = "summaries_IFE_2025"
|
| 544 |
+
summary = fetch_student_stage_summary(
|
| 545 |
+
mongo_uri, db_name, summaries_coll_name, coll_name,
|
| 546 |
+
student=student_choice, stage=stage
|
| 547 |
+
)
|
| 548 |
+
if summary:
|
| 549 |
+
st.markdown("---")
|
| 550 |
+
st.subheader(f"Summary β {student_choice} ({stage.replace('_', ' ').title()})")
|
| 551 |
+
c1, c2 = st.columns(2)
|
| 552 |
+
with c1:
|
| 553 |
+
st.markdown(f"**Most Consistent:** {summary.get('most_consistent') or 'β'}")
|
| 554 |
+
st.markdown(f"**Most Developed:** {summary.get('most_developed') or 'β'}")
|
| 555 |
+
with c2:
|
| 556 |
+
strengths = summary.get("top_strengths") or []
|
| 557 |
+
st.markdown("**Top Strengths:** " + (", ".join(strengths) if strengths else "β"))
|
| 558 |
+
|
| 559 |
+
st.markdown("**Notable Quotes:**")
|
| 560 |
+
for q in (summary.get("notable_quotes") or [])[:3]:
|
| 561 |
+
st.markdown(f"> {q}")
|
| 562 |
|
| 563 |
with tab_analyses:
|
| 564 |
st.subheader("Student Analysis (Markdown)")
|