@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 +34 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/study/services/ResponseProcessor.ts +56 -22
package/dist/index.mjs
CHANGED
|
@@ -11203,7 +11203,7 @@ var ResponseProcessor = class {
|
|
|
11203
11203
|
const nullTags = tagKeys.filter((k) => taggedPerformance[k] === null);
|
|
11204
11204
|
const scoredTags = tagKeys.filter((k) => taggedPerformance[k] !== null);
|
|
11205
11205
|
logger.info(
|
|
11206
|
-
`[
|
|
11206
|
+
`[FirstContactElo] correct first-attempt per-tag ELO update for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps}): scored=[${scoredTags.join(", ")}] count-only=[${nullTags.join(", ")}]`
|
|
11207
11207
|
);
|
|
11208
11208
|
void this.eloService.updateUserAndCardEloPerTag(
|
|
11209
11209
|
taggedPerformance,
|
|
@@ -11234,7 +11234,7 @@ var ResponseProcessor = class {
|
|
|
11234
11234
|
);
|
|
11235
11235
|
}
|
|
11236
11236
|
logger.info(
|
|
11237
|
-
|
|
11237
|
+
`[FirstContactElo] correct first-attempt ELO update (score=${userScore.toFixed(3)}) for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
|
|
11238
11238
|
);
|
|
11239
11239
|
}
|
|
11240
11240
|
return {
|
|
@@ -11263,7 +11263,8 @@ var ResponseProcessor = class {
|
|
|
11263
11263
|
*/
|
|
11264
11264
|
processIncorrectResponse(cardRecord, history, courseRegistrationDoc, currentCard, courseId, cardId, maxAttemptsPerView, maxSessionViews, sessionViews) {
|
|
11265
11265
|
const { taggedPerformance } = this.parsePerformance(cardRecord.performance);
|
|
11266
|
-
|
|
11266
|
+
let eloUpdated = false;
|
|
11267
|
+
if (cardRecord.priorAttemps === 0) {
|
|
11267
11268
|
if (taggedPerformance) {
|
|
11268
11269
|
void this.eloService.updateUserAndCardEloPerTag(
|
|
11269
11270
|
taggedPerformance,
|
|
@@ -11273,7 +11274,7 @@ var ResponseProcessor = class {
|
|
|
11273
11274
|
currentCard
|
|
11274
11275
|
);
|
|
11275
11276
|
logger.info(
|
|
11276
|
-
`[
|
|
11277
|
+
`[FirstContactElo] incorrect first-attempt per-tag ELO update for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps}, tags=${Object.keys(taggedPerformance).length - 1})`
|
|
11277
11278
|
);
|
|
11278
11279
|
} else {
|
|
11279
11280
|
void this.eloService.updateUserAndCardElo(
|
|
@@ -11284,28 +11285,42 @@ var ResponseProcessor = class {
|
|
|
11284
11285
|
courseRegistrationDoc,
|
|
11285
11286
|
currentCard
|
|
11286
11287
|
);
|
|
11287
|
-
logger.info(
|
|
11288
|
+
logger.info(
|
|
11289
|
+
`[FirstContactElo] incorrect first-attempt ELO update (score=0) for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
|
|
11290
|
+
);
|
|
11288
11291
|
}
|
|
11292
|
+
eloUpdated = true;
|
|
11289
11293
|
} else {
|
|
11290
|
-
logger.info(
|
|
11294
|
+
logger.info(
|
|
11295
|
+
`[FirstContactElo] incorrect retry \u2014 no ELO update for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
|
|
11296
|
+
);
|
|
11291
11297
|
}
|
|
11292
11298
|
if (currentCard.records.length >= maxAttemptsPerView) {
|
|
11293
11299
|
if (sessionViews >= maxSessionViews) {
|
|
11294
|
-
if (
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11300
|
+
if (!eloUpdated) {
|
|
11301
|
+
if (taggedPerformance) {
|
|
11302
|
+
void this.eloService.updateUserAndCardEloPerTag(
|
|
11303
|
+
taggedPerformance,
|
|
11304
|
+
courseId,
|
|
11305
|
+
cardId,
|
|
11306
|
+
courseRegistrationDoc,
|
|
11307
|
+
currentCard
|
|
11308
|
+
);
|
|
11309
|
+
} else {
|
|
11310
|
+
void this.eloService.updateUserAndCardElo(
|
|
11311
|
+
0,
|
|
11312
|
+
courseId,
|
|
11313
|
+
cardId,
|
|
11314
|
+
courseRegistrationDoc,
|
|
11315
|
+
currentCard
|
|
11316
|
+
);
|
|
11317
|
+
}
|
|
11318
|
+
logger.info(
|
|
11319
|
+
`[FirstContactElo] dismiss-failed final ELO penalty for ${cardId} (historyLen=${history.records.length}, sessionViews=${sessionViews})`
|
|
11301
11320
|
);
|
|
11302
11321
|
} else {
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
courseId,
|
|
11306
|
-
cardId,
|
|
11307
|
-
courseRegistrationDoc,
|
|
11308
|
-
currentCard
|
|
11322
|
+
logger.info(
|
|
11323
|
+
`[FirstContactElo] dismiss-failed \u2014 ELO already updated this response, skipping double penalty for ${cardId}`
|
|
11309
11324
|
);
|
|
11310
11325
|
}
|
|
11311
11326
|
return {
|