UPDATE answer button graph tooltip to include I) answer button name and II) description of what "correct" means (#3979)

* 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
This commit is contained in:
GithubAnon0000 2025-05-15 04:54:51 +00:00 committed by GitHub
parent 1c69333210
commit 37dfbca094
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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}<br>${pressedStr}<br>${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})<br>${pressedStr}<br>${correctStr} ${correctStrInfo}`;
}
svg.select("g.hover-columns")