( session: PracticeSessionStats | null, )
| 12 | } |
| 13 | |
| 14 | export const calculateSessionSuccessRate = ( |
| 15 | session: PracticeSessionStats | null, |
| 16 | ): number | null => { |
| 17 | if (!session || session.cards_practiced === 0) return null |
| 18 | return Math.round((session.correct_answers / session.cards_practiced) * 100) |
| 19 | } |
| 20 | |
| 21 | export function calculateLearningTrend( |
| 22 | sessions: PracticeSessionStats[] | undefined, |
no outgoing calls
no test coverage detected