diff --git a/src/views.rs b/src/views.rs index fb0d9bc..15041bf 100644 --- a/src/views.rs +++ b/src/views.rs @@ -1081,6 +1081,15 @@ pub fn result(ctx: &Ctx, user: &str, attempt_id: &str, a: &Analysis, rows: &[Row .collect(); let topic_buckets: Vec = a.by_topic.iter().map(|(b, _)| b.to_owned()).collect(); let neg = rows.iter().filter(|r| !r.correct && !r.selected.trim().is_empty()).count() as i32; + // Encouragement line: tone follows the score, like the ZenithPrep modal. + let pct = fmt_pct(a.score, a.max_score); + let (enc_head, enc_body) = if pct >= 75 { + ("strong paper", "This score shows the chapters you chose are under control. Keep the mistakes tagged so the next paper skips what you already own.") + } else if pct >= 40 { + ("on the right track", "Half the battle is spotting which step broke. Tag the mistakes below and the next paper targets exactly those chapters.") + } else { + ("this is where progress starts", "A low score just maps the work. Tag each mistake below, then rebuild a paper from the weak chapters — the bank has enough PYQs to drill each one.") + }; let body = format!( r##"
+
+ {eh} +

{eb}

+

by subject

{subj}
subjectrightwrongblank%

by difficulty

{diff}
difficultyrightwrongblank%
@@ -1119,6 +1132,8 @@ pub fn result(ctx: &Ctx, user: &str, attempt_id: &str, a: &Analysis, rows: &[Row neg = neg, acc = accuracy(a.right, a.wrong), dur = fmt_dur(a.used_secs), + eh = enc_head, + eb = enc_body, subj = bucket_rows(&a.by_subject), diff = bucket_rows(&a.by_difficulty), topic = bucket_rows(&topic_buckets), diff --git a/static/style.css b/static/style.css index 7b92ce4..7cca4df 100644 --- a/static/style.css +++ b/static/style.css @@ -1315,6 +1315,27 @@ footer { background: #ef4444; } +/* Encouragement card under the overview stats */ +.card.encourage { + margin: 14px 0; + border-left: 3px solid #10b981; + background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), transparent 60%); +} + +.card.encourage b { + display: block; + font-size: 1rem; + margin-bottom: 4px; + color: #ffffff; +} + +.card.encourage p { + margin: 0; + color: var(--text-dim); + font-size: 0.9rem; + line-height: 1.6; +} + /* Result page: sticky left nav + main column (ZenithPrep style) */ .result-layout { display: grid;