Flashcard
Flashcard Widget for Marimo
FlashcardWidget
Bases: BaseWidget
A flashcard widget with self-reported spaced repetition.
Students flip cards to reveal the answer, then rate themselves (Got it / Almost / No). Cards rated "Almost" or "No" are re-inserted into the queue; the deck is complete when all cards are rated "Got it".
Attributes:
| Name | Type | Description |
|---|---|---|
question |
str
|
Optional heading shown above the deck |
cards |
list
|
List of dicts with 'front' and 'back' keys |
shuffle |
bool
|
Whether to shuffle the deck initially |
value |
dict
|
State with 'results' (per-card ratings/attempts) and 'complete' |
Source code in src/marimo_learn/flashcard.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
Example
