Skip to content

Commit

Permalink
add fsrs params to visualizer link (open-spaced-repetition#482)
Browse files Browse the repository at this point in the history
xiety authored Oct 29, 2024

Verified

This commit was signed with the committer’s verified signature.
stgraber Stéphane Graber
1 parent 4c70246 commit 8ae6401
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -202,7 +202,19 @@ def rate_on_ankiweb(did=None):


def visualize_schedule(did=None):
openLink("https://open-spaced-repetition.github.io/anki_fsrs_visualizer/")
deck = mw.col.decks.current()
config = mw.col.decks.get_config(deck["conf"])
retention = config["desiredRetention"]
fsrs_params = (
config["fsrsParams5"]
if "fsrsParams5" in config and len(config["fsrsParams5"]) > 0
else config["fsrsWeights"]
)
fsrs_params_string = ",".join(f"{x:.4f}" for x in fsrs_params)

openLink(
f"https://open-spaced-repetition.github.io/anki_fsrs_visualizer/?w={fsrs_params_string}&m={retention}"
)


menu_visualize = build_action(visualize_schedule, "Visualize Your FSRS Schedule")

0 comments on commit 8ae6401

Please sign in to comment.