@vue-skuilder/db 0.2.9 → 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/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +3 -2
- package/dist/core/index.mjs.map +1 -1
- package/dist/impl/couch/index.js +3 -2
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +3 -2
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.js +37 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/impl/couch/courseDB.ts +11 -2
- package/src/study/services/ResponseProcessor.ts +56 -22
package/dist/index.js
CHANGED
|
@@ -6146,9 +6146,10 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6146
6146
|
return tagsByCard;
|
|
6147
6147
|
}
|
|
6148
6148
|
async getAllCardIds() {
|
|
6149
|
+
const prefix = `${DocTypePrefixes["CARD" /* CARD */]}-`;
|
|
6149
6150
|
const result = await this.db.allDocs({
|
|
6150
|
-
startkey:
|
|
6151
|
-
endkey:
|
|
6151
|
+
startkey: prefix,
|
|
6152
|
+
endkey: `${prefix}\uFFF0`,
|
|
6152
6153
|
include_docs: false
|
|
6153
6154
|
});
|
|
6154
6155
|
return result.rows.map((row) => row.id);
|
|
@@ -11314,7 +11315,7 @@ var ResponseProcessor = class {
|
|
|
11314
11315
|
const nullTags = tagKeys.filter((k) => taggedPerformance[k] === null);
|
|
11315
11316
|
const scoredTags = tagKeys.filter((k) => taggedPerformance[k] !== null);
|
|
11316
11317
|
logger.info(
|
|
11317
|
-
`[
|
|
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(", ")}]`
|
|
11318
11319
|
);
|
|
11319
11320
|
void this.eloService.updateUserAndCardEloPerTag(
|
|
11320
11321
|
taggedPerformance,
|
|
@@ -11345,7 +11346,7 @@ var ResponseProcessor = class {
|
|
|
11345
11346
|
);
|
|
11346
11347
|
}
|
|
11347
11348
|
logger.info(
|
|
11348
|
-
|
|
11349
|
+
`[FirstContactElo] correct first-attempt ELO update (score=${userScore.toFixed(3)}) for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
|
|
11349
11350
|
);
|
|
11350
11351
|
}
|
|
11351
11352
|
return {
|
|
@@ -11374,7 +11375,8 @@ var ResponseProcessor = class {
|
|
|
11374
11375
|
*/
|
|
11375
11376
|
processIncorrectResponse(cardRecord, history, courseRegistrationDoc, currentCard, courseId, cardId, maxAttemptsPerView, maxSessionViews, sessionViews) {
|
|
11376
11377
|
const { taggedPerformance } = this.parsePerformance(cardRecord.performance);
|
|
11377
|
-
|
|
11378
|
+
let eloUpdated = false;
|
|
11379
|
+
if (cardRecord.priorAttemps === 0) {
|
|
11378
11380
|
if (taggedPerformance) {
|
|
11379
11381
|
void this.eloService.updateUserAndCardEloPerTag(
|
|
11380
11382
|
taggedPerformance,
|
|
@@ -11384,7 +11386,7 @@ var ResponseProcessor = class {
|
|
|
11384
11386
|
currentCard
|
|
11385
11387
|
);
|
|
11386
11388
|
logger.info(
|
|
11387
|
-
`[
|
|
11389
|
+
`[FirstContactElo] incorrect first-attempt per-tag ELO update for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps}, tags=${Object.keys(taggedPerformance).length - 1})`
|
|
11388
11390
|
);
|
|
11389
11391
|
} else {
|
|
11390
11392
|
void this.eloService.updateUserAndCardElo(
|
|
@@ -11395,28 +11397,42 @@ var ResponseProcessor = class {
|
|
|
11395
11397
|
courseRegistrationDoc,
|
|
11396
11398
|
currentCard
|
|
11397
11399
|
);
|
|
11398
|
-
logger.info(
|
|
11400
|
+
logger.info(
|
|
11401
|
+
`[FirstContactElo] incorrect first-attempt ELO update (score=0) for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
|
|
11402
|
+
);
|
|
11399
11403
|
}
|
|
11404
|
+
eloUpdated = true;
|
|
11400
11405
|
} else {
|
|
11401
|
-
logger.info(
|
|
11406
|
+
logger.info(
|
|
11407
|
+
`[FirstContactElo] incorrect retry \u2014 no ELO update for ${cardId} (historyLen=${history.records.length}, priorAttemps=${cardRecord.priorAttemps})`
|
|
11408
|
+
);
|
|
11402
11409
|
}
|
|
11403
11410
|
if (currentCard.records.length >= maxAttemptsPerView) {
|
|
11404
11411
|
if (sessionViews >= maxSessionViews) {
|
|
11405
|
-
if (
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
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})`
|
|
11412
11432
|
);
|
|
11413
11433
|
} else {
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
courseId,
|
|
11417
|
-
cardId,
|
|
11418
|
-
courseRegistrationDoc,
|
|
11419
|
-
currentCard
|
|
11434
|
+
logger.info(
|
|
11435
|
+
`[FirstContactElo] dismiss-failed \u2014 ELO already updated this response, skipping double penalty for ${cardId}`
|
|
11420
11436
|
);
|
|
11421
11437
|
}
|
|
11422
11438
|
return {
|