@vue-skuilder/db 0.2.30 → 0.2.32
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-B6FrSihy.d.cts → contentSource-CTQ4kWhR.d.cts} +41 -4
- package/dist/{contentSource-CqJmbOZN.d.ts → contentSource-JmWYu8IK.d.ts} +41 -4
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +138 -79
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +90 -30
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-DUxDqMtZ.d.cts → dataLayerProvider-DfI_KYAe.d.cts} +1 -1
- package/dist/{dataLayerProvider-B9_UCvkR.d.ts → dataLayerProvider-rlLE2Mf-.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 +171 -135
- package/dist/diagnostics/index.js.map +1 -1
- package/dist/diagnostics/index.mjs +168 -135
- package/dist/diagnostics/index.mjs.map +1 -1
- package/dist/impl/couch/index.d.cts +8 -2
- package/dist/impl/couch/index.d.ts +8 -2
- package/dist/impl/couch/index.js +142 -83
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +90 -30
- 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 +129 -70
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +90 -30
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +204 -114
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +128 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/navigators/Pipeline.ts +13 -2
- package/src/core/navigators/PipelineAssembler.ts +2 -0
- package/src/core/navigators/PipelineDebugger.ts +54 -23
- package/src/core/navigators/defaults.ts +4 -1
- package/src/core/navigators/filters/eloDistance.ts +7 -8
- package/src/core/navigators/generators/elo.ts +8 -2
- package/src/core/navigators/generators/prescribed.ts +7 -5
- package/src/core/types/studySession.ts +23 -2
- package/src/core/versionStamps.ts +66 -0
- package/src/diagnostics/derive.ts +5 -2
- package/src/diagnostics/pipeline.ts +28 -0
- package/src/diagnostics/text.ts +24 -4
- package/src/factory.ts +6 -0
- package/src/study/SessionController.ts +6 -1
- package/src/study/services/EloService.ts +33 -6
- package/tsup.config.ts +5 -0
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();
|
|
@@ -3319,7 +3329,9 @@ function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
|
|
|
3319
3329
|
const tags = [];
|
|
3320
3330
|
for (const tag of cardTags) {
|
|
3321
3331
|
const user = userElo.tags[tag];
|
|
3322
|
-
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
|
+
}
|
|
3323
3335
|
const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
|
|
3324
3336
|
tags.push({
|
|
3325
3337
|
tag,
|
|
@@ -3391,11 +3403,12 @@ function createEloDistanceFilter(config) {
|
|
|
3391
3403
|
transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
|
|
3392
3404
|
};
|
|
3393
3405
|
}
|
|
3394
|
-
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;
|
|
3395
3407
|
var init_eloDistance = __esm({
|
|
3396
3408
|
"src/core/navigators/filters/eloDistance.ts"() {
|
|
3397
3409
|
"use strict";
|
|
3398
3410
|
init_navigators();
|
|
3411
|
+
import_common7 = require("@vue-skuilder/common");
|
|
3399
3412
|
init_logger();
|
|
3400
3413
|
DEFAULT_ELO_DISTANCE_CONFIG = {
|
|
3401
3414
|
halfLife: 300,
|
|
@@ -3405,7 +3418,6 @@ var init_eloDistance = __esm({
|
|
|
3405
3418
|
minTagCount: 3
|
|
3406
3419
|
};
|
|
3407
3420
|
TAG_CONFIDENCE_HALF = 10;
|
|
3408
|
-
COUNT_ONLY_SENTINEL = -1;
|
|
3409
3421
|
DEFAULT_CARD_ELO = 1e3;
|
|
3410
3422
|
MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
|
|
3411
3423
|
multiDimElo = readMultiDimElo();
|
|
@@ -3448,12 +3460,12 @@ var hierarchyDefinition_exports = {};
|
|
|
3448
3460
|
__export(hierarchyDefinition_exports, {
|
|
3449
3461
|
default: () => HierarchyDefinitionNavigator
|
|
3450
3462
|
});
|
|
3451
|
-
var
|
|
3463
|
+
var import_common8, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
|
|
3452
3464
|
var init_hierarchyDefinition = __esm({
|
|
3453
3465
|
"src/core/navigators/filters/hierarchyDefinition.ts"() {
|
|
3454
3466
|
"use strict";
|
|
3455
3467
|
init_navigators();
|
|
3456
|
-
|
|
3468
|
+
import_common8 = require("@vue-skuilder/common");
|
|
3457
3469
|
init_logger();
|
|
3458
3470
|
DEFAULT_MIN_COUNT2 = 3;
|
|
3459
3471
|
HierarchyDefinitionNavigator = class _HierarchyDefinitionNavigator extends ContentNavigator {
|
|
@@ -3503,7 +3515,7 @@ var init_hierarchyDefinition = __esm({
|
|
|
3503
3515
|
const mastered = /* @__PURE__ */ new Set();
|
|
3504
3516
|
try {
|
|
3505
3517
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3506
|
-
const userElo = (0,
|
|
3518
|
+
const userElo = (0, import_common8.toCourseElo)(courseReg.elo);
|
|
3507
3519
|
for (const prereqs of Object.values(this.config.prerequisites)) {
|
|
3508
3520
|
for (const prereq of prereqs) {
|
|
3509
3521
|
const tagElo = userElo.tags[prereq.tag];
|
|
@@ -3875,12 +3887,12 @@ var interferenceMitigator_exports = {};
|
|
|
3875
3887
|
__export(interferenceMitigator_exports, {
|
|
3876
3888
|
default: () => InterferenceMitigatorNavigator
|
|
3877
3889
|
});
|
|
3878
|
-
var
|
|
3890
|
+
var import_common9, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
|
|
3879
3891
|
var init_interferenceMitigator = __esm({
|
|
3880
3892
|
"src/core/navigators/filters/interferenceMitigator.ts"() {
|
|
3881
3893
|
"use strict";
|
|
3882
3894
|
init_navigators();
|
|
3883
|
-
|
|
3895
|
+
import_common9 = require("@vue-skuilder/common");
|
|
3884
3896
|
DEFAULT_MIN_COUNT3 = 10;
|
|
3885
3897
|
DEFAULT_MIN_ELAPSED_DAYS = 3;
|
|
3886
3898
|
DEFAULT_INTERFERENCE_DECAY = 0.8;
|
|
@@ -3965,7 +3977,7 @@ var init_interferenceMitigator = __esm({
|
|
|
3965
3977
|
const immature = /* @__PURE__ */ new Set();
|
|
3966
3978
|
try {
|
|
3967
3979
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3968
|
-
const userElo = (0,
|
|
3980
|
+
const userElo = (0, import_common9.toCourseElo)(courseReg.elo);
|
|
3969
3981
|
const minCount = this.config.maturityThreshold?.minCount ?? DEFAULT_MIN_COUNT3;
|
|
3970
3982
|
const minElo = this.config.maturityThreshold?.minElo;
|
|
3971
3983
|
const minElapsedDays = this.config.maturityThreshold?.minElapsedDays ?? DEFAULT_MIN_ELAPSED_DAYS;
|
|
@@ -4756,11 +4768,11 @@ function logCardProvenance(cards, maxCards = 3) {
|
|
|
4756
4768
|
}
|
|
4757
4769
|
}
|
|
4758
4770
|
}
|
|
4759
|
-
var
|
|
4771
|
+
var import_common10, VERBOSE_RESULTS, Pipeline;
|
|
4760
4772
|
var init_Pipeline = __esm({
|
|
4761
4773
|
"src/core/navigators/Pipeline.ts"() {
|
|
4762
4774
|
"use strict";
|
|
4763
|
-
|
|
4775
|
+
import_common10 = require("@vue-skuilder/common");
|
|
4764
4776
|
init_navigators();
|
|
4765
4777
|
init_logger();
|
|
4766
4778
|
init_orchestration();
|
|
@@ -4780,6 +4792,11 @@ var init_Pipeline = __esm({
|
|
|
4780
4792
|
* This eliminates a remote getCourseConfig() round trip per pipeline run.
|
|
4781
4793
|
*/
|
|
4782
4794
|
_cachedOrchestration = null;
|
|
4795
|
+
/**
|
|
4796
|
+
* Hash of the strategy docs this pipeline was assembled from (see
|
|
4797
|
+
* versionStamps.ts), set by whoever builds it. Stamped on every run.
|
|
4798
|
+
*/
|
|
4799
|
+
strategyHash;
|
|
4783
4800
|
/**
|
|
4784
4801
|
* Persistent tag cache. Maps cardId → tag names.
|
|
4785
4802
|
*
|
|
@@ -4973,7 +4990,8 @@ var init_Pipeline = __esm({
|
|
|
4973
4990
|
logResultCards(result);
|
|
4974
4991
|
logCardProvenance(result, 3);
|
|
4975
4992
|
try {
|
|
4976
|
-
const
|
|
4993
|
+
const courseConfig = await this.course?.getCourseConfig().catch(() => void 0);
|
|
4994
|
+
const courseName = courseConfig?.name;
|
|
4977
4995
|
const report = buildRunReport(
|
|
4978
4996
|
this.course?.getCourseID() || "unknown",
|
|
4979
4997
|
courseName,
|
|
@@ -4988,7 +5006,11 @@ var init_Pipeline = __esm({
|
|
|
4988
5006
|
scoredCards,
|
|
4989
5007
|
regulators
|
|
4990
5008
|
);
|
|
4991
|
-
|
|
5009
|
+
const versions = {
|
|
5010
|
+
...this.strategyHash ? { strategies: this.strategyHash } : {},
|
|
5011
|
+
...courseConfig?.contentVersion ? { content: courseConfig.contentVersion } : {}
|
|
5012
|
+
};
|
|
5013
|
+
captureRun({ ...report, ...Object.keys(versions).length ? { versions } : {} });
|
|
4992
5014
|
} catch (e) {
|
|
4993
5015
|
logger.debug(`[Pipeline] Failed to capture debug run: ${e}`);
|
|
4994
5016
|
}
|
|
@@ -5249,7 +5271,7 @@ var init_Pipeline = __esm({
|
|
|
5249
5271
|
let userCourseElo;
|
|
5250
5272
|
try {
|
|
5251
5273
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
5252
|
-
userCourseElo = (0,
|
|
5274
|
+
userCourseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
5253
5275
|
userElo = userCourseElo.global.score;
|
|
5254
5276
|
} catch (e) {
|
|
5255
5277
|
logger.debug(`[Pipeline] Could not get user ELO, using default: ${e}`);
|
|
@@ -5311,7 +5333,7 @@ var init_Pipeline = __esm({
|
|
|
5311
5333
|
*/
|
|
5312
5334
|
async getTagEloStatus(tagFilter) {
|
|
5313
5335
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
5314
|
-
const courseElo = (0,
|
|
5336
|
+
const courseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
5315
5337
|
const result = {};
|
|
5316
5338
|
if (!tagFilter) {
|
|
5317
5339
|
for (const [tag, data] of Object.entries(courseElo.tags)) {
|
|
@@ -5485,6 +5507,43 @@ var init_Pipeline = __esm({
|
|
|
5485
5507
|
}
|
|
5486
5508
|
});
|
|
5487
5509
|
|
|
5510
|
+
// src/core/versionStamps.ts
|
|
5511
|
+
function setAppVersion(version) {
|
|
5512
|
+
hostAppVersion = version;
|
|
5513
|
+
}
|
|
5514
|
+
function sessionVersions() {
|
|
5515
|
+
return { framework: FRAMEWORK_VERSION, ...hostAppVersion ? { app: hostAppVersion } : {} };
|
|
5516
|
+
}
|
|
5517
|
+
function stableStringify(value) {
|
|
5518
|
+
if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
|
|
5519
|
+
if (value && typeof value === "object") {
|
|
5520
|
+
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
5521
|
+
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(",")}}`;
|
|
5522
|
+
}
|
|
5523
|
+
return JSON.stringify(value);
|
|
5524
|
+
}
|
|
5525
|
+
function strategyHash(strategies) {
|
|
5526
|
+
if (strategies.length === 0) return DEFAULT_STRATEGY_HASH;
|
|
5527
|
+
const text = strategies.map((s) => {
|
|
5528
|
+
const { _rev: _ignored, ...rest } = s;
|
|
5529
|
+
return stableStringify(rest);
|
|
5530
|
+
}).sort().join("\n");
|
|
5531
|
+
let h = 2166136261;
|
|
5532
|
+
for (let i = 0; i < text.length; i++) {
|
|
5533
|
+
h ^= text.charCodeAt(i);
|
|
5534
|
+
h = Math.imul(h, 16777619);
|
|
5535
|
+
}
|
|
5536
|
+
return (h >>> 0).toString(16).padStart(8, "0");
|
|
5537
|
+
}
|
|
5538
|
+
var FRAMEWORK_VERSION, hostAppVersion, DEFAULT_STRATEGY_HASH;
|
|
5539
|
+
var init_versionStamps = __esm({
|
|
5540
|
+
"src/core/versionStamps.ts"() {
|
|
5541
|
+
"use strict";
|
|
5542
|
+
FRAMEWORK_VERSION = true ? "0.2.32" : "dev";
|
|
5543
|
+
DEFAULT_STRATEGY_HASH = "default";
|
|
5544
|
+
}
|
|
5545
|
+
});
|
|
5546
|
+
|
|
5488
5547
|
// src/core/navigators/defaults.ts
|
|
5489
5548
|
var defaults_exports = {};
|
|
5490
5549
|
__export(defaults_exports, {
|
|
@@ -5537,7 +5596,9 @@ function createDefaultPipeline(user, course) {
|
|
|
5537
5596
|
course,
|
|
5538
5597
|
createDefaultEloDistanceStrategy(courseId)
|
|
5539
5598
|
);
|
|
5540
|
-
|
|
5599
|
+
const pipeline = new Pipeline(compositeGenerator, [eloDistanceFilter], user, course);
|
|
5600
|
+
pipeline.strategyHash = DEFAULT_STRATEGY_HASH;
|
|
5601
|
+
return pipeline;
|
|
5541
5602
|
}
|
|
5542
5603
|
var init_defaults = __esm({
|
|
5543
5604
|
"src/core/navigators/defaults.ts"() {
|
|
@@ -5549,6 +5610,7 @@ var init_defaults = __esm({
|
|
|
5549
5610
|
init_srs();
|
|
5550
5611
|
init_eloDistance();
|
|
5551
5612
|
init_types_legacy();
|
|
5613
|
+
init_versionStamps();
|
|
5552
5614
|
}
|
|
5553
5615
|
});
|
|
5554
5616
|
|
|
@@ -5692,6 +5754,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5692
5754
|
init_logger();
|
|
5693
5755
|
init_CompositeGenerator();
|
|
5694
5756
|
init_pipelinePlan();
|
|
5757
|
+
init_versionStamps();
|
|
5695
5758
|
PipelineAssembler = class {
|
|
5696
5759
|
/**
|
|
5697
5760
|
* Assembles a navigation pipeline from strategy documents.
|
|
@@ -5773,6 +5836,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5773
5836
|
}
|
|
5774
5837
|
}
|
|
5775
5838
|
const pipeline = new Pipeline(generator, filters, user, course);
|
|
5839
|
+
pipeline.strategyHash = strategyHash(strategies);
|
|
5776
5840
|
logger.debug(
|
|
5777
5841
|
`[PipelineAssembler] Assembled pipeline with ${generatorStrategies.length} generator(s) and ${filters.length} filter(s)`
|
|
5778
5842
|
);
|
|
@@ -6212,11 +6276,11 @@ ${JSON.stringify(config)}
|
|
|
6212
6276
|
function isSuccessRow(row) {
|
|
6213
6277
|
return "doc" in row && row.doc !== null && row.doc !== void 0;
|
|
6214
6278
|
}
|
|
6215
|
-
var
|
|
6279
|
+
var import_common11, CoursesDB, CourseDB;
|
|
6216
6280
|
var init_courseDB = __esm({
|
|
6217
6281
|
"src/impl/couch/courseDB.ts"() {
|
|
6218
6282
|
"use strict";
|
|
6219
|
-
|
|
6283
|
+
import_common11 = require("@vue-skuilder/common");
|
|
6220
6284
|
init_couch();
|
|
6221
6285
|
init_updateQueue();
|
|
6222
6286
|
init_types_legacy();
|
|
@@ -6365,14 +6429,14 @@ var init_courseDB = __esm({
|
|
|
6365
6429
|
docs.rows.forEach((r) => {
|
|
6366
6430
|
if (isSuccessRow(r)) {
|
|
6367
6431
|
if (r.doc && r.doc.elo) {
|
|
6368
|
-
ret.push((0,
|
|
6432
|
+
ret.push((0, import_common11.toCourseElo)(r.doc.elo));
|
|
6369
6433
|
} else {
|
|
6370
6434
|
logger.warn("no elo data for card: " + r.id);
|
|
6371
|
-
ret.push((0,
|
|
6435
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6372
6436
|
}
|
|
6373
6437
|
} else {
|
|
6374
6438
|
logger.warn("no elo data for card: " + JSON.stringify(r));
|
|
6375
|
-
ret.push((0,
|
|
6439
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6376
6440
|
}
|
|
6377
6441
|
});
|
|
6378
6442
|
return ret;
|
|
@@ -6575,7 +6639,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6575
6639
|
async getCourseTagStubs() {
|
|
6576
6640
|
return getCourseTagStubs(this.id);
|
|
6577
6641
|
}
|
|
6578
|
-
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0,
|
|
6642
|
+
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common11.blankCourseElo)()) {
|
|
6579
6643
|
try {
|
|
6580
6644
|
const resp = await addNote55(this.id, codeCourse, shape, data, author, tags, uploads, elo);
|
|
6581
6645
|
if (resp.ok) {
|
|
@@ -6584,19 +6648,19 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6584
6648
|
`[courseDB.addNote] Note added but card creation failed: ${resp.cardCreationError}`
|
|
6585
6649
|
);
|
|
6586
6650
|
return {
|
|
6587
|
-
status:
|
|
6651
|
+
status: import_common11.Status.error,
|
|
6588
6652
|
message: `Note was added but no cards were created: ${resp.cardCreationError}`,
|
|
6589
6653
|
id: resp.id
|
|
6590
6654
|
};
|
|
6591
6655
|
}
|
|
6592
6656
|
return {
|
|
6593
|
-
status:
|
|
6657
|
+
status: import_common11.Status.ok,
|
|
6594
6658
|
message: "",
|
|
6595
6659
|
id: resp.id
|
|
6596
6660
|
};
|
|
6597
6661
|
} else {
|
|
6598
6662
|
return {
|
|
6599
|
-
status:
|
|
6663
|
+
status: import_common11.Status.error,
|
|
6600
6664
|
message: "Unexpected error adding note"
|
|
6601
6665
|
};
|
|
6602
6666
|
}
|
|
@@ -6608,7 +6672,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6608
6672
|
message: ${err.message}`
|
|
6609
6673
|
);
|
|
6610
6674
|
return {
|
|
6611
|
-
status:
|
|
6675
|
+
status: import_common11.Status.error,
|
|
6612
6676
|
message: `Error adding note to course. ${e.reason || err.message}`
|
|
6613
6677
|
};
|
|
6614
6678
|
}
|
|
@@ -6802,7 +6866,7 @@ ${e.stack}` : JSON.stringify(e);
|
|
|
6802
6866
|
const courseDoc = (await u.getCourseRegistrationsDoc()).courses.find((c) => {
|
|
6803
6867
|
return c.courseID === this.id;
|
|
6804
6868
|
});
|
|
6805
|
-
targetElo = (0,
|
|
6869
|
+
targetElo = (0, import_common11.EloToNumber)(courseDoc.elo);
|
|
6806
6870
|
} catch {
|
|
6807
6871
|
targetElo = 1e3;
|
|
6808
6872
|
}
|
|
@@ -7633,14 +7697,14 @@ var CouchDBSyncStrategy_exports = {};
|
|
|
7633
7697
|
__export(CouchDBSyncStrategy_exports, {
|
|
7634
7698
|
CouchDBSyncStrategy: () => CouchDBSyncStrategy
|
|
7635
7699
|
});
|
|
7636
|
-
var
|
|
7700
|
+
var import_common12, log2, CouchDBSyncStrategy;
|
|
7637
7701
|
var init_CouchDBSyncStrategy = __esm({
|
|
7638
7702
|
"src/impl/couch/CouchDBSyncStrategy.ts"() {
|
|
7639
7703
|
"use strict";
|
|
7640
7704
|
init_factory();
|
|
7641
7705
|
init_types_legacy();
|
|
7642
7706
|
init_logger();
|
|
7643
|
-
|
|
7707
|
+
import_common12 = require("@vue-skuilder/common");
|
|
7644
7708
|
init_common();
|
|
7645
7709
|
init_pouchdb_setup();
|
|
7646
7710
|
init_couch();
|
|
@@ -7781,32 +7845,32 @@ var init_CouchDBSyncStrategy = __esm({
|
|
|
7781
7845
|
}
|
|
7782
7846
|
}
|
|
7783
7847
|
return {
|
|
7784
|
-
status:
|
|
7848
|
+
status: import_common12.Status.ok,
|
|
7785
7849
|
error: void 0
|
|
7786
7850
|
};
|
|
7787
7851
|
} else {
|
|
7788
7852
|
return {
|
|
7789
|
-
status:
|
|
7853
|
+
status: import_common12.Status.error,
|
|
7790
7854
|
error: "Failed to log in after account creation"
|
|
7791
7855
|
};
|
|
7792
7856
|
}
|
|
7793
7857
|
} else {
|
|
7794
7858
|
logger.warn(`Signup not OK: ${JSON.stringify(signupRequest)}`);
|
|
7795
7859
|
return {
|
|
7796
|
-
status:
|
|
7860
|
+
status: import_common12.Status.error,
|
|
7797
7861
|
error: "Account creation failed"
|
|
7798
7862
|
};
|
|
7799
7863
|
}
|
|
7800
7864
|
} catch (e) {
|
|
7801
7865
|
if (e.reason === "Document update conflict.") {
|
|
7802
7866
|
return {
|
|
7803
|
-
status:
|
|
7867
|
+
status: import_common12.Status.error,
|
|
7804
7868
|
error: "This username is taken!"
|
|
7805
7869
|
};
|
|
7806
7870
|
}
|
|
7807
7871
|
logger.error(`Error on signup: ${JSON.stringify(e)}`);
|
|
7808
7872
|
return {
|
|
7809
|
-
status:
|
|
7873
|
+
status: import_common12.Status.error,
|
|
7810
7874
|
error: e.message || "Unknown error during account creation"
|
|
7811
7875
|
};
|
|
7812
7876
|
}
|
|
@@ -8051,7 +8115,7 @@ function newQuestionInterval(user, cardHistory) {
|
|
|
8051
8115
|
}
|
|
8052
8116
|
if (currentAttempt.isCorrect) {
|
|
8053
8117
|
const rawPerf = currentAttempt.performance;
|
|
8054
|
-
const numericPerf = (0,
|
|
8118
|
+
const numericPerf = (0, import_common14.isTaggedPerformance)(rawPerf) ? rawPerf._global : rawPerf;
|
|
8055
8119
|
const skill = Math.min(1, Math.max(0, numericPerf));
|
|
8056
8120
|
logger.debug(`Demontrated skill: ${skill}`);
|
|
8057
8121
|
const interval = lastInterval * (0.75 + skill);
|
|
@@ -8102,13 +8166,13 @@ function secondsBetween(start, end) {
|
|
|
8102
8166
|
const ret = duration(end.diff(start)).asSeconds();
|
|
8103
8167
|
return ret;
|
|
8104
8168
|
}
|
|
8105
|
-
var import_moment4,
|
|
8169
|
+
var import_moment4, import_common14, duration;
|
|
8106
8170
|
var init_SpacedRepetition = __esm({
|
|
8107
8171
|
"src/study/SpacedRepetition.ts"() {
|
|
8108
8172
|
"use strict";
|
|
8109
8173
|
init_util();
|
|
8110
8174
|
import_moment4 = __toESM(require("moment"), 1);
|
|
8111
|
-
|
|
8175
|
+
import_common14 = require("@vue-skuilder/common");
|
|
8112
8176
|
init_logger();
|
|
8113
8177
|
duration = import_moment4.default.duration;
|
|
8114
8178
|
}
|
|
@@ -8183,25 +8247,40 @@ function recordTagPresentations(userElo, perf, records, cardId, at) {
|
|
|
8183
8247
|
if (typeof score !== "number") continue;
|
|
8184
8248
|
const rank = userElo.tags[tag] ?? { score: userElo.global.score, count: 0 };
|
|
8185
8249
|
const entry = { at, ok, perf: score, card: cardId };
|
|
8186
|
-
userElo.tags[tag] = (0,
|
|
8250
|
+
userElo.tags[tag] = (0, import_common15.pushTagPresentation)(rank, entry);
|
|
8187
8251
|
written.push(tag);
|
|
8188
8252
|
}
|
|
8189
8253
|
return written;
|
|
8190
8254
|
}
|
|
8191
|
-
var
|
|
8255
|
+
var import_common15;
|
|
8192
8256
|
var init_tagRecent = __esm({
|
|
8193
8257
|
"src/study/services/tagRecent.ts"() {
|
|
8194
8258
|
"use strict";
|
|
8195
|
-
|
|
8259
|
+
import_common15 = require("@vue-skuilder/common");
|
|
8196
8260
|
}
|
|
8197
8261
|
});
|
|
8198
8262
|
|
|
8199
8263
|
// src/study/services/EloService.ts
|
|
8200
|
-
|
|
8264
|
+
function withCountOnlyRoles(perf, cardId) {
|
|
8265
|
+
const out = { ...perf };
|
|
8266
|
+
const counted = [];
|
|
8267
|
+
for (const [tag, score] of Object.entries(perf)) {
|
|
8268
|
+
if (tag === "_global" || score === null || !(0, import_common16.isCountOnlyTag)(tag)) continue;
|
|
8269
|
+
out[tag] = null;
|
|
8270
|
+
counted.push(tag);
|
|
8271
|
+
}
|
|
8272
|
+
if (counted.length) {
|
|
8273
|
+
logger.warn(
|
|
8274
|
+
`[EloService] ${cardId} sent scores for bookkeeping tags [${counted.join(", ")}]; counted, not graded`
|
|
8275
|
+
);
|
|
8276
|
+
}
|
|
8277
|
+
return out;
|
|
8278
|
+
}
|
|
8279
|
+
var import_common16, EloService;
|
|
8201
8280
|
var init_EloService = __esm({
|
|
8202
8281
|
"src/study/services/EloService.ts"() {
|
|
8203
8282
|
"use strict";
|
|
8204
|
-
|
|
8283
|
+
import_common16 = require("@vue-skuilder/common");
|
|
8205
8284
|
init_logger();
|
|
8206
8285
|
init_tagRecent();
|
|
8207
8286
|
EloService = class {
|
|
@@ -8234,7 +8313,7 @@ var init_EloService = __esm({
|
|
|
8234
8313
|
);
|
|
8235
8314
|
return null;
|
|
8236
8315
|
}
|
|
8237
|
-
const userElo = (0,
|
|
8316
|
+
const userElo = (0, import_common16.toCourseElo)(courseReg.elo);
|
|
8238
8317
|
const cardElo = (await courseDB.getCardEloData([currentCard.card.card_id]))[0];
|
|
8239
8318
|
if (cardElo && userElo) {
|
|
8240
8319
|
const beforeUserGlobal = userElo.global.score;
|
|
@@ -8244,14 +8323,15 @@ var init_EloService = __esm({
|
|
|
8244
8323
|
for (const tag of cardTagKeys) {
|
|
8245
8324
|
beforeUserTag[tag] = userElo.tags[tag]?.score ?? userElo.global.score;
|
|
8246
8325
|
}
|
|
8247
|
-
const eloUpdate = (0,
|
|
8326
|
+
const eloUpdate = (0, import_common16.adjustCourseScores)(userElo, cardElo, userScore);
|
|
8248
8327
|
courseReg.elo = eloUpdate.userElo;
|
|
8249
8328
|
const tags = {};
|
|
8250
8329
|
for (const tag of cardTagKeys) {
|
|
8330
|
+
const countOnly = (0, import_common16.isCountOnlyTag)(tag);
|
|
8251
8331
|
tags[tag] = {
|
|
8252
8332
|
before: beforeUserTag[tag],
|
|
8253
|
-
after: eloUpdate.userElo.tags[tag].score,
|
|
8254
|
-
score: userScore
|
|
8333
|
+
after: countOnly ? beforeUserTag[tag] : eloUpdate.userElo.tags[tag].score,
|
|
8334
|
+
score: countOnly ? null : userScore
|
|
8255
8335
|
};
|
|
8256
8336
|
}
|
|
8257
8337
|
const event = {
|
|
@@ -8315,18 +8395,19 @@ var init_EloService = __esm({
|
|
|
8315
8395
|
);
|
|
8316
8396
|
return null;
|
|
8317
8397
|
}
|
|
8318
|
-
const userElo = (0,
|
|
8398
|
+
const userElo = (0, import_common16.toCourseElo)(courseReg.elo);
|
|
8319
8399
|
const [cardEloResults, cardTagsMap] = await Promise.all([
|
|
8320
8400
|
courseDB.getCardEloData([currentCard.card.card_id]),
|
|
8321
8401
|
courseDB.getAppliedTagsBatch([card_id])
|
|
8322
8402
|
]);
|
|
8323
8403
|
const cardElo = cardEloResults[0];
|
|
8324
8404
|
const cardTags = cardTagsMap.get(card_id) ?? [];
|
|
8325
|
-
const
|
|
8405
|
+
const graded = withCountOnlyRoles(taggedPerformance, card_id);
|
|
8406
|
+
const enriched = { ...graded };
|
|
8326
8407
|
const globalScore = taggedPerformance._global;
|
|
8327
8408
|
for (const tag of cardTags) {
|
|
8328
8409
|
if (!(tag in enriched)) {
|
|
8329
|
-
enriched[tag] = globalScore;
|
|
8410
|
+
enriched[tag] = (0, import_common16.isCountOnlyTag)(tag) ? null : globalScore;
|
|
8330
8411
|
}
|
|
8331
8412
|
}
|
|
8332
8413
|
if (cardElo && userElo) {
|
|
@@ -8337,11 +8418,11 @@ var init_EloService = __esm({
|
|
|
8337
8418
|
for (const tag of touchedTags) {
|
|
8338
8419
|
beforeUserTag[tag] = userElo.tags[tag]?.score ?? userElo.global.score;
|
|
8339
8420
|
}
|
|
8340
|
-
const eloUpdate = (0,
|
|
8421
|
+
const eloUpdate = (0, import_common16.adjustCourseScoresPerTag)(userElo, cardElo, enriched);
|
|
8341
8422
|
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
8342
8423
|
const recorded = recordTagPresentations(
|
|
8343
8424
|
eloUpdate.userElo,
|
|
8344
|
-
|
|
8425
|
+
graded,
|
|
8345
8426
|
currentCard.records,
|
|
8346
8427
|
card_id,
|
|
8347
8428
|
at
|
|
@@ -8404,13 +8485,13 @@ var init_EloService = __esm({
|
|
|
8404
8485
|
});
|
|
8405
8486
|
|
|
8406
8487
|
// src/study/services/ResponseProcessor.ts
|
|
8407
|
-
var
|
|
8488
|
+
var import_common17, ResponseProcessor;
|
|
8408
8489
|
var init_ResponseProcessor = __esm({
|
|
8409
8490
|
"src/study/services/ResponseProcessor.ts"() {
|
|
8410
8491
|
"use strict";
|
|
8411
8492
|
init_core();
|
|
8412
8493
|
init_logger();
|
|
8413
|
-
|
|
8494
|
+
import_common17 = require("@vue-skuilder/common");
|
|
8414
8495
|
ResponseProcessor = class {
|
|
8415
8496
|
srsService;
|
|
8416
8497
|
eloService;
|
|
@@ -8453,7 +8534,7 @@ var init_ResponseProcessor = __esm({
|
|
|
8453
8534
|
taggedPerformance: null
|
|
8454
8535
|
};
|
|
8455
8536
|
}
|
|
8456
|
-
if ((0,
|
|
8537
|
+
if ((0, import_common17.isTaggedPerformance)(performance2)) {
|
|
8457
8538
|
return {
|
|
8458
8539
|
globalScore: performance2._global,
|
|
8459
8540
|
taggedPerformance: performance2
|
|
@@ -8756,11 +8837,11 @@ function prefetchAudio(url) {
|
|
|
8756
8837
|
audio.src = url;
|
|
8757
8838
|
});
|
|
8758
8839
|
}
|
|
8759
|
-
var
|
|
8840
|
+
var import_common18, CardHydrationService;
|
|
8760
8841
|
var init_CardHydrationService = __esm({
|
|
8761
8842
|
"src/study/services/CardHydrationService.ts"() {
|
|
8762
8843
|
"use strict";
|
|
8763
|
-
|
|
8844
|
+
import_common18 = require("@vue-skuilder/common");
|
|
8764
8845
|
init_logger();
|
|
8765
8846
|
CardHydrationService = class {
|
|
8766
8847
|
constructor(getViewComponent, getCourseDB3, getItemsToHydrate) {
|
|
@@ -8873,8 +8954,8 @@ var init_CardHydrationService = __esm({
|
|
|
8873
8954
|
courseDB.getCourseDoc(item.cardID),
|
|
8874
8955
|
courseDB.getAppliedTagsBatch([item.cardID])
|
|
8875
8956
|
]);
|
|
8876
|
-
if (!(0,
|
|
8877
|
-
cardData.elo = (0,
|
|
8957
|
+
if (!(0, import_common18.isCourseElo)(cardData.elo)) {
|
|
8958
|
+
cardData.elo = (0, import_common18.toCourseElo)(cardData.elo);
|
|
8878
8959
|
}
|
|
8879
8960
|
const view = this.getViewComponent(cardData.id_view);
|
|
8880
8961
|
const dataDocs = await Promise.all(
|
|
@@ -8898,9 +8979,9 @@ var init_CardHydrationService = __esm({
|
|
|
8898
8979
|
);
|
|
8899
8980
|
await Promise.allSettled(uniqueAudioUrls.map(prefetchAudio));
|
|
8900
8981
|
}
|
|
8901
|
-
const data = dataDocs.map(
|
|
8982
|
+
const data = dataDocs.map(import_common18.displayableDataToViewData).reverse();
|
|
8902
8983
|
this.hydratedCards.set(item.cardID, {
|
|
8903
|
-
item: { ...item, elo: (0,
|
|
8984
|
+
item: { ...item, elo: (0, import_common18.toCourseElo)(cardData.elo).global.score },
|
|
8904
8985
|
view,
|
|
8905
8986
|
data,
|
|
8906
8987
|
tags: tagsByCard.get(item.cardID) ?? []
|
|
@@ -11626,7 +11707,9 @@ function toRunCard(c) {
|
|
|
11626
11707
|
cardId: c.cardId,
|
|
11627
11708
|
origin: c.origin,
|
|
11628
11709
|
...c.generator ? { generator: c.generator } : {},
|
|
11629
|
-
|
|
11710
|
+
...c.required ? { required: c.required } : {},
|
|
11711
|
+
// A required card's score is infinite, which JSON can't hold: say so with null.
|
|
11712
|
+
score: Number.isFinite(c.finalScore) ? sig4(c.finalScore) : null,
|
|
11630
11713
|
selected: c.selected
|
|
11631
11714
|
};
|
|
11632
11715
|
}
|
|
@@ -11677,6 +11760,7 @@ var init_SessionController = __esm({
|
|
|
11677
11760
|
init_util2();
|
|
11678
11761
|
init_navigators();
|
|
11679
11762
|
init_Pipeline();
|
|
11763
|
+
init_versionStamps();
|
|
11680
11764
|
init_SourceMixer();
|
|
11681
11765
|
init_MixerDebugger();
|
|
11682
11766
|
init_SessionDebugger();
|
|
@@ -11975,7 +12059,8 @@ var init_SessionController = __esm({
|
|
|
11975
12059
|
...run.discardedTail ? { discardedTail: run.discardedTail } : {},
|
|
11976
12060
|
cards: persistedRunCards(run),
|
|
11977
12061
|
...run.unselectedNew ? { unselectedNew: persistedUnselectedNew(run.unselectedNew) } : {},
|
|
11978
|
-
...run.regulators ? { regulators: run.regulators.map(persistedReading) } : {}
|
|
12062
|
+
...run.regulators ? { regulators: run.regulators.map(persistedReading) } : {},
|
|
12063
|
+
...run.versions ? { versions: run.versions } : {}
|
|
11979
12064
|
});
|
|
11980
12065
|
}
|
|
11981
12066
|
}
|
|
@@ -12012,6 +12097,7 @@ var init_SessionController = __esm({
|
|
|
12012
12097
|
sourceCount: this.sources.length,
|
|
12013
12098
|
initHints: this._sessionHints
|
|
12014
12099
|
},
|
|
12100
|
+
versions: sessionVersions(),
|
|
12015
12101
|
initialQueues: { supplyQ: this.supplyQ.length, failedQ: this.failedQ.length },
|
|
12016
12102
|
runs: [...this._runLog],
|
|
12017
12103
|
stateAtStart: await this._captureState("start")
|
|
@@ -12956,11 +13042,11 @@ var init_SessionController = __esm({
|
|
|
12956
13042
|
});
|
|
12957
13043
|
|
|
12958
13044
|
// src/study/TagFilteredContentSource.ts
|
|
12959
|
-
var
|
|
13045
|
+
var import_common19, TagFilteredContentSource;
|
|
12960
13046
|
var init_TagFilteredContentSource = __esm({
|
|
12961
13047
|
"src/study/TagFilteredContentSource.ts"() {
|
|
12962
13048
|
"use strict";
|
|
12963
|
-
|
|
13049
|
+
import_common19 = require("@vue-skuilder/common");
|
|
12964
13050
|
init_courseDB();
|
|
12965
13051
|
init_logger();
|
|
12966
13052
|
TagFilteredContentSource = class {
|
|
@@ -13046,7 +13132,7 @@ var init_TagFilteredContentSource = __esm({
|
|
|
13046
13132
|
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
13047
13133
|
*/
|
|
13048
13134
|
async getWeightedCards(limit) {
|
|
13049
|
-
if (!(0,
|
|
13135
|
+
if (!(0, import_common19.hasActiveFilter)(this.filter)) {
|
|
13050
13136
|
logger.warn("[TagFilteredContentSource] getWeightedCards called with no active filter");
|
|
13051
13137
|
return { cards: [] };
|
|
13052
13138
|
}
|
|
@@ -13484,13 +13570,13 @@ async function dropUserFromClassroom(user, classID) {
|
|
|
13484
13570
|
async function getUserClassrooms(user) {
|
|
13485
13571
|
return getOrCreateClassroomRegistrationsDoc(user);
|
|
13486
13572
|
}
|
|
13487
|
-
var
|
|
13573
|
+
var import_common20, import_moment8, log4, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
|
|
13488
13574
|
var init_BaseUserDB = __esm({
|
|
13489
13575
|
"src/impl/common/BaseUserDB.ts"() {
|
|
13490
13576
|
"use strict";
|
|
13491
13577
|
init_core();
|
|
13492
13578
|
init_util();
|
|
13493
|
-
|
|
13579
|
+
import_common20 = require("@vue-skuilder/common");
|
|
13494
13580
|
import_moment8 = __toESM(require("moment"), 1);
|
|
13495
13581
|
init_types_legacy();
|
|
13496
13582
|
init_logger();
|
|
@@ -13593,7 +13679,7 @@ Currently logged-in as ${this._username}.`
|
|
|
13593
13679
|
);
|
|
13594
13680
|
}
|
|
13595
13681
|
const result = await this.syncStrategy.createAccount(username, password);
|
|
13596
|
-
if (result.status ===
|
|
13682
|
+
if (result.status === import_common20.Status.ok) {
|
|
13597
13683
|
log4(`Account created successfully, updating username to ${username}`);
|
|
13598
13684
|
this._username = username;
|
|
13599
13685
|
try {
|
|
@@ -13669,7 +13755,7 @@ Currently logged-in as ${this._username}.`
|
|
|
13669
13755
|
async resetUserData() {
|
|
13670
13756
|
if (this.syncStrategy.canAuthenticate()) {
|
|
13671
13757
|
return {
|
|
13672
|
-
status:
|
|
13758
|
+
status: import_common20.Status.error,
|
|
13673
13759
|
error: "Reset user data is only available for local-only mode. Use logout instead for remote sync."
|
|
13674
13760
|
};
|
|
13675
13761
|
}
|
|
@@ -13691,11 +13777,11 @@ Currently logged-in as ${this._username}.`
|
|
|
13691
13777
|
await localDB.bulkDocs(docsToDelete);
|
|
13692
13778
|
}
|
|
13693
13779
|
await this.init();
|
|
13694
|
-
return { status:
|
|
13780
|
+
return { status: import_common20.Status.ok };
|
|
13695
13781
|
} catch (error) {
|
|
13696
13782
|
logger.error("Failed to reset user data:", error);
|
|
13697
13783
|
return {
|
|
13698
|
-
status:
|
|
13784
|
+
status: import_common20.Status.error,
|
|
13699
13785
|
error: error instanceof Error ? error.message : "Unknown error during reset"
|
|
13700
13786
|
};
|
|
13701
13787
|
}
|
|
@@ -15108,11 +15194,11 @@ var init_StaticDataUnpacker = __esm({
|
|
|
15108
15194
|
});
|
|
15109
15195
|
|
|
15110
15196
|
// src/impl/static/courseDB.ts
|
|
15111
|
-
var
|
|
15197
|
+
var import_common22, StaticCourseDB;
|
|
15112
15198
|
var init_courseDB2 = __esm({
|
|
15113
15199
|
"src/impl/static/courseDB.ts"() {
|
|
15114
15200
|
"use strict";
|
|
15115
|
-
|
|
15201
|
+
import_common22 = require("@vue-skuilder/common");
|
|
15116
15202
|
init_types_legacy();
|
|
15117
15203
|
init_logger();
|
|
15118
15204
|
init_defaults();
|
|
@@ -15373,7 +15459,7 @@ var init_courseDB2 = __esm({
|
|
|
15373
15459
|
}
|
|
15374
15460
|
async addNote(_codeCourse, _shape, _data, _author, _tags, _uploads, _elo) {
|
|
15375
15461
|
return {
|
|
15376
|
-
status:
|
|
15462
|
+
status: import_common22.Status.error,
|
|
15377
15463
|
message: "Cannot add notes in static mode"
|
|
15378
15464
|
};
|
|
15379
15465
|
}
|
|
@@ -15718,6 +15804,9 @@ async function initializeDataLayer(config) {
|
|
|
15718
15804
|
if (config.options.localStoragePrefix) {
|
|
15719
15805
|
ENV.LOCAL_STORAGE_PREFIX = config.options.localStoragePrefix;
|
|
15720
15806
|
}
|
|
15807
|
+
if (config.options.appVersion) {
|
|
15808
|
+
setAppVersion(config.options.appVersion);
|
|
15809
|
+
}
|
|
15721
15810
|
if (config.type === "couch") {
|
|
15722
15811
|
if (!config.options.COUCHDB_SERVER_URL || !config.options.COUCHDB_SERVER_PROTOCOL) {
|
|
15723
15812
|
throw new Error("Missing CouchDB server URL or protocol");
|
|
@@ -15774,6 +15863,7 @@ var init_factory = __esm({
|
|
|
15774
15863
|
init_common();
|
|
15775
15864
|
init_logger();
|
|
15776
15865
|
init_navigators();
|
|
15866
|
+
init_versionStamps();
|
|
15777
15867
|
NOT_SET = "NOT_SET";
|
|
15778
15868
|
ENV = {
|
|
15779
15869
|
COUCHDB_SERVER_PROTOCOL: NOT_SET,
|
|
@@ -15793,19 +15883,19 @@ async function getStudySource(source, user) {
|
|
|
15793
15883
|
if (source.type === "classroom") {
|
|
15794
15884
|
return await StudentClassroomDB.factory(source.id, user);
|
|
15795
15885
|
} else {
|
|
15796
|
-
if ((0,
|
|
15886
|
+
if ((0, import_common26.hasActiveFilter)(source.tagFilter)) {
|
|
15797
15887
|
return new TagFilteredContentSource(source.id, source.tagFilter, user);
|
|
15798
15888
|
}
|
|
15799
15889
|
return getDataLayer().getCourseDB(source.id);
|
|
15800
15890
|
}
|
|
15801
15891
|
}
|
|
15802
|
-
var
|
|
15892
|
+
var import_common26;
|
|
15803
15893
|
var init_contentSource = __esm({
|
|
15804
15894
|
"src/core/interfaces/contentSource.ts"() {
|
|
15805
15895
|
"use strict";
|
|
15806
15896
|
init_factory();
|
|
15807
15897
|
init_classroomDB2();
|
|
15808
|
-
|
|
15898
|
+
import_common26 = require("@vue-skuilder/common");
|
|
15809
15899
|
init_TagFilteredContentSource();
|
|
15810
15900
|
}
|
|
15811
15901
|
});
|
|
@@ -15945,7 +16035,7 @@ elo: ${elo}`;
|
|
|
15945
16035
|
misc: {}
|
|
15946
16036
|
} : void 0
|
|
15947
16037
|
);
|
|
15948
|
-
if (result.status ===
|
|
16038
|
+
if (result.status === import_common27.Status.ok) {
|
|
15949
16039
|
return {
|
|
15950
16040
|
originalText,
|
|
15951
16041
|
status: "success",
|
|
@@ -15989,11 +16079,11 @@ function validateProcessorConfig(config) {
|
|
|
15989
16079
|
}
|
|
15990
16080
|
return { isValid: true };
|
|
15991
16081
|
}
|
|
15992
|
-
var
|
|
16082
|
+
var import_common27;
|
|
15993
16083
|
var init_cardProcessor = __esm({
|
|
15994
16084
|
"src/core/bulkImport/cardProcessor.ts"() {
|
|
15995
16085
|
"use strict";
|
|
15996
|
-
|
|
16086
|
+
import_common27 = require("@vue-skuilder/common");
|
|
15997
16087
|
init_logger();
|
|
15998
16088
|
}
|
|
15999
16089
|
});
|
|
@@ -16500,10 +16590,10 @@ init_regulators();
|
|
|
16500
16590
|
init_courseLookupDB();
|
|
16501
16591
|
|
|
16502
16592
|
// src/courseConfigRegistration.ts
|
|
16503
|
-
var
|
|
16593
|
+
var import_common28 = require("@vue-skuilder/common");
|
|
16504
16594
|
init_logger();
|
|
16505
16595
|
function isDataShapeRegistered(dataShape, courseConfig) {
|
|
16506
|
-
const namespacedName =
|
|
16596
|
+
const namespacedName = import_common28.NameSpacer.getDataShapeString({
|
|
16507
16597
|
dataShape: dataShape.name,
|
|
16508
16598
|
course: dataShape.course
|
|
16509
16599
|
});
|
|
@@ -16511,7 +16601,7 @@ function isDataShapeRegistered(dataShape, courseConfig) {
|
|
|
16511
16601
|
return existingDataShape !== void 0;
|
|
16512
16602
|
}
|
|
16513
16603
|
function isDataShapeSchemaAvailable(dataShape, courseConfig) {
|
|
16514
|
-
const namespacedName =
|
|
16604
|
+
const namespacedName = import_common28.NameSpacer.getDataShapeString({
|
|
16515
16605
|
dataShape: dataShape.name,
|
|
16516
16606
|
course: dataShape.course
|
|
16517
16607
|
});
|
|
@@ -16519,7 +16609,7 @@ function isDataShapeSchemaAvailable(dataShape, courseConfig) {
|
|
|
16519
16609
|
return existingDataShape !== void 0 && existingDataShape.serializedZodSchema !== void 0;
|
|
16520
16610
|
}
|
|
16521
16611
|
function isQuestionTypeRegistered(question, courseConfig) {
|
|
16522
|
-
const namespacedName =
|
|
16612
|
+
const namespacedName = import_common28.NameSpacer.getQuestionString({
|
|
16523
16613
|
course: question.course,
|
|
16524
16614
|
questionType: question.name
|
|
16525
16615
|
});
|
|
@@ -16551,13 +16641,13 @@ function processCustomQuestionsData(customQuestions) {
|
|
|
16551
16641
|
return { dataShapes: processedDataShapes, questions: processedQuestions };
|
|
16552
16642
|
}
|
|
16553
16643
|
function registerDataShape(dataShape, courseConfig) {
|
|
16554
|
-
const namespacedName =
|
|
16644
|
+
const namespacedName = import_common28.NameSpacer.getDataShapeString({
|
|
16555
16645
|
dataShape: dataShape.name,
|
|
16556
16646
|
course: dataShape.course
|
|
16557
16647
|
});
|
|
16558
16648
|
let serializedZodSchema;
|
|
16559
16649
|
try {
|
|
16560
|
-
serializedZodSchema = (0,
|
|
16650
|
+
serializedZodSchema = (0, import_common28.toZodJSON)(dataShape.dataShape);
|
|
16561
16651
|
} catch (error) {
|
|
16562
16652
|
logger.warn(`Failed to generate schema for ${namespacedName}:`, error);
|
|
16563
16653
|
serializedZodSchema = void 0;
|
|
@@ -16602,7 +16692,7 @@ function registerQuestionType(question, courseConfig) {
|
|
|
16602
16692
|
logger.info(`QuestionType '${question.name}' from '${question.course}' already registered`);
|
|
16603
16693
|
return false;
|
|
16604
16694
|
}
|
|
16605
|
-
const namespacedQuestionName =
|
|
16695
|
+
const namespacedQuestionName = import_common28.NameSpacer.getQuestionString({
|
|
16606
16696
|
course: question.course,
|
|
16607
16697
|
questionType: question.name
|
|
16608
16698
|
});
|
|
@@ -16614,7 +16704,7 @@ function registerQuestionType(question, courseConfig) {
|
|
|
16614
16704
|
}
|
|
16615
16705
|
});
|
|
16616
16706
|
const dataShapeList = question.dataShapes.map(
|
|
16617
|
-
(dataShape) =>
|
|
16707
|
+
(dataShape) => import_common28.NameSpacer.getDataShapeString({
|
|
16618
16708
|
course: question.course,
|
|
16619
16709
|
dataShape: dataShape.name
|
|
16620
16710
|
})
|
|
@@ -16625,7 +16715,7 @@ function registerQuestionType(question, courseConfig) {
|
|
|
16625
16715
|
dataShapeList
|
|
16626
16716
|
});
|
|
16627
16717
|
question.dataShapes.forEach((dataShape) => {
|
|
16628
|
-
const namespacedDataShapeName =
|
|
16718
|
+
const namespacedDataShapeName = import_common28.NameSpacer.getDataShapeString({
|
|
16629
16719
|
course: question.course,
|
|
16630
16720
|
dataShape: dataShape.name
|
|
16631
16721
|
});
|