From 37dfbca094241b1a5ed3f0130570f309be58dd75 Mon Sep 17 00:00:00 2001 From: GithubAnon0000 <160563432+GithubAnon0000@users.noreply.github.com> Date: Thu, 15 May 2025 04:54:51 +0000 Subject: [PATCH] UPDATE answer button graph tooltip to include I) answer button name and II) description of what "correct" means (#3979) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ADD name of the button after button number (1 → again...) * ADD info string to explain what 'correct' means * Run ./check and make it happy * Apply suggestion from @dae to make text shorter --- ftl/core/statistics.ftl | 1 + ts/routes/graphs/buttons.ts | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ftl/core/statistics.ftl b/ftl/core/statistics.ftl index 0464e0f0b..c3a2bb613 100644 --- a/ftl/core/statistics.ftl +++ b/ftl/core/statistics.ftl @@ -229,6 +229,7 @@ statistics-stability-day-single = # hour range, eg "From 14:00-15:00" statistics-hours-range = From { $hourStart }:00~{ $hourEnd }:00 statistics-hours-correct = { $correct }/{ $total } correct ({ $percent }%) +statistics-hours-correct-info = → (not 'Again') # the emoji depicts the graph displaying this number statistics-hours-reviews = 📊 { $reviews } reviews # the emoji depicts the graph displaying this number diff --git a/ts/routes/graphs/buttons.ts b/ts/routes/graphs/buttons.ts index 565ec492a..606380590 100644 --- a/ts/routes/graphs/buttons.ts +++ b/ts/routes/graphs/buttons.ts @@ -222,8 +222,23 @@ export function renderButtons( const button = tr.statisticsAnswerButtonsButtonNumber(); const timesPressed = tr.statisticsAnswerButtonsButtonPressed(); const correctStr = tr.statisticsHoursCorrect(totalCorrect(d.group)); + const correctStrInfo = tr.statisticsHoursCorrectInfo(); const pressedStr = `${timesPressed}: ${totalPressedStr(d)}`; - return `${button}: ${d.buttonNum}
${pressedStr}
${correctStr}`; + + let buttonText: string; + if (d.buttonNum === 1) { + buttonText = tr.studyingAgain(); + } else if (d.buttonNum === 2) { + buttonText = tr.studyingHard(); + } else if (d.buttonNum === 3) { + buttonText = tr.studyingGood(); + } else if (d.buttonNum === 4) { + buttonText = tr.studyingEasy(); + } else { + buttonText = ""; + } + + return `${button}: ${d.buttonNum} (${buttonText})
${pressedStr}
${correctStr} ${correctStrInfo}`; } svg.select("g.hover-columns")