Skip to content

Commit e8ef741

Browse files
committed
clamp displayed skill in [0,1]...
1 parent e7a02cf commit e8ef741

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/db/src/study/SpacedRepetition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function newQuestionInterval(user: DocumentUpdater, cardHistory: CardHistory<Que
3939
}
4040

4141
if (currentAttempt.isCorrect) {
42-
const skill = currentAttempt.performance as number;
42+
const skill = Math.min(1.0, Math.max(0.0, currentAttempt.performance as number));
4343
logger.debug(`Demontrated skill: \t${skill}`);
4444
const interval: number = lastInterval * (0.75 + skill);
4545
cardHistory.lapses = getLapses(cardHistory.records);

0 commit comments

Comments
 (0)