@vue-skuilder/db 0.1.31 → 0.1.32-a
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.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/study/SessionController.ts +8 -0
- package/src/study/services/ResponseProcessor.ts +22 -2
package/dist/index.d.cts
CHANGED
|
@@ -321,6 +321,13 @@ type SessionAction = 'dismiss-success' | 'dismiss-failed' | 'marked-failed' | 'd
|
|
|
321
321
|
interface ResponseResult {
|
|
322
322
|
nextCardAction: Exclude<SessionAction, 'dismiss-error'> | 'none';
|
|
323
323
|
shouldLoadNextCard: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* When true, the card requested deferred advancement via `deferAdvance`.
|
|
326
|
+
* The record was logged and ELO updated, but navigation was suppressed.
|
|
327
|
+
* StudySession should stash `nextCardAction` and wait for a
|
|
328
|
+
* `ready-to-advance` event from the card before calling `nextCard()`.
|
|
329
|
+
*/
|
|
330
|
+
deferred?: boolean;
|
|
324
331
|
isCorrect: boolean;
|
|
325
332
|
performanceScore?: number;
|
|
326
333
|
shouldClearFeedbackShadow: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -321,6 +321,13 @@ type SessionAction = 'dismiss-success' | 'dismiss-failed' | 'marked-failed' | 'd
|
|
|
321
321
|
interface ResponseResult {
|
|
322
322
|
nextCardAction: Exclude<SessionAction, 'dismiss-error'> | 'none';
|
|
323
323
|
shouldLoadNextCard: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* When true, the card requested deferred advancement via `deferAdvance`.
|
|
326
|
+
* The record was logged and ELO updated, but navigation was suppressed.
|
|
327
|
+
* StudySession should stash `nextCardAction` and wait for a
|
|
328
|
+
* `ready-to-advance` event from the card before calling `nextCard()`.
|
|
329
|
+
*/
|
|
330
|
+
deferred?: boolean;
|
|
324
331
|
isCorrect: boolean;
|
|
325
332
|
performanceScore?: number;
|
|
326
333
|
shouldClearFeedbackShadow: boolean;
|
package/dist/index.js
CHANGED
|
@@ -9425,8 +9425,9 @@ var ResponseProcessor = class {
|
|
|
9425
9425
|
}
|
|
9426
9426
|
try {
|
|
9427
9427
|
const history = await cardHistory;
|
|
9428
|
+
let result;
|
|
9428
9429
|
if (cardRecord.isCorrect) {
|
|
9429
|
-
|
|
9430
|
+
result = this.processCorrectResponse(
|
|
9430
9431
|
cardRecord,
|
|
9431
9432
|
history,
|
|
9432
9433
|
studySessionItem,
|
|
@@ -9436,7 +9437,7 @@ var ResponseProcessor = class {
|
|
|
9436
9437
|
cardId
|
|
9437
9438
|
);
|
|
9438
9439
|
} else {
|
|
9439
|
-
|
|
9440
|
+
result = this.processIncorrectResponse(
|
|
9440
9441
|
cardRecord,
|
|
9441
9442
|
history,
|
|
9442
9443
|
courseRegistrationDoc,
|
|
@@ -9448,6 +9449,18 @@ var ResponseProcessor = class {
|
|
|
9448
9449
|
sessionViews
|
|
9449
9450
|
);
|
|
9450
9451
|
}
|
|
9452
|
+
if (cardRecord.deferAdvance && result.shouldLoadNextCard) {
|
|
9453
|
+
logger.info(
|
|
9454
|
+
"[ResponseProcessor] deferAdvance requested \u2014 suppressing navigation, action stashed:",
|
|
9455
|
+
{ nextCardAction: result.nextCardAction }
|
|
9456
|
+
);
|
|
9457
|
+
result = {
|
|
9458
|
+
...result,
|
|
9459
|
+
shouldLoadNextCard: false,
|
|
9460
|
+
deferred: true
|
|
9461
|
+
};
|
|
9462
|
+
}
|
|
9463
|
+
return result;
|
|
9451
9464
|
} catch (e) {
|
|
9452
9465
|
logger.error("[ResponseProcessor] Failed to load card history", { e, cardId });
|
|
9453
9466
|
throw e;
|