@vue-skuilder/db 0.2.29 → 0.2.31
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/{contentSource-CqJmbOZN.d.ts → contentSource-DMduBjDC.d.ts} +19 -4
- package/dist/{contentSource-B6FrSihy.d.cts → contentSource-Doh1aVBJ.d.cts} +19 -4
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +128 -82
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +80 -33
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-DUxDqMtZ.d.cts → dataLayerProvider-BW1CBAbb.d.cts} +1 -1
- package/dist/{dataLayerProvider-B9_UCvkR.d.ts → dataLayerProvider-Cxfe4nSK.d.ts} +1 -1
- package/dist/diagnostics/index.d.cts +18 -3
- package/dist/diagnostics/index.d.ts +18 -3
- package/dist/diagnostics/index.js +159 -135
- package/dist/diagnostics/index.js.map +1 -1
- package/dist/diagnostics/index.mjs +156 -135
- package/dist/diagnostics/index.mjs.map +1 -1
- package/dist/impl/couch/index.d.cts +2 -2
- package/dist/impl/couch/index.d.ts +2 -2
- package/dist/impl/couch/index.js +132 -86
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +80 -33
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +2 -2
- package/dist/impl/static/index.d.ts +2 -2
- package/dist/impl/static/index.js +119 -73
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +80 -33
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +181 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -39
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/navigators/PipelineDebugger.ts +42 -23
- package/src/core/navigators/filters/eloDistance.ts +79 -21
- package/src/core/navigators/generators/elo.ts +8 -2
- package/src/core/navigators/generators/prescribed.ts +7 -5
- package/src/core/types/studySession.ts +12 -1
- package/src/diagnostics/derive.ts +5 -2
- package/src/diagnostics/pipeline.ts +28 -0
- package/src/diagnostics/text.ts +11 -4
- package/src/study/SessionController.ts +3 -1
- package/src/study/services/EloService.ts +33 -6
package/dist/index.js
CHANGED
|
@@ -806,13 +806,12 @@ function clearRunHistory() {
|
|
|
806
806
|
_pendingRuns = [];
|
|
807
807
|
}
|
|
808
808
|
function getOrigin(card) {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
return "unknown";
|
|
809
|
+
return card.reviewID ? "review" : "new";
|
|
810
|
+
}
|
|
811
|
+
function requiredBy(card) {
|
|
812
|
+
return card.provenance.find(
|
|
813
|
+
(p) => p.strategy === "ephemeralHint" && p.score === Number.POSITIVE_INFINITY
|
|
814
|
+
)?.strategyName;
|
|
816
815
|
}
|
|
817
816
|
function captureRun(report) {
|
|
818
817
|
const fullReport = {
|
|
@@ -836,17 +835,23 @@ function parseCardElo(provenance) {
|
|
|
836
835
|
}
|
|
837
836
|
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards, regulators) {
|
|
838
837
|
const selectedIds = new Set(selectedCards.map((c) => c.cardId));
|
|
839
|
-
const toReport = (card) =>
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
838
|
+
const toReport = (card) => {
|
|
839
|
+
const required = requiredBy(card);
|
|
840
|
+
const first = card.provenance[0];
|
|
841
|
+
const generator = first && first.strategy !== "ephemeralHint" ? first.strategyName || first.strategy : void 0;
|
|
842
|
+
return {
|
|
843
|
+
cardId: card.cardId,
|
|
844
|
+
courseId: card.courseId,
|
|
845
|
+
origin: getOrigin(card),
|
|
846
|
+
...generator ? { generator } : {},
|
|
847
|
+
...required ? { required } : {},
|
|
848
|
+
finalScore: card.score,
|
|
849
|
+
cardElo: card.cardElo ?? parseCardElo(card.provenance),
|
|
850
|
+
provenance: card.provenance,
|
|
851
|
+
tags: card.tags,
|
|
852
|
+
selected: selectedIds.has(card.cardId)
|
|
853
|
+
};
|
|
854
|
+
};
|
|
850
855
|
const selectedReported = [];
|
|
851
856
|
const nearMissReported = [];
|
|
852
857
|
const discardedTailCards = [];
|
|
@@ -1975,10 +1980,14 @@ var init_elo = __esm({
|
|
|
1975
1980
|
const userElo = (0, import_common5.toCourseElo)(courseReg.elo);
|
|
1976
1981
|
userGlobalElo = userElo.global.score;
|
|
1977
1982
|
}
|
|
1978
|
-
const activeCards = await
|
|
1983
|
+
const [activeCards, seenCards] = await Promise.all([
|
|
1984
|
+
this.user.getActiveCards(),
|
|
1985
|
+
this.user.getSeenCards(this.course.getCourseID()).catch(() => [])
|
|
1986
|
+
]);
|
|
1987
|
+
const notNew = /* @__PURE__ */ new Set([...activeCards.map((ac) => ac.cardID), ...seenCards]);
|
|
1979
1988
|
const newCards = (await this.course.getCardsCenteredAtELO(
|
|
1980
1989
|
{ limit, elo: "user" },
|
|
1981
|
-
(c) => !
|
|
1990
|
+
(c) => !notNew.has(c.cardID)
|
|
1982
1991
|
)).map((c) => ({ ...c, status: "new" }));
|
|
1983
1992
|
const scored = newCards.map((c) => {
|
|
1984
1993
|
const cardElo = c.elo ?? 1e3;
|
|
@@ -2071,11 +2080,11 @@ function formatAge(ms) {
|
|
|
2071
2080
|
}
|
|
2072
2081
|
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
2073
2082
|
if (minCount <= 0) return [];
|
|
2074
|
-
const exposeTags = new Set(tags.filter((tag) =>
|
|
2083
|
+
const exposeTags = new Set(tags.filter((tag) => (0, import_common6.tagRole)(tag) === "expose"));
|
|
2075
2084
|
for (const tag of tags) {
|
|
2076
|
-
if (
|
|
2077
|
-
const
|
|
2078
|
-
if (
|
|
2085
|
+
if ((0, import_common6.tagRole)(tag) !== "intro") continue;
|
|
2086
|
+
const expose = (0, import_common6.withTagRole)(tag, "expose");
|
|
2087
|
+
if (expose) exposeTags.add(expose);
|
|
2079
2088
|
}
|
|
2080
2089
|
return [...exposeTags].filter((tag) => {
|
|
2081
2090
|
const tagElo = userTagElo[tag];
|
|
@@ -2085,10 +2094,11 @@ function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
|
2085
2094
|
function pickTopByScore(cards, limit) {
|
|
2086
2095
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
2087
2096
|
}
|
|
2088
|
-
var DEFAULT_FRESHNESS_WINDOW, DEFAULT_MAX_DIRECT_PER_RUN, DEFAULT_MAX_SUPPORT_PER_RUN, DEFAULT_HIERARCHY_DEPTH, DEFAULT_MIN_COUNT, DEFAULT_PRACTICE_MIN_COUNT, DEFAULT_MAX_PRACTICE_PER_RUN, BASE_TARGET_SCORE, BASE_SUPPORT_SCORE, DISCOVERED_SUPPORT_SCORE, BASE_PRACTICE_SCORE, PRACTICE_BASE_MULT, MAX_PRACTICE_MULTIPLIER, PRACTICE_STALENESS_BUMP_PER_DAY, MAX_TARGET_MULTIPLIER, MAX_SUPPORT_MULTIPLIER, PRESCRIBED_DEBUG_VERSION, PrescribedCardsGenerator;
|
|
2097
|
+
var import_common6, DEFAULT_FRESHNESS_WINDOW, DEFAULT_MAX_DIRECT_PER_RUN, DEFAULT_MAX_SUPPORT_PER_RUN, DEFAULT_HIERARCHY_DEPTH, DEFAULT_MIN_COUNT, DEFAULT_PRACTICE_MIN_COUNT, DEFAULT_MAX_PRACTICE_PER_RUN, BASE_TARGET_SCORE, BASE_SUPPORT_SCORE, DISCOVERED_SUPPORT_SCORE, BASE_PRACTICE_SCORE, PRACTICE_BASE_MULT, MAX_PRACTICE_MULTIPLIER, PRACTICE_STALENESS_BUMP_PER_DAY, MAX_TARGET_MULTIPLIER, MAX_SUPPORT_MULTIPLIER, PRESCRIBED_DEBUG_VERSION, PrescribedCardsGenerator;
|
|
2089
2098
|
var init_prescribed = __esm({
|
|
2090
2099
|
"src/core/navigators/generators/prescribed.ts"() {
|
|
2091
2100
|
"use strict";
|
|
2101
|
+
import_common6 = require("@vue-skuilder/common");
|
|
2092
2102
|
init_navigators();
|
|
2093
2103
|
init_StrategyPressureDebugger();
|
|
2094
2104
|
init_logger();
|
|
@@ -3274,6 +3284,7 @@ __export(eloDistance_exports, {
|
|
|
3274
3284
|
DEFAULT_ELO_DISTANCE_CONFIG: () => DEFAULT_ELO_DISTANCE_CONFIG,
|
|
3275
3285
|
createEloDistanceFilter: () => createEloDistanceFilter,
|
|
3276
3286
|
default: () => EloDistanceFilter,
|
|
3287
|
+
mountMultiDimEloToggle: () => mountMultiDimEloToggle,
|
|
3277
3288
|
tagAwareGap: () => tagAwareGap
|
|
3278
3289
|
});
|
|
3279
3290
|
function computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier) {
|
|
@@ -3284,12 +3295,43 @@ function computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier) {
|
|
|
3284
3295
|
function resolveConfig(config) {
|
|
3285
3296
|
return { ...DEFAULT_ELO_DISTANCE_CONFIG, ...config };
|
|
3286
3297
|
}
|
|
3298
|
+
function readMultiDimElo() {
|
|
3299
|
+
try {
|
|
3300
|
+
return typeof localStorage !== "undefined" && localStorage.getItem(MULTI_DIM_ELO_KEY) === "true";
|
|
3301
|
+
} catch {
|
|
3302
|
+
return false;
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
function mountMultiDimEloToggle() {
|
|
3306
|
+
if (typeof window === "undefined") return;
|
|
3307
|
+
const win = window;
|
|
3308
|
+
win.skuilder = win.skuilder || {};
|
|
3309
|
+
Object.defineProperty(win.skuilder, "multiDimElo", {
|
|
3310
|
+
configurable: true,
|
|
3311
|
+
enumerable: true,
|
|
3312
|
+
get: () => multiDimElo,
|
|
3313
|
+
set: (on) => {
|
|
3314
|
+
multiDimElo = on === true;
|
|
3315
|
+
try {
|
|
3316
|
+
if (multiDimElo) localStorage.setItem(MULTI_DIM_ELO_KEY, "true");
|
|
3317
|
+
else localStorage.removeItem(MULTI_DIM_ELO_KEY);
|
|
3318
|
+
} catch (e) {
|
|
3319
|
+
logger.warn(`[EloDistance] multiDimElo not persisted (localStorage unavailable): ${e}`);
|
|
3320
|
+
}
|
|
3321
|
+
logger.info(
|
|
3322
|
+
`[EloDistance] multiDimElo ${multiDimElo ? "on: tag-aware" : "off: per strategy config"} ELO distance from the next replan`
|
|
3323
|
+
);
|
|
3324
|
+
}
|
|
3325
|
+
});
|
|
3326
|
+
}
|
|
3287
3327
|
function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
|
|
3288
3328
|
const globalGap = cardElo.global.score - userElo.global.score;
|
|
3289
3329
|
const tags = [];
|
|
3290
3330
|
for (const tag of cardTags) {
|
|
3291
3331
|
const user = userElo.tags[tag];
|
|
3292
|
-
if (!user || user.score ===
|
|
3332
|
+
if ((0, import_common7.isCountOnlyTag)(tag) || !user || user.score === import_common7.COUNT_ONLY_SCORE || user.count < minTagCount) {
|
|
3333
|
+
continue;
|
|
3334
|
+
}
|
|
3293
3335
|
const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
|
|
3294
3336
|
tags.push({
|
|
3295
3337
|
tag,
|
|
@@ -3311,7 +3353,7 @@ function tagReason(tags, globalGap) {
|
|
|
3311
3353
|
async function applyEloDistance(cards, context, config, source) {
|
|
3312
3354
|
const { course, userElo, userCourseElo } = context;
|
|
3313
3355
|
const { halfLife, minMultiplier, maxMultiplier } = config;
|
|
3314
|
-
const tagAware = config.tagAware && userCourseElo !== void 0;
|
|
3356
|
+
const tagAware = (config.tagAware || multiDimElo) && userCourseElo !== void 0;
|
|
3315
3357
|
const missing = cards.filter((c) => tagAware || c.cardElo === void 0).map((c) => c.cardId);
|
|
3316
3358
|
const fetched = /* @__PURE__ */ new Map();
|
|
3317
3359
|
if (missing.length > 0) {
|
|
@@ -3325,10 +3367,10 @@ async function applyEloDistance(cards, context, config, source) {
|
|
|
3325
3367
|
const cardElo = full?.global?.score ?? card.cardElo ?? DEFAULT_CARD_ELO;
|
|
3326
3368
|
let distance = Math.abs(cardElo - userElo);
|
|
3327
3369
|
let how = "";
|
|
3328
|
-
if (tagAware
|
|
3329
|
-
const t = tagAwareGap(card.tags ?? [], full, userCourseElo, config.minTagCount);
|
|
3330
|
-
distance = Math.abs(t.gap);
|
|
3331
|
-
|
|
3370
|
+
if (tagAware) {
|
|
3371
|
+
const t = full ? tagAwareGap(card.tags ?? [], full, userCourseElo, config.minTagCount) : void 0;
|
|
3372
|
+
if (t) distance = Math.abs(t.gap);
|
|
3373
|
+
how = t?.tags.length ? `, tag-aware${tagReason(t.tags, t.globalGap)}` : ", tag-aware: global (no shared tags)";
|
|
3332
3374
|
}
|
|
3333
3375
|
const multiplier = computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier);
|
|
3334
3376
|
const newScore = card.score * multiplier;
|
|
@@ -3361,21 +3403,25 @@ function createEloDistanceFilter(config) {
|
|
|
3361
3403
|
transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
|
|
3362
3404
|
};
|
|
3363
3405
|
}
|
|
3364
|
-
var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF,
|
|
3406
|
+
var import_common7, DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, DEFAULT_CARD_ELO, MULTI_DIM_ELO_KEY, multiDimElo, EloDistanceFilter;
|
|
3365
3407
|
var init_eloDistance = __esm({
|
|
3366
3408
|
"src/core/navigators/filters/eloDistance.ts"() {
|
|
3367
3409
|
"use strict";
|
|
3368
3410
|
init_navigators();
|
|
3411
|
+
import_common7 = require("@vue-skuilder/common");
|
|
3412
|
+
init_logger();
|
|
3369
3413
|
DEFAULT_ELO_DISTANCE_CONFIG = {
|
|
3370
3414
|
halfLife: 300,
|
|
3371
3415
|
minMultiplier: 0.05,
|
|
3372
3416
|
maxMultiplier: 1,
|
|
3373
|
-
tagAware:
|
|
3417
|
+
tagAware: false,
|
|
3374
3418
|
minTagCount: 3
|
|
3375
3419
|
};
|
|
3376
3420
|
TAG_CONFIDENCE_HALF = 10;
|
|
3377
|
-
COUNT_ONLY_SENTINEL = -1;
|
|
3378
3421
|
DEFAULT_CARD_ELO = 1e3;
|
|
3422
|
+
MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
|
|
3423
|
+
multiDimElo = readMultiDimElo();
|
|
3424
|
+
mountMultiDimEloToggle();
|
|
3379
3425
|
EloDistanceFilter = class _EloDistanceFilter extends ContentNavigator {
|
|
3380
3426
|
name;
|
|
3381
3427
|
/** See CardFilter.kind. Static, so the pipeline plan can read it without an instance. */
|
|
@@ -3414,12 +3460,12 @@ var hierarchyDefinition_exports = {};
|
|
|
3414
3460
|
__export(hierarchyDefinition_exports, {
|
|
3415
3461
|
default: () => HierarchyDefinitionNavigator
|
|
3416
3462
|
});
|
|
3417
|
-
var
|
|
3463
|
+
var import_common8, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
|
|
3418
3464
|
var init_hierarchyDefinition = __esm({
|
|
3419
3465
|
"src/core/navigators/filters/hierarchyDefinition.ts"() {
|
|
3420
3466
|
"use strict";
|
|
3421
3467
|
init_navigators();
|
|
3422
|
-
|
|
3468
|
+
import_common8 = require("@vue-skuilder/common");
|
|
3423
3469
|
init_logger();
|
|
3424
3470
|
DEFAULT_MIN_COUNT2 = 3;
|
|
3425
3471
|
HierarchyDefinitionNavigator = class _HierarchyDefinitionNavigator extends ContentNavigator {
|
|
@@ -3469,7 +3515,7 @@ var init_hierarchyDefinition = __esm({
|
|
|
3469
3515
|
const mastered = /* @__PURE__ */ new Set();
|
|
3470
3516
|
try {
|
|
3471
3517
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3472
|
-
const userElo = (0,
|
|
3518
|
+
const userElo = (0, import_common8.toCourseElo)(courseReg.elo);
|
|
3473
3519
|
for (const prereqs of Object.values(this.config.prerequisites)) {
|
|
3474
3520
|
for (const prereq of prereqs) {
|
|
3475
3521
|
const tagElo = userElo.tags[prereq.tag];
|
|
@@ -3841,12 +3887,12 @@ var interferenceMitigator_exports = {};
|
|
|
3841
3887
|
__export(interferenceMitigator_exports, {
|
|
3842
3888
|
default: () => InterferenceMitigatorNavigator
|
|
3843
3889
|
});
|
|
3844
|
-
var
|
|
3890
|
+
var import_common9, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
|
|
3845
3891
|
var init_interferenceMitigator = __esm({
|
|
3846
3892
|
"src/core/navigators/filters/interferenceMitigator.ts"() {
|
|
3847
3893
|
"use strict";
|
|
3848
3894
|
init_navigators();
|
|
3849
|
-
|
|
3895
|
+
import_common9 = require("@vue-skuilder/common");
|
|
3850
3896
|
DEFAULT_MIN_COUNT3 = 10;
|
|
3851
3897
|
DEFAULT_MIN_ELAPSED_DAYS = 3;
|
|
3852
3898
|
DEFAULT_INTERFERENCE_DECAY = 0.8;
|
|
@@ -3931,7 +3977,7 @@ var init_interferenceMitigator = __esm({
|
|
|
3931
3977
|
const immature = /* @__PURE__ */ new Set();
|
|
3932
3978
|
try {
|
|
3933
3979
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3934
|
-
const userElo = (0,
|
|
3980
|
+
const userElo = (0, import_common9.toCourseElo)(courseReg.elo);
|
|
3935
3981
|
const minCount = this.config.maturityThreshold?.minCount ?? DEFAULT_MIN_COUNT3;
|
|
3936
3982
|
const minElo = this.config.maturityThreshold?.minElo;
|
|
3937
3983
|
const minElapsedDays = this.config.maturityThreshold?.minElapsedDays ?? DEFAULT_MIN_ELAPSED_DAYS;
|
|
@@ -4722,11 +4768,11 @@ function logCardProvenance(cards, maxCards = 3) {
|
|
|
4722
4768
|
}
|
|
4723
4769
|
}
|
|
4724
4770
|
}
|
|
4725
|
-
var
|
|
4771
|
+
var import_common10, VERBOSE_RESULTS, Pipeline;
|
|
4726
4772
|
var init_Pipeline = __esm({
|
|
4727
4773
|
"src/core/navigators/Pipeline.ts"() {
|
|
4728
4774
|
"use strict";
|
|
4729
|
-
|
|
4775
|
+
import_common10 = require("@vue-skuilder/common");
|
|
4730
4776
|
init_navigators();
|
|
4731
4777
|
init_logger();
|
|
4732
4778
|
init_orchestration();
|
|
@@ -5215,7 +5261,7 @@ var init_Pipeline = __esm({
|
|
|
5215
5261
|
let userCourseElo;
|
|
5216
5262
|
try {
|
|
5217
5263
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
5218
|
-
userCourseElo = (0,
|
|
5264
|
+
userCourseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
5219
5265
|
userElo = userCourseElo.global.score;
|
|
5220
5266
|
} catch (e) {
|
|
5221
5267
|
logger.debug(`[Pipeline] Could not get user ELO, using default: ${e}`);
|
|
@@ -5277,7 +5323,7 @@ var init_Pipeline = __esm({
|
|
|
5277
5323
|
*/
|
|
5278
5324
|
async getTagEloStatus(tagFilter) {
|
|
5279
5325
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
5280
|
-
const courseElo = (0,
|
|
5326
|
+
const courseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
5281
5327
|
const result = {};
|
|
5282
5328
|
if (!tagFilter) {
|
|
5283
5329
|
for (const [tag, data] of Object.entries(courseElo.tags)) {
|
|
@@ -6178,11 +6224,11 @@ ${JSON.stringify(config)}
|
|
|
6178
6224
|
function isSuccessRow(row) {
|
|
6179
6225
|
return "doc" in row && row.doc !== null && row.doc !== void 0;
|
|
6180
6226
|
}
|
|
6181
|
-
var
|
|
6227
|
+
var import_common11, CoursesDB, CourseDB;
|
|
6182
6228
|
var init_courseDB = __esm({
|
|
6183
6229
|
"src/impl/couch/courseDB.ts"() {
|
|
6184
6230
|
"use strict";
|
|
6185
|
-
|
|
6231
|
+
import_common11 = require("@vue-skuilder/common");
|
|
6186
6232
|
init_couch();
|
|
6187
6233
|
init_updateQueue();
|
|
6188
6234
|
init_types_legacy();
|
|
@@ -6331,14 +6377,14 @@ var init_courseDB = __esm({
|
|
|
6331
6377
|
docs.rows.forEach((r) => {
|
|
6332
6378
|
if (isSuccessRow(r)) {
|
|
6333
6379
|
if (r.doc && r.doc.elo) {
|
|
6334
|
-
ret.push((0,
|
|
6380
|
+
ret.push((0, import_common11.toCourseElo)(r.doc.elo));
|
|
6335
6381
|
} else {
|
|
6336
6382
|
logger.warn("no elo data for card: " + r.id);
|
|
6337
|
-
ret.push((0,
|
|
6383
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6338
6384
|
}
|
|
6339
6385
|
} else {
|
|
6340
6386
|
logger.warn("no elo data for card: " + JSON.stringify(r));
|
|
6341
|
-
ret.push((0,
|
|
6387
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6342
6388
|
}
|
|
6343
6389
|
});
|
|
6344
6390
|
return ret;
|
|
@@ -6541,7 +6587,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6541
6587
|
async getCourseTagStubs() {
|
|
6542
6588
|
return getCourseTagStubs(this.id);
|
|
6543
6589
|
}
|
|
6544
|
-
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0,
|
|
6590
|
+
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common11.blankCourseElo)()) {
|
|
6545
6591
|
try {
|
|
6546
6592
|
const resp = await addNote55(this.id, codeCourse, shape, data, author, tags, uploads, elo);
|
|
6547
6593
|
if (resp.ok) {
|
|
@@ -6550,19 +6596,19 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6550
6596
|
`[courseDB.addNote] Note added but card creation failed: ${resp.cardCreationError}`
|
|
6551
6597
|
);
|
|
6552
6598
|
return {
|
|
6553
|
-
status:
|
|
6599
|
+
status: import_common11.Status.error,
|
|
6554
6600
|
message: `Note was added but no cards were created: ${resp.cardCreationError}`,
|
|
6555
6601
|
id: resp.id
|
|
6556
6602
|
};
|
|
6557
6603
|
}
|
|
6558
6604
|
return {
|
|
6559
|
-
status:
|
|
6605
|
+
status: import_common11.Status.ok,
|
|
6560
6606
|
message: "",
|
|
6561
6607
|
id: resp.id
|
|
6562
6608
|
};
|
|
6563
6609
|
} else {
|
|
6564
6610
|
return {
|
|
6565
|
-
status:
|
|
6611
|
+
status: import_common11.Status.error,
|
|
6566
6612
|
message: "Unexpected error adding note"
|
|
6567
6613
|
};
|
|
6568
6614
|
}
|
|
@@ -6574,7 +6620,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6574
6620
|
message: ${err.message}`
|
|
6575
6621
|
);
|
|
6576
6622
|
return {
|
|
6577
|
-
status:
|
|
6623
|
+
status: import_common11.Status.error,
|
|
6578
6624
|
message: `Error adding note to course. ${e.reason || err.message}`
|
|
6579
6625
|
};
|
|
6580
6626
|
}
|
|
@@ -6768,7 +6814,7 @@ ${e.stack}` : JSON.stringify(e);
|
|
|
6768
6814
|
const courseDoc = (await u.getCourseRegistrationsDoc()).courses.find((c) => {
|
|
6769
6815
|
return c.courseID === this.id;
|
|
6770
6816
|
});
|
|
6771
|
-
targetElo = (0,
|
|
6817
|
+
targetElo = (0, import_common11.EloToNumber)(courseDoc.elo);
|
|
6772
6818
|
} catch {
|
|
6773
6819
|
targetElo = 1e3;
|
|
6774
6820
|
}
|
|
@@ -7599,14 +7645,14 @@ var CouchDBSyncStrategy_exports = {};
|
|
|
7599
7645
|
__export(CouchDBSyncStrategy_exports, {
|
|
7600
7646
|
CouchDBSyncStrategy: () => CouchDBSyncStrategy
|
|
7601
7647
|
});
|
|
7602
|
-
var
|
|
7648
|
+
var import_common12, log2, CouchDBSyncStrategy;
|
|
7603
7649
|
var init_CouchDBSyncStrategy = __esm({
|
|
7604
7650
|
"src/impl/couch/CouchDBSyncStrategy.ts"() {
|
|
7605
7651
|
"use strict";
|
|
7606
7652
|
init_factory();
|
|
7607
7653
|
init_types_legacy();
|
|
7608
7654
|
init_logger();
|
|
7609
|
-
|
|
7655
|
+
import_common12 = require("@vue-skuilder/common");
|
|
7610
7656
|
init_common();
|
|
7611
7657
|
init_pouchdb_setup();
|
|
7612
7658
|
init_couch();
|
|
@@ -7747,32 +7793,32 @@ var init_CouchDBSyncStrategy = __esm({
|
|
|
7747
7793
|
}
|
|
7748
7794
|
}
|
|
7749
7795
|
return {
|
|
7750
|
-
status:
|
|
7796
|
+
status: import_common12.Status.ok,
|
|
7751
7797
|
error: void 0
|
|
7752
7798
|
};
|
|
7753
7799
|
} else {
|
|
7754
7800
|
return {
|
|
7755
|
-
status:
|
|
7801
|
+
status: import_common12.Status.error,
|
|
7756
7802
|
error: "Failed to log in after account creation"
|
|
7757
7803
|
};
|
|
7758
7804
|
}
|
|
7759
7805
|
} else {
|
|
7760
7806
|
logger.warn(`Signup not OK: ${JSON.stringify(signupRequest)}`);
|
|
7761
7807
|
return {
|
|
7762
|
-
status:
|
|
7808
|
+
status: import_common12.Status.error,
|
|
7763
7809
|
error: "Account creation failed"
|
|
7764
7810
|
};
|
|
7765
7811
|
}
|
|
7766
7812
|
} catch (e) {
|
|
7767
7813
|
if (e.reason === "Document update conflict.") {
|
|
7768
7814
|
return {
|
|
7769
|
-
status:
|
|
7815
|
+
status: import_common12.Status.error,
|
|
7770
7816
|
error: "This username is taken!"
|
|
7771
7817
|
};
|
|
7772
7818
|
}
|
|
7773
7819
|
logger.error(`Error on signup: ${JSON.stringify(e)}`);
|
|
7774
7820
|
return {
|
|
7775
|
-
status:
|
|
7821
|
+
status: import_common12.Status.error,
|
|
7776
7822
|
error: e.message || "Unknown error during account creation"
|
|
7777
7823
|
};
|
|
7778
7824
|
}
|
|
@@ -8017,7 +8063,7 @@ function newQuestionInterval(user, cardHistory) {
|
|
|
8017
8063
|
}
|
|
8018
8064
|
if (currentAttempt.isCorrect) {
|
|
8019
8065
|
const rawPerf = currentAttempt.performance;
|
|
8020
|
-
const numericPerf = (0,
|
|
8066
|
+
const numericPerf = (0, import_common14.isTaggedPerformance)(rawPerf) ? rawPerf._global : rawPerf;
|
|
8021
8067
|
const skill = Math.min(1, Math.max(0, numericPerf));
|
|
8022
8068
|
logger.debug(`Demontrated skill: ${skill}`);
|
|
8023
8069
|
const interval = lastInterval * (0.75 + skill);
|
|
@@ -8068,13 +8114,13 @@ function secondsBetween(start, end) {
|
|
|
8068
8114
|
const ret = duration(end.diff(start)).asSeconds();
|
|
8069
8115
|
return ret;
|
|
8070
8116
|
}
|
|
8071
|
-
var import_moment4,
|
|
8117
|
+
var import_moment4, import_common14, duration;
|
|
8072
8118
|
var init_SpacedRepetition = __esm({
|
|
8073
8119
|
"src/study/SpacedRepetition.ts"() {
|
|
8074
8120
|
"use strict";
|
|
8075
8121
|
init_util();
|
|
8076
8122
|
import_moment4 = __toESM(require("moment"), 1);
|
|
8077
|
-
|
|
8123
|
+
import_common14 = require("@vue-skuilder/common");
|
|
8078
8124
|
init_logger();
|
|
8079
8125
|
duration = import_moment4.default.duration;
|
|
8080
8126
|
}
|
|
@@ -8149,25 +8195,40 @@ function recordTagPresentations(userElo, perf, records, cardId, at) {
|
|
|
8149
8195
|
if (typeof score !== "number") continue;
|
|
8150
8196
|
const rank = userElo.tags[tag] ?? { score: userElo.global.score, count: 0 };
|
|
8151
8197
|
const entry = { at, ok, perf: score, card: cardId };
|
|
8152
|
-
userElo.tags[tag] = (0,
|
|
8198
|
+
userElo.tags[tag] = (0, import_common15.pushTagPresentation)(rank, entry);
|
|
8153
8199
|
written.push(tag);
|
|
8154
8200
|
}
|
|
8155
8201
|
return written;
|
|
8156
8202
|
}
|
|
8157
|
-
var
|
|
8203
|
+
var import_common15;
|
|
8158
8204
|
var init_tagRecent = __esm({
|
|
8159
8205
|
"src/study/services/tagRecent.ts"() {
|
|
8160
8206
|
"use strict";
|
|
8161
|
-
|
|
8207
|
+
import_common15 = require("@vue-skuilder/common");
|
|
8162
8208
|
}
|
|
8163
8209
|
});
|
|
8164
8210
|
|
|
8165
8211
|
// src/study/services/EloService.ts
|
|
8166
|
-
|
|
8212
|
+
function withCountOnlyRoles(perf, cardId) {
|
|
8213
|
+
const out = { ...perf };
|
|
8214
|
+
const counted = [];
|
|
8215
|
+
for (const [tag, score] of Object.entries(perf)) {
|
|
8216
|
+
if (tag === "_global" || score === null || !(0, import_common16.isCountOnlyTag)(tag)) continue;
|
|
8217
|
+
out[tag] = null;
|
|
8218
|
+
counted.push(tag);
|
|
8219
|
+
}
|
|
8220
|
+
if (counted.length) {
|
|
8221
|
+
logger.warn(
|
|
8222
|
+
`[EloService] ${cardId} sent scores for bookkeeping tags [${counted.join(", ")}]; counted, not graded`
|
|
8223
|
+
);
|
|
8224
|
+
}
|
|
8225
|
+
return out;
|
|
8226
|
+
}
|
|
8227
|
+
var import_common16, EloService;
|
|
8167
8228
|
var init_EloService = __esm({
|
|
8168
8229
|
"src/study/services/EloService.ts"() {
|
|
8169
8230
|
"use strict";
|
|
8170
|
-
|
|
8231
|
+
import_common16 = require("@vue-skuilder/common");
|
|
8171
8232
|
init_logger();
|
|
8172
8233
|
init_tagRecent();
|
|
8173
8234
|
EloService = class {
|
|
@@ -8200,7 +8261,7 @@ var init_EloService = __esm({
|
|
|
8200
8261
|
);
|
|
8201
8262
|
return null;
|
|
8202
8263
|
}
|
|
8203
|
-
const userElo = (0,
|
|
8264
|
+
const userElo = (0, import_common16.toCourseElo)(courseReg.elo);
|
|
8204
8265
|
const cardElo = (await courseDB.getCardEloData([currentCard.card.card_id]))[0];
|
|
8205
8266
|
if (cardElo && userElo) {
|
|
8206
8267
|
const beforeUserGlobal = userElo.global.score;
|
|
@@ -8210,14 +8271,15 @@ var init_EloService = __esm({
|
|
|
8210
8271
|
for (const tag of cardTagKeys) {
|
|
8211
8272
|
beforeUserTag[tag] = userElo.tags[tag]?.score ?? userElo.global.score;
|
|
8212
8273
|
}
|
|
8213
|
-
const eloUpdate = (0,
|
|
8274
|
+
const eloUpdate = (0, import_common16.adjustCourseScores)(userElo, cardElo, userScore);
|
|
8214
8275
|
courseReg.elo = eloUpdate.userElo;
|
|
8215
8276
|
const tags = {};
|
|
8216
8277
|
for (const tag of cardTagKeys) {
|
|
8278
|
+
const countOnly = (0, import_common16.isCountOnlyTag)(tag);
|
|
8217
8279
|
tags[tag] = {
|
|
8218
8280
|
before: beforeUserTag[tag],
|
|
8219
|
-
after: eloUpdate.userElo.tags[tag].score,
|
|
8220
|
-
score: userScore
|
|
8281
|
+
after: countOnly ? beforeUserTag[tag] : eloUpdate.userElo.tags[tag].score,
|
|
8282
|
+
score: countOnly ? null : userScore
|
|
8221
8283
|
};
|
|
8222
8284
|
}
|
|
8223
8285
|
const event = {
|
|
@@ -8281,18 +8343,19 @@ var init_EloService = __esm({
|
|
|
8281
8343
|
);
|
|
8282
8344
|
return null;
|
|
8283
8345
|
}
|
|
8284
|
-
const userElo = (0,
|
|
8346
|
+
const userElo = (0, import_common16.toCourseElo)(courseReg.elo);
|
|
8285
8347
|
const [cardEloResults, cardTagsMap] = await Promise.all([
|
|
8286
8348
|
courseDB.getCardEloData([currentCard.card.card_id]),
|
|
8287
8349
|
courseDB.getAppliedTagsBatch([card_id])
|
|
8288
8350
|
]);
|
|
8289
8351
|
const cardElo = cardEloResults[0];
|
|
8290
8352
|
const cardTags = cardTagsMap.get(card_id) ?? [];
|
|
8291
|
-
const
|
|
8353
|
+
const graded = withCountOnlyRoles(taggedPerformance, card_id);
|
|
8354
|
+
const enriched = { ...graded };
|
|
8292
8355
|
const globalScore = taggedPerformance._global;
|
|
8293
8356
|
for (const tag of cardTags) {
|
|
8294
8357
|
if (!(tag in enriched)) {
|
|
8295
|
-
enriched[tag] = globalScore;
|
|
8358
|
+
enriched[tag] = (0, import_common16.isCountOnlyTag)(tag) ? null : globalScore;
|
|
8296
8359
|
}
|
|
8297
8360
|
}
|
|
8298
8361
|
if (cardElo && userElo) {
|
|
@@ -8303,11 +8366,11 @@ var init_EloService = __esm({
|
|
|
8303
8366
|
for (const tag of touchedTags) {
|
|
8304
8367
|
beforeUserTag[tag] = userElo.tags[tag]?.score ?? userElo.global.score;
|
|
8305
8368
|
}
|
|
8306
|
-
const eloUpdate = (0,
|
|
8369
|
+
const eloUpdate = (0, import_common16.adjustCourseScoresPerTag)(userElo, cardElo, enriched);
|
|
8307
8370
|
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
8308
8371
|
const recorded = recordTagPresentations(
|
|
8309
8372
|
eloUpdate.userElo,
|
|
8310
|
-
|
|
8373
|
+
graded,
|
|
8311
8374
|
currentCard.records,
|
|
8312
8375
|
card_id,
|
|
8313
8376
|
at
|
|
@@ -8370,13 +8433,13 @@ var init_EloService = __esm({
|
|
|
8370
8433
|
});
|
|
8371
8434
|
|
|
8372
8435
|
// src/study/services/ResponseProcessor.ts
|
|
8373
|
-
var
|
|
8436
|
+
var import_common17, ResponseProcessor;
|
|
8374
8437
|
var init_ResponseProcessor = __esm({
|
|
8375
8438
|
"src/study/services/ResponseProcessor.ts"() {
|
|
8376
8439
|
"use strict";
|
|
8377
8440
|
init_core();
|
|
8378
8441
|
init_logger();
|
|
8379
|
-
|
|
8442
|
+
import_common17 = require("@vue-skuilder/common");
|
|
8380
8443
|
ResponseProcessor = class {
|
|
8381
8444
|
srsService;
|
|
8382
8445
|
eloService;
|
|
@@ -8419,7 +8482,7 @@ var init_ResponseProcessor = __esm({
|
|
|
8419
8482
|
taggedPerformance: null
|
|
8420
8483
|
};
|
|
8421
8484
|
}
|
|
8422
|
-
if ((0,
|
|
8485
|
+
if ((0, import_common17.isTaggedPerformance)(performance2)) {
|
|
8423
8486
|
return {
|
|
8424
8487
|
globalScore: performance2._global,
|
|
8425
8488
|
taggedPerformance: performance2
|
|
@@ -8722,11 +8785,11 @@ function prefetchAudio(url) {
|
|
|
8722
8785
|
audio.src = url;
|
|
8723
8786
|
});
|
|
8724
8787
|
}
|
|
8725
|
-
var
|
|
8788
|
+
var import_common18, CardHydrationService;
|
|
8726
8789
|
var init_CardHydrationService = __esm({
|
|
8727
8790
|
"src/study/services/CardHydrationService.ts"() {
|
|
8728
8791
|
"use strict";
|
|
8729
|
-
|
|
8792
|
+
import_common18 = require("@vue-skuilder/common");
|
|
8730
8793
|
init_logger();
|
|
8731
8794
|
CardHydrationService = class {
|
|
8732
8795
|
constructor(getViewComponent, getCourseDB3, getItemsToHydrate) {
|
|
@@ -8839,8 +8902,8 @@ var init_CardHydrationService = __esm({
|
|
|
8839
8902
|
courseDB.getCourseDoc(item.cardID),
|
|
8840
8903
|
courseDB.getAppliedTagsBatch([item.cardID])
|
|
8841
8904
|
]);
|
|
8842
|
-
if (!(0,
|
|
8843
|
-
cardData.elo = (0,
|
|
8905
|
+
if (!(0, import_common18.isCourseElo)(cardData.elo)) {
|
|
8906
|
+
cardData.elo = (0, import_common18.toCourseElo)(cardData.elo);
|
|
8844
8907
|
}
|
|
8845
8908
|
const view = this.getViewComponent(cardData.id_view);
|
|
8846
8909
|
const dataDocs = await Promise.all(
|
|
@@ -8864,9 +8927,9 @@ var init_CardHydrationService = __esm({
|
|
|
8864
8927
|
);
|
|
8865
8928
|
await Promise.allSettled(uniqueAudioUrls.map(prefetchAudio));
|
|
8866
8929
|
}
|
|
8867
|
-
const data = dataDocs.map(
|
|
8930
|
+
const data = dataDocs.map(import_common18.displayableDataToViewData).reverse();
|
|
8868
8931
|
this.hydratedCards.set(item.cardID, {
|
|
8869
|
-
item: { ...item, elo: (0,
|
|
8932
|
+
item: { ...item, elo: (0, import_common18.toCourseElo)(cardData.elo).global.score },
|
|
8870
8933
|
view,
|
|
8871
8934
|
data,
|
|
8872
8935
|
tags: tagsByCard.get(item.cardID) ?? []
|
|
@@ -11592,7 +11655,9 @@ function toRunCard(c) {
|
|
|
11592
11655
|
cardId: c.cardId,
|
|
11593
11656
|
origin: c.origin,
|
|
11594
11657
|
...c.generator ? { generator: c.generator } : {},
|
|
11595
|
-
|
|
11658
|
+
...c.required ? { required: c.required } : {},
|
|
11659
|
+
// A required card's score is infinite, which JSON can't hold: say so with null.
|
|
11660
|
+
score: Number.isFinite(c.finalScore) ? sig4(c.finalScore) : null,
|
|
11596
11661
|
selected: c.selected
|
|
11597
11662
|
};
|
|
11598
11663
|
}
|
|
@@ -12922,11 +12987,11 @@ var init_SessionController = __esm({
|
|
|
12922
12987
|
});
|
|
12923
12988
|
|
|
12924
12989
|
// src/study/TagFilteredContentSource.ts
|
|
12925
|
-
var
|
|
12990
|
+
var import_common19, TagFilteredContentSource;
|
|
12926
12991
|
var init_TagFilteredContentSource = __esm({
|
|
12927
12992
|
"src/study/TagFilteredContentSource.ts"() {
|
|
12928
12993
|
"use strict";
|
|
12929
|
-
|
|
12994
|
+
import_common19 = require("@vue-skuilder/common");
|
|
12930
12995
|
init_courseDB();
|
|
12931
12996
|
init_logger();
|
|
12932
12997
|
TagFilteredContentSource = class {
|
|
@@ -13012,7 +13077,7 @@ var init_TagFilteredContentSource = __esm({
|
|
|
13012
13077
|
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
13013
13078
|
*/
|
|
13014
13079
|
async getWeightedCards(limit) {
|
|
13015
|
-
if (!(0,
|
|
13080
|
+
if (!(0, import_common19.hasActiveFilter)(this.filter)) {
|
|
13016
13081
|
logger.warn("[TagFilteredContentSource] getWeightedCards called with no active filter");
|
|
13017
13082
|
return { cards: [] };
|
|
13018
13083
|
}
|
|
@@ -13450,13 +13515,13 @@ async function dropUserFromClassroom(user, classID) {
|
|
|
13450
13515
|
async function getUserClassrooms(user) {
|
|
13451
13516
|
return getOrCreateClassroomRegistrationsDoc(user);
|
|
13452
13517
|
}
|
|
13453
|
-
var
|
|
13518
|
+
var import_common20, import_moment8, log4, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
|
|
13454
13519
|
var init_BaseUserDB = __esm({
|
|
13455
13520
|
"src/impl/common/BaseUserDB.ts"() {
|
|
13456
13521
|
"use strict";
|
|
13457
13522
|
init_core();
|
|
13458
13523
|
init_util();
|
|
13459
|
-
|
|
13524
|
+
import_common20 = require("@vue-skuilder/common");
|
|
13460
13525
|
import_moment8 = __toESM(require("moment"), 1);
|
|
13461
13526
|
init_types_legacy();
|
|
13462
13527
|
init_logger();
|
|
@@ -13559,7 +13624,7 @@ Currently logged-in as ${this._username}.`
|
|
|
13559
13624
|
);
|
|
13560
13625
|
}
|
|
13561
13626
|
const result = await this.syncStrategy.createAccount(username, password);
|
|
13562
|
-
if (result.status ===
|
|
13627
|
+
if (result.status === import_common20.Status.ok) {
|
|
13563
13628
|
log4(`Account created successfully, updating username to ${username}`);
|
|
13564
13629
|
this._username = username;
|
|
13565
13630
|
try {
|
|
@@ -13635,7 +13700,7 @@ Currently logged-in as ${this._username}.`
|
|
|
13635
13700
|
async resetUserData() {
|
|
13636
13701
|
if (this.syncStrategy.canAuthenticate()) {
|
|
13637
13702
|
return {
|
|
13638
|
-
status:
|
|
13703
|
+
status: import_common20.Status.error,
|
|
13639
13704
|
error: "Reset user data is only available for local-only mode. Use logout instead for remote sync."
|
|
13640
13705
|
};
|
|
13641
13706
|
}
|
|
@@ -13657,11 +13722,11 @@ Currently logged-in as ${this._username}.`
|
|
|
13657
13722
|
await localDB.bulkDocs(docsToDelete);
|
|
13658
13723
|
}
|
|
13659
13724
|
await this.init();
|
|
13660
|
-
return { status:
|
|
13725
|
+
return { status: import_common20.Status.ok };
|
|
13661
13726
|
} catch (error) {
|
|
13662
13727
|
logger.error("Failed to reset user data:", error);
|
|
13663
13728
|
return {
|
|
13664
|
-
status:
|
|
13729
|
+
status: import_common20.Status.error,
|
|
13665
13730
|
error: error instanceof Error ? error.message : "Unknown error during reset"
|
|
13666
13731
|
};
|
|
13667
13732
|
}
|
|
@@ -15074,11 +15139,11 @@ var init_StaticDataUnpacker = __esm({
|
|
|
15074
15139
|
});
|
|
15075
15140
|
|
|
15076
15141
|
// src/impl/static/courseDB.ts
|
|
15077
|
-
var
|
|
15142
|
+
var import_common22, StaticCourseDB;
|
|
15078
15143
|
var init_courseDB2 = __esm({
|
|
15079
15144
|
"src/impl/static/courseDB.ts"() {
|
|
15080
15145
|
"use strict";
|
|
15081
|
-
|
|
15146
|
+
import_common22 = require("@vue-skuilder/common");
|
|
15082
15147
|
init_types_legacy();
|
|
15083
15148
|
init_logger();
|
|
15084
15149
|
init_defaults();
|
|
@@ -15339,7 +15404,7 @@ var init_courseDB2 = __esm({
|
|
|
15339
15404
|
}
|
|
15340
15405
|
async addNote(_codeCourse, _shape, _data, _author, _tags, _uploads, _elo) {
|
|
15341
15406
|
return {
|
|
15342
|
-
status:
|
|
15407
|
+
status: import_common22.Status.error,
|
|
15343
15408
|
message: "Cannot add notes in static mode"
|
|
15344
15409
|
};
|
|
15345
15410
|
}
|
|
@@ -15759,19 +15824,19 @@ async function getStudySource(source, user) {
|
|
|
15759
15824
|
if (source.type === "classroom") {
|
|
15760
15825
|
return await StudentClassroomDB.factory(source.id, user);
|
|
15761
15826
|
} else {
|
|
15762
|
-
if ((0,
|
|
15827
|
+
if ((0, import_common26.hasActiveFilter)(source.tagFilter)) {
|
|
15763
15828
|
return new TagFilteredContentSource(source.id, source.tagFilter, user);
|
|
15764
15829
|
}
|
|
15765
15830
|
return getDataLayer().getCourseDB(source.id);
|
|
15766
15831
|
}
|
|
15767
15832
|
}
|
|
15768
|
-
var
|
|
15833
|
+
var import_common26;
|
|
15769
15834
|
var init_contentSource = __esm({
|
|
15770
15835
|
"src/core/interfaces/contentSource.ts"() {
|
|
15771
15836
|
"use strict";
|
|
15772
15837
|
init_factory();
|
|
15773
15838
|
init_classroomDB2();
|
|
15774
|
-
|
|
15839
|
+
import_common26 = require("@vue-skuilder/common");
|
|
15775
15840
|
init_TagFilteredContentSource();
|
|
15776
15841
|
}
|
|
15777
15842
|
});
|
|
@@ -15911,7 +15976,7 @@ elo: ${elo}`;
|
|
|
15911
15976
|
misc: {}
|
|
15912
15977
|
} : void 0
|
|
15913
15978
|
);
|
|
15914
|
-
if (result.status ===
|
|
15979
|
+
if (result.status === import_common27.Status.ok) {
|
|
15915
15980
|
return {
|
|
15916
15981
|
originalText,
|
|
15917
15982
|
status: "success",
|
|
@@ -15955,11 +16020,11 @@ function validateProcessorConfig(config) {
|
|
|
15955
16020
|
}
|
|
15956
16021
|
return { isValid: true };
|
|
15957
16022
|
}
|
|
15958
|
-
var
|
|
16023
|
+
var import_common27;
|
|
15959
16024
|
var init_cardProcessor = __esm({
|
|
15960
16025
|
"src/core/bulkImport/cardProcessor.ts"() {
|
|
15961
16026
|
"use strict";
|
|
15962
|
-
|
|
16027
|
+
import_common27 = require("@vue-skuilder/common");
|
|
15963
16028
|
init_logger();
|
|
15964
16029
|
}
|
|
15965
16030
|
});
|
|
@@ -16466,10 +16531,10 @@ init_regulators();
|
|
|
16466
16531
|
init_courseLookupDB();
|
|
16467
16532
|
|
|
16468
16533
|
// src/courseConfigRegistration.ts
|
|
16469
|
-
var
|
|
16534
|
+
var import_common28 = require("@vue-skuilder/common");
|
|
16470
16535
|
init_logger();
|
|
16471
16536
|
function isDataShapeRegistered(dataShape, courseConfig) {
|
|
16472
|
-
const namespacedName =
|
|
16537
|
+
const namespacedName = import_common28.NameSpacer.getDataShapeString({
|
|
16473
16538
|
dataShape: dataShape.name,
|
|
16474
16539
|
course: dataShape.course
|
|
16475
16540
|
});
|
|
@@ -16477,7 +16542,7 @@ function isDataShapeRegistered(dataShape, courseConfig) {
|
|
|
16477
16542
|
return existingDataShape !== void 0;
|
|
16478
16543
|
}
|
|
16479
16544
|
function isDataShapeSchemaAvailable(dataShape, courseConfig) {
|
|
16480
|
-
const namespacedName =
|
|
16545
|
+
const namespacedName = import_common28.NameSpacer.getDataShapeString({
|
|
16481
16546
|
dataShape: dataShape.name,
|
|
16482
16547
|
course: dataShape.course
|
|
16483
16548
|
});
|
|
@@ -16485,7 +16550,7 @@ function isDataShapeSchemaAvailable(dataShape, courseConfig) {
|
|
|
16485
16550
|
return existingDataShape !== void 0 && existingDataShape.serializedZodSchema !== void 0;
|
|
16486
16551
|
}
|
|
16487
16552
|
function isQuestionTypeRegistered(question, courseConfig) {
|
|
16488
|
-
const namespacedName =
|
|
16553
|
+
const namespacedName = import_common28.NameSpacer.getQuestionString({
|
|
16489
16554
|
course: question.course,
|
|
16490
16555
|
questionType: question.name
|
|
16491
16556
|
});
|
|
@@ -16517,13 +16582,13 @@ function processCustomQuestionsData(customQuestions) {
|
|
|
16517
16582
|
return { dataShapes: processedDataShapes, questions: processedQuestions };
|
|
16518
16583
|
}
|
|
16519
16584
|
function registerDataShape(dataShape, courseConfig) {
|
|
16520
|
-
const namespacedName =
|
|
16585
|
+
const namespacedName = import_common28.NameSpacer.getDataShapeString({
|
|
16521
16586
|
dataShape: dataShape.name,
|
|
16522
16587
|
course: dataShape.course
|
|
16523
16588
|
});
|
|
16524
16589
|
let serializedZodSchema;
|
|
16525
16590
|
try {
|
|
16526
|
-
serializedZodSchema = (0,
|
|
16591
|
+
serializedZodSchema = (0, import_common28.toZodJSON)(dataShape.dataShape);
|
|
16527
16592
|
} catch (error) {
|
|
16528
16593
|
logger.warn(`Failed to generate schema for ${namespacedName}:`, error);
|
|
16529
16594
|
serializedZodSchema = void 0;
|
|
@@ -16568,7 +16633,7 @@ function registerQuestionType(question, courseConfig) {
|
|
|
16568
16633
|
logger.info(`QuestionType '${question.name}' from '${question.course}' already registered`);
|
|
16569
16634
|
return false;
|
|
16570
16635
|
}
|
|
16571
|
-
const namespacedQuestionName =
|
|
16636
|
+
const namespacedQuestionName = import_common28.NameSpacer.getQuestionString({
|
|
16572
16637
|
course: question.course,
|
|
16573
16638
|
questionType: question.name
|
|
16574
16639
|
});
|
|
@@ -16580,7 +16645,7 @@ function registerQuestionType(question, courseConfig) {
|
|
|
16580
16645
|
}
|
|
16581
16646
|
});
|
|
16582
16647
|
const dataShapeList = question.dataShapes.map(
|
|
16583
|
-
(dataShape) =>
|
|
16648
|
+
(dataShape) => import_common28.NameSpacer.getDataShapeString({
|
|
16584
16649
|
course: question.course,
|
|
16585
16650
|
dataShape: dataShape.name
|
|
16586
16651
|
})
|
|
@@ -16591,7 +16656,7 @@ function registerQuestionType(question, courseConfig) {
|
|
|
16591
16656
|
dataShapeList
|
|
16592
16657
|
});
|
|
16593
16658
|
question.dataShapes.forEach((dataShape) => {
|
|
16594
|
-
const namespacedDataShapeName =
|
|
16659
|
+
const namespacedDataShapeName = import_common28.NameSpacer.getDataShapeString({
|
|
16595
16660
|
course: question.course,
|
|
16596
16661
|
dataShape: dataShape.name
|
|
16597
16662
|
});
|