Skip to content

Commit

Permalink
Fix/lapses count (#57)
Browse files Browse the repository at this point in the history
* Fix/lapses count in scheduler.ts

Ref:open-spaced-repetition/py-fsrs#18

* 3.1.2
  • Loading branch information
ishiko732 authored Nov 25, 2023
1 parent e09c6ac commit b7365c0
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion __tests__/FSRSV4.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion example/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>
<script type="module">
import * as tsFsrs from 'https://cdn.jsdelivr.net/npm/ts-fsrs@3.1.0-beta8/+esm';
import * as tsFsrs from 'https://cdn.jsdelivr.net/npm/ts-fsrs@3.1.2/+esm';
window.tsfsrs = tsFsrs
</script>
<title>TS-FSRS example</title>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/fsrs/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<FSRSParameters>,
Expand Down
1 change: 0 additions & 1 deletion src/fsrs/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b7365c0

Please sign in to comment.