@vue-skuilder/db 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11315,7 +11315,7 @@ var ResponseProcessor = class {
11315
11315
  const nullTags = tagKeys.filter((k) => taggedPerformance[k] === null);
11316
11316
  const scoredTags = tagKeys.filter((k) => taggedPerformance[k] !== null);
11317
11317
  logger.info(
11318
- `[ResponseProcessor] per-tag ELO update for ${cardId}: scored=[${scoredTags.join(", ")}] count-only=[${nullTags.join(", ")}]`
11318
+ `[FirstContactElo] correct first-attempt per-tag ELO update for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps}): scored=[${scoredTags.join(", ")}] count-only=[${nullTags.join(", ")}]`
11319
11319
  );
11320
11320
  void this.eloService.updateUserAndCardEloPerTag(
11321
11321
  taggedPerformance,
@@ -11346,7 +11346,7 @@ var ResponseProcessor = class {
11346
11346
  );
11347
11347
  }
11348
11348
  logger.info(
11349
- "[ResponseProcessor] Processed correct response with SRS scheduling and ELO update"
11349
+ `[FirstContactElo] correct first-attempt ELO update (score=${userScore.toFixed(3)}) for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
11350
11350
  );
11351
11351
  }
11352
11352
  return {
@@ -11375,7 +11375,8 @@ var ResponseProcessor = class {
11375
11375
  */
11376
11376
  processIncorrectResponse(cardRecord, history, courseRegistrationDoc, currentCard, courseId, cardId, maxAttemptsPerView, maxSessionViews, sessionViews) {
11377
11377
  const { taggedPerformance } = this.parsePerformance(cardRecord.performance);
11378
- if (history.records.length !== 1 && cardRecord.priorAttemps === 0) {
11378
+ let eloUpdated = false;
11379
+ if (cardRecord.priorAttemps === 0) {
11379
11380
  if (taggedPerformance) {
11380
11381
  void this.eloService.updateUserAndCardEloPerTag(
11381
11382
  taggedPerformance,
@@ -11385,7 +11386,7 @@ var ResponseProcessor = class {
11385
11386
  currentCard
11386
11387
  );
11387
11388
  logger.info(
11388
- `[ResponseProcessor] Processed incorrect response with per-tag ELO update (${Object.keys(taggedPerformance).length - 1} tags)`
11389
+ `[FirstContactElo] incorrect first-attempt per-tag ELO update for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps}, tags=${Object.keys(taggedPerformance).length - 1})`
11389
11390
  );
11390
11391
  } else {
11391
11392
  void this.eloService.updateUserAndCardElo(
@@ -11396,28 +11397,42 @@ var ResponseProcessor = class {
11396
11397
  courseRegistrationDoc,
11397
11398
  currentCard
11398
11399
  );
11399
- logger.info("[ResponseProcessor] Processed incorrect response with ELO update");
11400
+ logger.info(
11401
+ `[FirstContactElo] incorrect first-attempt ELO update (score=0) for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
11402
+ );
11400
11403
  }
11404
+ eloUpdated = true;
11401
11405
  } else {
11402
- logger.info("[ResponseProcessor] Processed incorrect response (no ELO update needed)");
11406
+ logger.info(
11407
+ `[FirstContactElo] incorrect retry \u2014 no ELO update for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
11408
+ );
11403
11409
  }
11404
11410
  if (currentCard.records.length >= maxAttemptsPerView) {
11405
11411
  if (sessionViews >= maxSessionViews) {
11406
- if (taggedPerformance) {
11407
- void this.eloService.updateUserAndCardEloPerTag(
11408
- taggedPerformance,
11409
- courseId,
11410
- cardId,
11411
- courseRegistrationDoc,
11412
- currentCard
11412
+ if (!eloUpdated) {
11413
+ if (taggedPerformance) {
11414
+ void this.eloService.updateUserAndCardEloPerTag(
11415
+ taggedPerformance,
11416
+ courseId,
11417
+ cardId,
11418
+ courseRegistrationDoc,
11419
+ currentCard
11420
+ );
11421
+ } else {
11422
+ void this.eloService.updateUserAndCardElo(
11423
+ 0,
11424
+ courseId,
11425
+ cardId,
11426
+ courseRegistrationDoc,
11427
+ currentCard
11428
+ );
11429
+ }
11430
+ logger.info(
11431
+ `[FirstContactElo] dismiss-failed final ELO penalty for ${cardId} (historyLen=${history.records.length}, sessionViews=${sessionViews})`
11413
11432
  );
11414
11433
  } else {
11415
- void this.eloService.updateUserAndCardElo(
11416
- 0,
11417
- courseId,
11418
- cardId,
11419
- courseRegistrationDoc,
11420
- currentCard
11434
+ logger.info(
11435
+ `[FirstContactElo] dismiss-failed \u2014 ELO already updated this response, skipping double penalty for ${cardId}`
11421
11436
  );
11422
11437
  }
11423
11438
  return {