* Update the session statistics based on current cards
()
| 375 | * Update the session statistics based on current cards |
| 376 | */ |
| 377 | updateSessionStats() { |
| 378 | if (!this.session || !this.session.cards) return; |
| 379 | |
| 380 | const cards = this.session.cards; |
| 381 | const newCards = cards.filter(card => card.reviewState === 'new').length; |
| 382 | const learningCards = cards.filter(card => |
| 383 | card.reviewState === 'learning' || card.reviewState === 'relearning' |
| 384 | ).length; |
| 385 | const dueCards = cards.filter(card => |
| 386 | card.reviewState === 'review' && new Date(card.nextReviewDate) <= new Date() |
| 387 | ).length; |
| 388 | |
| 389 | this.session.stats = { |
| 390 | new: newCards, |
| 391 | learning: learningCards, |
| 392 | due: dueCards, |
| 393 | total: cards.length |
| 394 | }; |
| 395 | } |
| 396 | |
| 397 | /** |
| 398 | * Format a time interval for display |
no outgoing calls
no test coverage detected