Study cards: from-your-notes, read aloud, timed runs
From your notes: the generator now stores a verbatim source quote with every activity (schema + prompt + a server-side clamp so a chatty model cannot drop a card), and the feedback panel shows the sentence that carries it with the quote highlighted green. Decks made before the change, and quotes the model trimmed, fall back to a local IDF-weighted match over the saved notes text (lib/notes-source.ts): nothing is shown unless at least two distinct terms land. The passage hides in exam mode with the other reveals. Read aloud: a Web Speech API speaker control on the text a learner reads (flashcard faces, questions, statements, sentences, instructions) via lib/speech.ts and components/SpeakButton.tsx — one utterance app-wide, a voice matched to the deck's language, and no button at all where the browser has no speech synthesis. It used to sit inside the flashcard's flip button (nested buttons, tapping it flipped the card); it now lives next to the hint row. Timed runs: the feed chrome carries a timer chip (off by default) that gives each card 30 seconds; a card that runs out is recorded as a miss through the same path as a wrong answer (history + SRS agree), shows a toast, and the feed moves straight on with a fresh budget. handleAnswered ignores a second result per card, so a timeout plus a manual answer cannot record twice. The generator's type spec now names what each type suits (language decks lean on flashcards/matching/fill blank, ordering needs a real sequence, short answer reasoning), so the deck-aware guidance covers all seven types. New activities-test suite (24 checks: quote path, local path, the green mark, the speech stub, the timed run on Playwright's fake clock), registered in run-all; phase2 pins that the notes passage stays hidden in exam mode; en+cs keys for every new string; no new dependencies. Version 0.6.1, SW v83.
This commit is contained in:
parent
786d6cf1ae
commit
796e2e9fe9
26 changed files with 1068 additions and 51 deletions
|
|
@ -535,6 +535,9 @@ const en: Record<string, string> = {
|
|||
"feed.results": "Results",
|
||||
"feed.report": "Report question",
|
||||
"feed.reported": "Question reported — it won't show up again.",
|
||||
"feed.timed": "Timed run · 30s per card",
|
||||
"feed.timedOn": "Timed run on — a card that runs out counts as a miss",
|
||||
"feed.timedOut": "Time's up — the card counts as a miss.",
|
||||
|
||||
/* results --------------------------------------------------------- */
|
||||
"results.perfect": "Perfect freeze! 🧊",
|
||||
|
|
@ -656,6 +659,9 @@ const en: Record<string, string> = {
|
|||
"activity.next": "Next",
|
||||
"activity.correctAnswer": "Correct answer:",
|
||||
"activity.unsupported": "Unsupported activity: {json}",
|
||||
"activity.source": "From your notes",
|
||||
"activity.speak": "Read aloud",
|
||||
"activity.stopSpeaking": "Stop reading",
|
||||
|
||||
/* flashcard ------------------------------------------------------- */
|
||||
"flashcard.tapToFlip": "Tap the card to flip it.",
|
||||
|
|
@ -1524,6 +1530,9 @@ const cs: Record<string, string> = {
|
|||
"feed.prev": "Předchozí aktivita",
|
||||
"feed.next": "Další aktivita",
|
||||
"feed.results": "Výsledky",
|
||||
"feed.timed": "Kolo na čas · 30 s na kartu",
|
||||
"feed.timedOn": "Na čas — kartě, které vyprší čas, se počítá jako chyba",
|
||||
"feed.timedOut": "Čas vypršel — karta se počítá jako chyba.",
|
||||
"feed.report": "Nahlásit otázku",
|
||||
"feed.reported": "Otázka nahlášena — už se neukáže.",
|
||||
|
||||
|
|
@ -1647,6 +1656,9 @@ const cs: Record<string, string> = {
|
|||
"activity.next": "Další",
|
||||
"activity.correctAnswer": "Správná odpověď:",
|
||||
"activity.unsupported": "Nepodporovaná aktivita: {json}",
|
||||
"activity.source": "Z tvých poznámek",
|
||||
"activity.speak": "Přečíst nahlas",
|
||||
"activity.stopSpeaking": "Zastavit čtení",
|
||||
|
||||
/* flashcard ------------------------------------------------------- */
|
||||
"flashcard.tapToFlip": "Klepnutím na kartu ji otočíš.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue