Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions assets/academic_ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@
margin: 0 0 1rem;
}
.st-key-dashboard_actions { max-width: 850px; padding: 0 0 1.6rem; }
.st-key-dashboard_actions button {
min-height: 5.3rem !important;
border-radius: 1rem !important;
border-color: #dce7f7 !important;
justify-content: flex-start !important;
padding: 1rem 1.6rem !important;
box-shadow: 0 5px 18px rgba(34,88,160,.035);
}
.st-key-dashboard_actions button p { font-size: 1.15rem !important; font-weight: 700 !important; }
.st-key-dashboard_actions [data-testid="stIconMaterial"] { font-size: 2rem !important; color: #2166db; }
div.st-key-create_course_button { width: 100% !important; margin: 0; }
div.st-key-create_course_button button { max-width: none !important; width: 100% !important; justify-content: flex-start !important; }
div.st-key-create_course_button button > div,
div.st-key-create_course_button button > div > span { justify-content: flex-start !important; }
.st-key-dashboard_overview { margin: .5rem 0 1.5rem; }
:is(.st-key-dashboard_overview, .st-key-progress_overview, .st-key-practice_result_overview) [data-testid="stMetric"] {
background: rgba(255,255,255,.85);
Expand Down Expand Up @@ -132,7 +118,6 @@ div.st-key-create_course_button button > div > span { justify-content: flex-star
[data-testid="stMain"] .exam-hero::after { width: 75%; opacity: .3; }
[data-testid="stMain"] .exam-hero h1 { font-size: clamp(2.15rem, 7vw, 3rem); }
[data-testid="stMain"] .exam-hero p { font-size: 1rem; }
.st-key-dashboard_actions button { min-height: 4.3rem !important; }
}
@media (max-width: 480px) {
:root { --exam-font-page: 2rem; --exam-font-heading: 1.5rem; --exam-font-stat: 1.8rem; }
Expand All @@ -145,16 +130,9 @@ div.st-key-create_course_button button > div > span { justify-content: flex-star
font-size: 1.5rem !important; padding: 0; line-height: 1.25;
}

.st-key-dashboard_actions div.st-key-create_course_button button {
min-height: 5.3rem !important;
}
.st-key-dashboard_actions button > div > span { gap: .8rem !important; }
[class*="st-key-dashboard_course_card_"] [data-testid="stHorizontalBlock"]:has(.academic-course-icon) {
flex-wrap: nowrap;
}
@media (max-width: 768px) {
.st-key-dashboard_actions div.st-key-create_course_button button { min-height: 4.3rem !important; }
}

[class*="st-key-study_topic_"] [data-testid="stCheckbox"] { padding-top: .3rem; }
[class*="st-key-study_topic_"] [data-testid="stHorizontalBlock"] { align-items: flex-start; flex-wrap: nowrap; }
Expand Down
14 changes: 0 additions & 14 deletions assets/paper_shell.css
Original file line number Diff line number Diff line change
Expand Up @@ -724,20 +724,6 @@ label[data-baseweb="radio"]:focus-within {
}


/* Home: "Create course" reads as a quiet card, not a filled block. */
[data-testid="stMain"] .st-key-dashboard_actions div.st-key-create_course_button button {
background: var(--paper-card) !important;
border: 1px solid var(--paper-line) !important;
border-radius: 14px !important;
min-height: 3.6rem !important;
color: var(--ink) !important;
box-shadow: none !important;
}
[data-testid="stMain"] .st-key-dashboard_actions div.st-key-create_course_button button:hover {
background: var(--paper-panel) !important;
border-color: #D9CFC2 !important;
}

/* ---- Loading: a paper plane instead of a spinner --------------------------- */
/* The brand plane (assets/brand-plane.svg), inlined so the sheet stays one file. */
:root {
Expand Down
58 changes: 58 additions & 0 deletions assets/paper_zzzzz_results.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* The Home page inherits exactly the same action palette and shape as study pages. */
[data-testid="stMain"] .st-key-dashboard_actions div.st-key-create_course_button { width: fit-content !important; }
[data-testid="stMain"] .st-key-dashboard_actions button {
min-height: var(--ep-control-height) !important; border-radius: var(--ep-radius-pill) !important;
border: 1px solid var(--ep-border) !important; background: var(--paper-badge) !important;
color: var(--ep-text-primary) !important; padding: .55rem 1.1rem !important;
box-shadow: none; justify-content: center !important;
}
[data-testid="stMain"] .st-key-dashboard_actions button p { font-size: var(--ep-type-body) !important; font-weight: 500 !important; }
[data-testid="stMain"] .st-key-dashboard_actions [data-testid="stIconMaterial"] { font-size: 1.2rem !important; color: inherit !important; }
[data-testid="stMain"] .st-key-dashboard_actions button:hover { background: var(--paper-select) !important; border-color: var(--ep-action) !important; }
/* Results: compact vertical metrics, one central primary action, next step on the right. */
[data-testid="stMain"] .st-key-result_review_action button { min-height: 4rem; font-size: 1.1rem; }
[data-testid="stMain"] .st-key-result_review_action button p { font-size: 1.1rem; font-weight: 600; }
[data-testid="stMain"] .st-key-flight_next_topic h3 { font-size: var(--ep-type-section); }
[data-testid="stMain"] .st-key-practice_result_overview [data-testid="stMetric"] { border: 0; background: transparent; min-height: 0; padding: .6rem .8rem; }
[data-testid="stMain"] .st-key-practice_result_overview [data-testid="stMetricValue"] { font-size: 1.8rem; }
[data-testid="stMain"] .st-key-result_score,
[data-testid="stMain"] .st-key-result_accuracy { background: var(--ep-surface-panel); }
/* Rankings: number, topic, difficulty reasons and student count have separate roles. */
.radar-ranking-scroll { border-radius: var(--ep-radius-panel); padding-inline: .25rem; }
.radar-ranking-scroll ol { display: grid; gap: .5rem; }
.radar-ranking-scroll .radar-ranked-row {
display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto;
grid-template-areas: 'rank topic total' 'rank reasons total';
gap: .35rem .75rem; align-content: center; align-items: center;
border: 1px solid var(--ep-border); border-radius: var(--ep-radius-control);
background: var(--ep-surface-panel); padding: .75rem 1rem; height: 7.5rem;
}
.radar-rank-badge { grid-area: rank; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ep-surface-subtle); color: var(--ep-text-primary); font-weight: 700; }
.radar-rank-title { grid-area: topic; font-size: 1rem; line-height: 1.4; }
.radar-flag-total { grid-area: total; display: grid; place-items: center; min-width: 5rem; padding: .35rem .6rem; border-radius: var(--ep-radius-control); background: var(--ep-surface-subtle); color: var(--ep-text-primary); }
.radar-flag-total b { font-size: 1.4rem; font-weight: 650; line-height: 1.2; }
.radar-flag-total span { font-size: .7rem; }
.radar-reason-chips { grid-area: reasons; display: flex; flex-wrap: wrap; gap: .3rem; }
.radar-reason-chips .radar-reason-chip { display: inline-block; font-size: .75rem; line-height: 1.4; border: 1px solid var(--ep-border); border-radius: var(--ep-radius-pill); padding: .2rem .5rem; color: var(--ep-text-secondary); background: var(--ep-surface-panel); }
/* Five cards plus four gaps, preserving the requested five visible entries. */
.radar-ranking-scroll { max-height: 39.5rem; }
/* One fixed landscape behind both navigation and content; no replacement on collapse. */
[data-testid="stAppViewContainer"] { background: var(--ep-surface-page); background-image: var(--paper-landscape-left), var(--paper-landscape-right); background-repeat: no-repeat; background-position: left bottom, right bottom; background-size: 228px auto, 354px auto; background-attachment: fixed; }
[data-testid="stAppViewContainer"] [data-testid="stMain"] { background-image: none !important; }
[data-testid="stAppViewContainer"] section[data-testid="stSidebar"] { background: transparent; }
.st-key-sidebar_accessibility::before { display: none; }
@media (max-width: 760px) {
[data-testid="stAppViewContainer"] section[data-testid="stSidebar"] { background: var(--ep-surface-page); }
.radar-ranking-scroll .radar-ranked-row { grid-template-columns: 1.5rem minmax(0,1fr) 3.5rem; gap: .3rem .5rem; padding: .5rem; }
.radar-rank-badge { width: 1.5rem; height: 1.5rem; }
.radar-flag-total { min-width: 0; padding: .25rem; }
.radar-reason-chips .radar-reason-chip { font-size: .7rem; }
}
@media (min-width: 1000px) {
[data-testid="stMain"] .st-key-practice_result_overview > [data-testid="stLayoutWrapper"] > [data-testid="stHorizontalBlock"] > [data-testid="stColumn"]:nth-child(1) { flex: 1 1 12rem !important; }
[data-testid="stMain"] .st-key-practice_result_overview > [data-testid="stLayoutWrapper"] > [data-testid="stHorizontalBlock"] > [data-testid="stColumn"]:nth-child(2) { flex: 1.2 1 14rem !important; }
[data-testid="stMain"] .st-key-practice_result_overview > [data-testid="stLayoutWrapper"] > [data-testid="stHorizontalBlock"] > [data-testid="stColumn"]:nth-child(3) { flex: 1.6 1 18rem !important; }
}
@media (max-width: 999px) {
[data-testid="stMain"] .st-key-practice_result_overview > [data-testid="stLayoutWrapper"] > [data-testid="stHorizontalBlock"] > [data-testid="stColumn"] { flex: 1 1 100% !important; width: 100% !important; min-width: 0 !important; }
}
1 change: 1 addition & 0 deletions assets/ui_tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
--ep-space-4: 16px;
--ep-space-6: 24px;
--ep-space-8: 32px;
--ep-radius-pill: 999px;
--ep-radius-control: 10px;
--ep-radius-panel: 16px;
--ep-font-heading: Georgia, "Times New Roman", serif;
Expand Down
20 changes: 15 additions & 5 deletions components/knowledge_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def render_topic_details(

with st.container(key="knowledge_topic_summary"):
st.subheader(tr("Summary"))
st.write(details["summary"])
from services.math_text import write_summary
write_summary(details["summary"])

if course is not None:
if st.button(tr("Detailed explanation & examples"), key="topic_details_open", icon=":material/open_in_new:"):
Expand Down Expand Up @@ -523,11 +524,20 @@ def render_radar_panel(
for code in learning_radar.REASON_LABELS
if item.reasons.get(code, 0) > 0
) if reasons is not None else ""
count_label = tr(radar_count_text(item))
count = item.display_count
badge = (f'<b>{count}</b><span>{html.escape(tr("Students stuck"))}</span>'
if isinstance(count, int) and not isinstance(count, bool)
else html.escape(count_label))
chips = ''.join('<span class="radar-reason-chip">' + html.escape(part) + '</span>'
for part in detail.split(' · ') if part)
rows.append(
'<li class="radar-ranked-row"><strong>'
+ html.escape(f"{index}. {topic_names[item.topic_id]}")
+ '</strong><span>' + html.escape(tr(radar_count_text(item)))
+ '</span><small>' + html.escape(detail) + '</small></li>'
'<li class="radar-ranked-row">'
+ f'<span class="radar-rank-badge" aria-hidden="true">{index}</span>'
+ '<strong class="radar-rank-title">' + html.escape(topic_names[item.topic_id]) + '</strong>'
+ '<span class="radar-flag-total" aria-label="' + html.escape(count_label, quote=True)
+ '">' + badge + '</span>'
+ '<div class="radar-reason-chips">' + chips + '</div></li>'
)
st.html('<div class="radar-ranking-scroll" tabindex="0" role="region" aria-label="'
+ html.escape(tr("Most flagged topics"), quote=True)
Expand Down
9 changes: 5 additions & 4 deletions components/topic_explanation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from models.schemas import StudyPackage
from services.ai_service import ask_tutor
from services.i18n import LANGUAGE_KEY, tr
from services.math_text import write_summary


def render_topic_explanation(course: StudyPackage, topic_id: str) -> None:
Expand All @@ -26,21 +27,21 @@ def render_topic_explanation(course: StudyPackage, topic_id: str) -> None:
steps, worked, mistake = lesson
st.subheader(tr("Step-by-step explanation"))
for number, step in enumerate(steps, 1):
st.write(f"{number}. {step}")
write_summary(f"{number}. {step}")
with st.container(border=True, key="topic_worked_example"):
st.markdown('**' + tr('Worked example') + '**')
st.write(worked)
write_summary(worked)
st.caption(tr('Common mistake') + ': ' + mistake)
elif course.course_id in FILES:
st.subheader(tr("Step-by-step explanation"))
st.write(topic.summary)
write_summary(topic.summary)
first = next((q for q in course.questions if q.topic_id == topic_id), None)
if first:
st.markdown('**' + tr('Worked example') + '**')
st.write(first.question)
st.write(first.explanation)
else:
st.caption(tr("Go beyond the summary: understand the idea, then work through an example."))
help_tip(tr("Go beyond the summary: understand the idea, then work through an example."))
if st.button(tr("Explain step by step"), key=f"graph_explain_{fingerprint}"):
language = "Simplified Chinese" if chinese else "English"
prompt = (
Expand Down
54 changes: 27 additions & 27 deletions data/calculus_i_demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@
],
"learning_state": {
"question_reviews": {
"calc_q004": "pending",
"calc_q004": "approved",
"calc_q005": "pending",
"calc_q006": "pending",
"calc_q007": "pending",
Expand All @@ -1264,7 +1264,7 @@
"calc_q010": "pending",
"calc_q011": "pending",
"calc_q012": "pending",
"calc_q013": "pending",
"calc_q013": "approved",
"calc_q014": "pending",
"calc_q015": "pending",
"calc_q016": "pending",
Expand All @@ -1273,7 +1273,7 @@
"calc_q019": "pending",
"calc_q020": "pending",
"calc_q021": "pending",
"calc_q022": "pending",
"calc_q022": "approved",
"calc_q023": "pending",
"calc_q024": "pending",
"calc_q025": "pending",
Expand All @@ -1282,41 +1282,41 @@
"calc_q028": "pending",
"calc_q029": "pending",
"calc_q030": "pending",
"calc_limit_laws_q01": "pending",
"calc_limit_laws_q02": "pending",
"calc_limit_laws_q01": "approved",
"calc_limit_laws_q02": "approved",
"calc_limit_laws_q03": "pending",
"calc_continuity_q01": "pending",
"calc_continuity_q02": "pending",
"calc_continuity_q01": "approved",
"calc_continuity_q02": "approved",
"calc_continuity_q03": "pending",
"calc_trig_limits_q01": "pending",
"calc_trig_limits_q02": "pending",
"calc_trig_limits_q01": "approved",
"calc_trig_limits_q02": "approved",
"calc_trig_limits_q03": "pending",
"calc_differentiation_rules_q01": "pending",
"calc_differentiation_rules_q02": "pending",
"calc_differentiation_rules_q01": "approved",
"calc_differentiation_rules_q02": "approved",
"calc_differentiation_rules_q03": "pending",
"calc_chain_rule_q01": "pending",
"calc_chain_rule_q02": "pending",
"calc_chain_rule_q01": "approved",
"calc_chain_rule_q02": "approved",
"calc_chain_rule_q03": "pending",
"calc_implicit_differentiation_q01": "pending",
"calc_implicit_differentiation_q02": "pending",
"calc_implicit_differentiation_q01": "approved",
"calc_implicit_differentiation_q02": "approved",
"calc_implicit_differentiation_q03": "pending",
"calc_related_rates_q01": "pending",
"calc_related_rates_q02": "pending",
"calc_related_rates_q01": "approved",
"calc_related_rates_q02": "approved",
"calc_related_rates_q03": "pending",
"calc_mean_value_theorem_q01": "pending",
"calc_mean_value_theorem_q02": "pending",
"calc_mean_value_theorem_q01": "approved",
"calc_mean_value_theorem_q02": "approved",
"calc_mean_value_theorem_q03": "pending",
"calc_curve_sketching_q01": "pending",
"calc_curve_sketching_q02": "pending",
"calc_curve_sketching_q01": "approved",
"calc_curve_sketching_q02": "approved",
"calc_curve_sketching_q03": "pending",
"calc_antiderivatives_q01": "pending",
"calc_antiderivatives_q02": "pending",
"calc_antiderivatives_q01": "approved",
"calc_antiderivatives_q02": "approved",
"calc_antiderivatives_q03": "pending",
"calc_definite_integrals_q01": "pending",
"calc_definite_integrals_q02": "pending",
"calc_definite_integrals_q01": "approved",
"calc_definite_integrals_q02": "approved",
"calc_definite_integrals_q03": "pending",
"calc_fundamental_theorem_q01": "pending",
"calc_fundamental_theorem_q02": "pending",
"calc_fundamental_theorem_q01": "approved",
"calc_fundamental_theorem_q02": "approved",
"calc_fundamental_theorem_q03": "pending"
}
}
Expand Down
6 changes: 3 additions & 3 deletions data/demo_python_basics.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,21 +506,21 @@
],
"learning_state": {
"question_reviews": {
"python-basics-q10": "pending",
"python-basics-q10": "approved",
"python-basics-q11": "pending",
"python-basics-q12": "pending",
"python-basics-q13": "pending",
"python-basics-q14": "pending",
"python-basics-q15": "pending",
"python-basics-q16": "pending",
"python-basics-q17": "pending",
"python-basics-q17": "approved",
"python-basics-q18": "pending",
"python-basics-q19": "pending",
"python-basics-q20": "pending",
"python-basics-q21": "pending",
"python-basics-q22": "pending",
"python-basics-q23": "pending",
"python-basics-q24": "pending",
"python-basics-q24": "approved",
"python-basics-q25": "pending",
"python-basics-q26": "pending",
"python-basics-q27": "pending",
Expand Down
6 changes: 3 additions & 3 deletions data/sample_course.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@
],
"learning_state": {
"question_reviews": {
"q004": "pending",
"q004": "approved",
"q005": "pending",
"q006": "pending",
"q007": "pending",
Expand All @@ -526,7 +526,7 @@
"q010": "pending",
"q011": "pending",
"q012": "pending",
"q013": "pending",
"q013": "approved",
"q014": "pending",
"q015": "pending",
"q016": "pending",
Expand All @@ -535,7 +535,7 @@
"q019": "pending",
"q020": "pending",
"q021": "pending",
"q022": "pending",
"q022": "approved",
"q023": "pending",
"q024": "pending",
"q025": "pending",
Expand Down
Loading
Loading