aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/pages/StudyPage.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-01-03 00:33:56 +0900
committernsfisis <nsfisis@gmail.com>2026-01-03 00:43:17 +0900
commit0d56a04d770c2df492ecf59c941e8d90578b0b60 (patch)
treeea62a0096ef03128be2c4f329eaa2d8592019d32 /src/client/pages/StudyPage.tsx
parent66bfde575d973fea9fb26139af421ab5b18c5bea (diff)
downloadkioku-0d56a04d770c2df492ecf59c941e8d90578b0b60.tar.gz
kioku-0d56a04d770c2df492ecf59c941e8d90578b0b60.tar.zst
kioku-0d56a04d770c2df492ecf59c941e8d90578b0b60.zip
feat(study): shuffle cards when starting study session
Cards are now randomized using Fisher-Yates algorithm to improve learning by preventing users from memorizing card order. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/client/pages/StudyPage.tsx')
-rw-r--r--src/client/pages/StudyPage.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/pages/StudyPage.tsx b/src/client/pages/StudyPage.tsx
index 43fd195..b6c9a3b 100644
--- a/src/client/pages/StudyPage.tsx
+++ b/src/client/pages/StudyPage.tsx
@@ -8,6 +8,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Link, useParams } from "wouter";
import { ApiClientError, apiClient } from "../api";
+import { shuffle } from "../utils/shuffle";
import { renderCard } from "../utils/templateRenderer";
interface Card {
@@ -82,7 +83,7 @@ export function StudyPage() {
param: { deckId },
});
const data = await apiClient.handleResponse<{ cards: Card[] }>(res);
- setCards(data.cards);
+ setCards(shuffle(data.cards));
}, [deckId]);
const fetchData = useCallback(async () => {