From 3529a65fa5b55ead837f8bb1dd5ac0ce98d03fea Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Fri, 6 Dec 2024 12:23:26 +0800 Subject: [PATCH] add State column --- stats.py | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/stats.py b/stats.py index 7a1f95e..8700c6a 100644 --- a/stats.py +++ b/stats.py @@ -120,6 +120,7 @@ def get_steps_stats(self: CollectionStats): + @@ -145,12 +146,27 @@ def get_steps_stats(self: CollectionStats): 5: "good-then-again", 0: "lapse", } + + # Count how many non-lapse ratings we have for rowspan + learning_count = sum(1 for r in ratings.items() if r[0] != 0) + + first_learning = True for rating, style in ratings.items(): stats = results["stats"].get(rating, {}) if not stats: results["stability"][rating] = 86400 + state_cell = "" + if rating == 0: + state_cell = '' + elif first_learning: + state_cell = ( + f'' + ) + first_learning = False + html += f""" + {state_cell} @@ -165,8 +181,18 @@ def get_steps_stats(self: CollectionStats): """ continue + state_cell = "" + if rating == 0: + state_cell = '' + elif first_learning: + state_cell = ( + f'' + ) + first_learning = False + html += f""" + {state_cell} @@ -186,19 +212,19 @@ def get_steps_stats(self: CollectionStats): html += f""" - - -
State First Ratings Delay And Retention Distribution SummaryRelearningLearning
{style.replace('-', ' ').title()} N/A N/A
RelearningLearning
{style.replace('-', ' ').title()} {stats['r1']} {format_time(stats['delay_q1'])}
+ Desired retention:
+ Recommended learning steps:
+ Recommended relearning steps: