MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / createPracticeSession

Function createPracticeSession

frontend/src/data/localDB/practiceSessions.ts:35–54  ·  view source on GitHub ↗
(
  collectionId: string,
  totalCards: number,
  now: number,
)

Source from the content-addressed store, hash-verified

33}
34
35async function createPracticeSession(
36 collectionId: string,
37 totalCards: number,
38 now: number,
39): Promise<LocalPracticeSession> {
40 const newSession: LocalPracticeSession = {
41 id: uuidv4(),
42 collectionId,
43 startedAt: now,
44 isCompleted: false,
45 totalCards,
46 cardsPracticed: 0,
47 correctAnswers: 0,
48 createdAt: now,
49 updatedAt: now,
50 synced: false,
51 }
52 await db.practice_sessions.add(newSession)
53 return newSession
54}
55
56async function createPracticeCardsForSession(sessionId: string, cards: LocalCard[]) {
57 const practiceCards: LocalPracticeCard[] = cards.map((card) => ({

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected