Code Monkey home page Code Monkey logo

ts-fsrs's People

Contributors

2lavine avatar barrelltech avatar dependabot[bot] avatar ishiko732 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ts-fsrs's Issues

Update Example

  • Change console.log to console.table
  • get retrievability

添加显示retrievability数值

我想显示FSRS的DSR数据,通过card.stabilitycard.difficulty可以获得S、D数据。但是R需要使用公式:
$$R(t,S) = 0.9^{\frac{t}{S}}$$
进行计算,对于不熟悉FSRS的人来言可能不知道t,s分别代表什么,希望添加一个函数来获取召回概率。

函数结构希望是:

retrievability = (card: Card, now: dayjs.Dayjs):undefined|string {
    ...
}

又或者提供一个直接显示当前DSR的函数?

invalid date error while using f.repeat function

我在使用ts-fsrs的过程中遇到了invalid date的报错,我试过修改时间的格式,但依旧未能解决这个问题

具体报错如下:
ts-fsrs.js?v=a1e981b4:895 Uncaught (in promise) Error: Invalid date
at x (ts-fsrs.js?v=a1e981b4:895:11)
at Date.diff (ts-fsrs.js?v=a1e981b4:884:10)
at new D (ts-fsrs.js?v=a1e981b4:975:132)
at P.repeat (ts-fsrs.js?v=a1e981b4:1075:15)
at Proxy.getReviewLog (review_mode.vue:110:28)

代码:
import { createEmptyCard, formatDate, generatorParameters, fsrs, Rating, Grades } from "ts-fsrs";

async function getReviewLog(key) {
const now = new Date()
FirstCard.value.due = new Date(formatDate(FirstCard.value.due))
FirstCard.value.lastReview = new Date(formatDate(FirstCard.value.lastReview))
console.log(FirstCard.value)
let scheduling_cards = f.repeat(FirstCard.value, formatDate(now));
let card = scheduling_cards[key].card
let log = scheduling_cards[key].log

传入的参数是:FirstCard.value:
{
"cid": 12,
"nid": 12,
"due": "2024-04-01 21:45:32",
"stability": 0.5701,
"difficulty": 7.5455,
"elapsedDays": 0,
"scheduledDays": 0,
"reps": 1,
"lapses": 0,
"state": 1,
"lastReview": "2024-03-31 17:37:26",
"videoId": "AtChcxeaukQ",
"sid": 35
}

Questions about using cards

First of all huge thanks for making this. I want to ramble about how grateful I am for this library but I’ll just go straight to asking the questions.

I saw the ts-fsrs-demo but I have a really hard time reading code (actually just reading in general) and I tried my best to understand it but I’m still confused about stuff.

If I grade a newly created card “Again” it’s due in 1 minute, is there a way to lower that? For examples to 30 seconds? Because I can’t recall it at all after a minute because I’m actually very dumb.

When am I expected to f.repeat(card, now) the current card, and how do I set the preview times (those things that say 1min, 5min, 1day, 3day)?

I looked into this and I’m currently using f.repeat and getting the next card at the same time when the user presses one of the 4 grade buttons. And I’m setting the preview times before I actually grade the current card by using f.repeat the current card but not setting the card with the results. Am I doing everything correctly?

How do I get a card like anki in a list of cards? Do I get the one with the lowest due date sorted by Review -> Relearning, Learning -> New?

Do I have to store const f = new FSRS() on localStorage with the cards? Does it store any information about the cards? Or do I only have to store the cards?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.