igu-algos
v1.0.0
Published
An opinionated collection of classes, types, utils and algos I use to build learning applications.
Downloads
12
Readme
Igu Algos
An opinionated collection of classes, types, utils and algos I use to build learning applications.
Very much Work In Progress. See the full documentation here.
Usage Guide
The Igu class is the main entry point for building learning applications. Here's how to use it:
1. Initialize and Add Data
const igu = new Igu()
// Add your learning goals and exercises
igu.addData(
[
{ id: 'lg1', name: 'Basic Math' },
{ id: 'lg2', name: 'Advanced Math' }
],
[
{
id: 'ex1',
learningGoals: ['lg1'],
learningData: {
isBlacklisted: false,
// ... other FSRS card data
}
}
]
)2. Get Learning Content
You can get learning content in several ways:
// Get a random learning goal
const learningGoal = igu.getRandomLearningGoal()
// Get a random exercise with its associated learning goal
const { exercise, learningGoal } = igu.getRandomExerciseWithLearningGoal()
// Get exercises for a specific learning goal
const exercises = igu.getChildrenExercisesForLearningGoalID('lg1')
// Get a random exercise for a specific learning goal
const exercise = igu.getRandomExerciseFromLearningGoalID('lg1')3. Record Learning Progress
When a user completes an exercise, record their performance:
// Record a learning event (e.g., user rated the exercise as "Good")
const updatedExercise = igu.recordLearningEvent('ex1', Rating.Good)The system uses the FSRS (Free Spaced Repetition Scheduler) algorithm to schedule when exercises should be reviewed next.
Development
- Documentation can now be generated with
npx typedoc
