MCPcopy Create free account
hub / github.com/JamesAC42/hanbok / updateSessionStats

Method updateSessionStats

app/src/lib/studySessionManager.js:377–395  ·  view source on GitHub ↗

* Update the session statistics based on current cards

()

Source from the content-addressed store, hash-verified

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

Callers 2

handleCardRatingMethod · 0.95
fetchDeckDetailsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected