From b7365c0cf409b4d3d15f795d67fc94696c0d189b Mon Sep 17 00:00:00 2001 From: ishiko Date: Sat, 25 Nov 2023 11:17:58 +0800 Subject: [PATCH] Fix/lapses count (#57) * Fix/lapses count in scheduler.ts Ref:https://github.com/open-spaced-repetition/py-fsrs/pull/18 * 3.1.2 --- __tests__/FSRSV4.test.ts | 2 +- example/example.html | 2 +- package.json | 2 +- src/fsrs/default.ts | 2 +- src/fsrs/scheduler.ts | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/__tests__/FSRSV4.test.ts b/__tests__/FSRSV4.test.ts index 7def0e7..b578324 100644 --- a/__tests__/FSRSV4.test.ts +++ b/__tests__/FSRSV4.test.ts @@ -124,7 +124,7 @@ describe("FSRS V4 AC by py-fsrs", () => { expect(stability).toEqual([1.14, 1.01, 5.44, 14.67]); expect(difficulty).toEqual([8.4348, 6.8686, 5.3024, 3.7361999999999993]); expect(reps).toEqual([1, 1, 1, 1]); - expect(lapses).toEqual([1, 0, 0, 0]); + expect(lapses).toEqual([0, 0, 0, 0]); expect(elapsed_days).toEqual([0, 0, 0, 0]); expect(scheduled_days).toEqual([0, 0, 0, 15]); expect(states).toEqual([ diff --git a/example/example.html b/example/example.html index 65ac543..85158a0 100644 --- a/example/example.html +++ b/example/example.html @@ -9,7 +9,7 @@ TS-FSRS example diff --git a/package.json b/package.json index 984d9df..e5b85cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-fsrs", - "version": "3.1.1", + "version": "3.1.2", "description": "ts-fsrs is a TypeScript package used to implement the Free Spaced Repetition Scheduler (FSRS) algorithm. It helps developers apply FSRS to their flashcard applications, thereby improving the user learning experience.", "main": "dist/ts-fsrs.js", "module": "dist/ts-fsrs.mjs", diff --git a/src/fsrs/default.ts b/src/fsrs/default.ts index 94ad32e..eccbf13 100644 --- a/src/fsrs/default.ts +++ b/src/fsrs/default.ts @@ -9,7 +9,7 @@ export const default_w = [ ]; export const default_enable_fuzz = false; -export const FSRSVersion: string = "3.1.1"; +export const FSRSVersion: string = "3.1.2"; export const generatorParameters = ( props?: Partial, diff --git a/src/fsrs/scheduler.ts b/src/fsrs/scheduler.ts index c94f2a8..d93ecab 100644 --- a/src/fsrs/scheduler.ts +++ b/src/fsrs/scheduler.ts @@ -34,7 +34,6 @@ export class SchedulingCard { this.hard.state = State.Learning; this.good.state = State.Learning; this.easy.state = State.Review; - this.again.lapses += 1; } else if (state === State.Learning || state === State.Relearning) { this.again.state = state; this.hard.state = state;