@vue-skuilder/db 0.1.31 → 0.1.32-b
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 +17 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +17 -4
- package/dist/core/index.mjs.map +1 -1
- package/dist/impl/couch/index.d.cts +2 -0
- package/dist/impl/couch/index.d.ts +2 -0
- package/dist/impl/couch/index.js +17 -4
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +17 -4
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +2 -0
- package/dist/impl/static/index.d.ts +2 -0
- package/dist/impl/static/index.js +17 -4
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +17 -4
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +74 -4
- package/dist/index.d.ts +74 -4
- package/dist/index.js +139 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +139 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/core/navigators/Pipeline.ts +11 -3
- package/src/core/navigators/filters/hierarchyDefinition.ts +4 -0
- package/src/core/navigators/filters/relativePriority.ts +7 -1
- package/src/impl/couch/courseDB.ts +10 -0
- package/src/impl/static/courseDB.ts +12 -0
- package/src/study/SessionController.ts +210 -20
- package/src/study/services/ResponseProcessor.ts +22 -2
package/dist/core/index.js
CHANGED
|
@@ -1783,6 +1783,7 @@ var init_hierarchyDefinition = __esm({
|
|
|
1783
1783
|
"use strict";
|
|
1784
1784
|
init_navigators();
|
|
1785
1785
|
import_common6 = require("@vue-skuilder/common");
|
|
1786
|
+
init_logger();
|
|
1786
1787
|
DEFAULT_MIN_COUNT = 3;
|
|
1787
1788
|
HierarchyDefinitionNavigator = class extends ContentNavigator {
|
|
1788
1789
|
config;
|
|
@@ -1950,6 +1951,9 @@ var init_hierarchyDefinition = __esm({
|
|
|
1950
1951
|
finalScore *= maxBoost;
|
|
1951
1952
|
action = "boosted";
|
|
1952
1953
|
finalReason = `${reason} | preReqBoost \xD7${maxBoost.toFixed(2)} for ${boostedPrereqs.join(", ")}`;
|
|
1954
|
+
logger.info(
|
|
1955
|
+
`[HierarchyDefinition] preReqBoost \xD7${maxBoost.toFixed(2)} applied to card ${card.cardId} via tags [${boostedPrereqs.join(", ")}] (score: ${card.score.toFixed(3)} \u2192 ${finalScore.toFixed(3)})`
|
|
1956
|
+
);
|
|
1953
1957
|
}
|
|
1954
1958
|
}
|
|
1955
1959
|
gated.push({
|
|
@@ -2459,7 +2463,7 @@ var init_relativePriority = __esm({
|
|
|
2459
2463
|
const cardTags = card.tags ?? [];
|
|
2460
2464
|
const priority = this.computeCardPriority(cardTags);
|
|
2461
2465
|
const boostFactor = this.computeBoostFactor(priority);
|
|
2462
|
-
const finalScore = Math.max(0,
|
|
2466
|
+
const finalScore = Math.max(0, card.score * boostFactor);
|
|
2463
2467
|
const action = boostFactor > 1 ? "boosted" : boostFactor < 1 ? "penalized" : "passed";
|
|
2464
2468
|
const reason = this.buildPriorityReason(cardTags, priority, boostFactor, finalScore);
|
|
2465
2469
|
return {
|
|
@@ -3224,7 +3228,7 @@ var init_Pipeline = __esm({
|
|
|
3224
3228
|
card.provenance.push({
|
|
3225
3229
|
strategy: "ephemeralHint",
|
|
3226
3230
|
strategyId: "ephemeral-hint",
|
|
3227
|
-
strategyName: "Replan Hint",
|
|
3231
|
+
strategyName: hints._label ? `Replan Hint (${hints._label})` : "Replan Hint",
|
|
3228
3232
|
action: "boosted",
|
|
3229
3233
|
score: card.score,
|
|
3230
3234
|
reason: `boostTag ${pattern} \xD7${factor}`
|
|
@@ -3241,7 +3245,7 @@ var init_Pipeline = __esm({
|
|
|
3241
3245
|
card.provenance.push({
|
|
3242
3246
|
strategy: "ephemeralHint",
|
|
3243
3247
|
strategyId: "ephemeral-hint",
|
|
3244
|
-
strategyName: "Replan Hint",
|
|
3248
|
+
strategyName: hints._label ? `Replan Hint (${hints._label})` : "Replan Hint",
|
|
3245
3249
|
action: "boosted",
|
|
3246
3250
|
score: card.score,
|
|
3247
3251
|
reason: `boostCard ${pattern} \xD7${factor}`
|
|
@@ -3251,6 +3255,7 @@ var init_Pipeline = __esm({
|
|
|
3251
3255
|
}
|
|
3252
3256
|
}
|
|
3253
3257
|
const cardIds = new Set(cards.map((c) => c.cardId));
|
|
3258
|
+
const hintLabel = hints._label ? `Replan Hint (${hints._label})` : "Replan Hint";
|
|
3254
3259
|
const inject = (card, reason) => {
|
|
3255
3260
|
if (!cardIds.has(card.cardId)) {
|
|
3256
3261
|
const floorScore = Math.max(card.score, 1);
|
|
@@ -3262,7 +3267,7 @@ var init_Pipeline = __esm({
|
|
|
3262
3267
|
{
|
|
3263
3268
|
strategy: "ephemeralHint",
|
|
3264
3269
|
strategyId: "ephemeral-hint",
|
|
3265
|
-
strategyName:
|
|
3270
|
+
strategyName: hintLabel,
|
|
3266
3271
|
action: "boosted",
|
|
3267
3272
|
score: floorScore,
|
|
3268
3273
|
reason
|
|
@@ -4466,10 +4471,18 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
4466
4471
|
* @param limit - Maximum number of cards to return
|
|
4467
4472
|
* @returns Cards sorted by score descending
|
|
4468
4473
|
*/
|
|
4474
|
+
_pendingHints = null;
|
|
4475
|
+
setEphemeralHints(hints) {
|
|
4476
|
+
this._pendingHints = hints;
|
|
4477
|
+
}
|
|
4469
4478
|
async getWeightedCards(limit) {
|
|
4470
4479
|
const u = await this._getCurrentUser();
|
|
4471
4480
|
try {
|
|
4472
4481
|
const navigator = await this.createNavigator(u);
|
|
4482
|
+
if (this._pendingHints) {
|
|
4483
|
+
navigator.setEphemeralHints(this._pendingHints);
|
|
4484
|
+
this._pendingHints = null;
|
|
4485
|
+
}
|
|
4473
4486
|
return navigator.getWeightedCards(limit);
|
|
4474
4487
|
} catch (e) {
|
|
4475
4488
|
logger.error(`[courseDB] Error getting weighted cards: ${e}`);
|