@vue-skuilder/db 0.2.30 → 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 +88 -76
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +40 -27
- 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 +92 -80
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +40 -27
- 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 +79 -67
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +40 -27
- 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 +141 -110
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -33
- 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 +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 +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/impl/couch/index.js
CHANGED
|
@@ -770,13 +770,12 @@ function clearRunHistory() {
|
|
|
770
770
|
_pendingRuns = [];
|
|
771
771
|
}
|
|
772
772
|
function getOrigin(card) {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
return "unknown";
|
|
773
|
+
return card.reviewID ? "review" : "new";
|
|
774
|
+
}
|
|
775
|
+
function requiredBy(card) {
|
|
776
|
+
return card.provenance.find(
|
|
777
|
+
(p) => p.strategy === "ephemeralHint" && p.score === Number.POSITIVE_INFINITY
|
|
778
|
+
)?.strategyName;
|
|
780
779
|
}
|
|
781
780
|
function captureRun(report) {
|
|
782
781
|
const fullReport = {
|
|
@@ -800,17 +799,23 @@ function parseCardElo(provenance) {
|
|
|
800
799
|
}
|
|
801
800
|
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards, regulators) {
|
|
802
801
|
const selectedIds = new Set(selectedCards.map((c) => c.cardId));
|
|
803
|
-
const toReport = (card) =>
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
802
|
+
const toReport = (card) => {
|
|
803
|
+
const required = requiredBy(card);
|
|
804
|
+
const first = card.provenance[0];
|
|
805
|
+
const generator = first && first.strategy !== "ephemeralHint" ? first.strategyName || first.strategy : void 0;
|
|
806
|
+
return {
|
|
807
|
+
cardId: card.cardId,
|
|
808
|
+
courseId: card.courseId,
|
|
809
|
+
origin: getOrigin(card),
|
|
810
|
+
...generator ? { generator } : {},
|
|
811
|
+
...required ? { required } : {},
|
|
812
|
+
finalScore: card.score,
|
|
813
|
+
cardElo: card.cardElo ?? parseCardElo(card.provenance),
|
|
814
|
+
provenance: card.provenance,
|
|
815
|
+
tags: card.tags,
|
|
816
|
+
selected: selectedIds.has(card.cardId)
|
|
817
|
+
};
|
|
818
|
+
};
|
|
814
819
|
const selectedReported = [];
|
|
815
820
|
const nearMissReported = [];
|
|
816
821
|
const discardedTailCards = [];
|
|
@@ -1939,10 +1944,14 @@ var init_elo = __esm({
|
|
|
1939
1944
|
const userElo = (0, import_common5.toCourseElo)(courseReg.elo);
|
|
1940
1945
|
userGlobalElo = userElo.global.score;
|
|
1941
1946
|
}
|
|
1942
|
-
const activeCards = await
|
|
1947
|
+
const [activeCards, seenCards] = await Promise.all([
|
|
1948
|
+
this.user.getActiveCards(),
|
|
1949
|
+
this.user.getSeenCards(this.course.getCourseID()).catch(() => [])
|
|
1950
|
+
]);
|
|
1951
|
+
const notNew = /* @__PURE__ */ new Set([...activeCards.map((ac) => ac.cardID), ...seenCards]);
|
|
1943
1952
|
const newCards = (await this.course.getCardsCenteredAtELO(
|
|
1944
1953
|
{ limit, elo: "user" },
|
|
1945
|
-
(c) => !
|
|
1954
|
+
(c) => !notNew.has(c.cardID)
|
|
1946
1955
|
)).map((c) => ({ ...c, status: "new" }));
|
|
1947
1956
|
const scored = newCards.map((c) => {
|
|
1948
1957
|
const cardElo = c.elo ?? 1e3;
|
|
@@ -2035,11 +2044,11 @@ function formatAge(ms) {
|
|
|
2035
2044
|
}
|
|
2036
2045
|
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
2037
2046
|
if (minCount <= 0) return [];
|
|
2038
|
-
const exposeTags = new Set(tags.filter((tag) =>
|
|
2047
|
+
const exposeTags = new Set(tags.filter((tag) => (0, import_common6.tagRole)(tag) === "expose"));
|
|
2039
2048
|
for (const tag of tags) {
|
|
2040
|
-
if (
|
|
2041
|
-
const
|
|
2042
|
-
if (
|
|
2049
|
+
if ((0, import_common6.tagRole)(tag) !== "intro") continue;
|
|
2050
|
+
const expose = (0, import_common6.withTagRole)(tag, "expose");
|
|
2051
|
+
if (expose) exposeTags.add(expose);
|
|
2043
2052
|
}
|
|
2044
2053
|
return [...exposeTags].filter((tag) => {
|
|
2045
2054
|
const tagElo = userTagElo[tag];
|
|
@@ -2049,10 +2058,11 @@ function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
|
2049
2058
|
function pickTopByScore(cards, limit) {
|
|
2050
2059
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
2051
2060
|
}
|
|
2052
|
-
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;
|
|
2061
|
+
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;
|
|
2053
2062
|
var init_prescribed = __esm({
|
|
2054
2063
|
"src/core/navigators/generators/prescribed.ts"() {
|
|
2055
2064
|
"use strict";
|
|
2065
|
+
import_common6 = require("@vue-skuilder/common");
|
|
2056
2066
|
init_navigators();
|
|
2057
2067
|
init_StrategyPressureDebugger();
|
|
2058
2068
|
init_logger();
|
|
@@ -3283,7 +3293,9 @@ function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
|
|
|
3283
3293
|
const tags = [];
|
|
3284
3294
|
for (const tag of cardTags) {
|
|
3285
3295
|
const user = userElo.tags[tag];
|
|
3286
|
-
if (!user || user.score ===
|
|
3296
|
+
if ((0, import_common7.isCountOnlyTag)(tag) || !user || user.score === import_common7.COUNT_ONLY_SCORE || user.count < minTagCount) {
|
|
3297
|
+
continue;
|
|
3298
|
+
}
|
|
3287
3299
|
const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
|
|
3288
3300
|
tags.push({
|
|
3289
3301
|
tag,
|
|
@@ -3355,11 +3367,12 @@ function createEloDistanceFilter(config) {
|
|
|
3355
3367
|
transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
|
|
3356
3368
|
};
|
|
3357
3369
|
}
|
|
3358
|
-
var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF,
|
|
3370
|
+
var import_common7, DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, DEFAULT_CARD_ELO, MULTI_DIM_ELO_KEY, multiDimElo, EloDistanceFilter;
|
|
3359
3371
|
var init_eloDistance = __esm({
|
|
3360
3372
|
"src/core/navigators/filters/eloDistance.ts"() {
|
|
3361
3373
|
"use strict";
|
|
3362
3374
|
init_navigators();
|
|
3375
|
+
import_common7 = require("@vue-skuilder/common");
|
|
3363
3376
|
init_logger();
|
|
3364
3377
|
DEFAULT_ELO_DISTANCE_CONFIG = {
|
|
3365
3378
|
halfLife: 300,
|
|
@@ -3369,7 +3382,6 @@ var init_eloDistance = __esm({
|
|
|
3369
3382
|
minTagCount: 3
|
|
3370
3383
|
};
|
|
3371
3384
|
TAG_CONFIDENCE_HALF = 10;
|
|
3372
|
-
COUNT_ONLY_SENTINEL = -1;
|
|
3373
3385
|
DEFAULT_CARD_ELO = 1e3;
|
|
3374
3386
|
MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
|
|
3375
3387
|
multiDimElo = readMultiDimElo();
|
|
@@ -3412,12 +3424,12 @@ var hierarchyDefinition_exports = {};
|
|
|
3412
3424
|
__export(hierarchyDefinition_exports, {
|
|
3413
3425
|
default: () => HierarchyDefinitionNavigator
|
|
3414
3426
|
});
|
|
3415
|
-
var
|
|
3427
|
+
var import_common8, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
|
|
3416
3428
|
var init_hierarchyDefinition = __esm({
|
|
3417
3429
|
"src/core/navigators/filters/hierarchyDefinition.ts"() {
|
|
3418
3430
|
"use strict";
|
|
3419
3431
|
init_navigators();
|
|
3420
|
-
|
|
3432
|
+
import_common8 = require("@vue-skuilder/common");
|
|
3421
3433
|
init_logger();
|
|
3422
3434
|
DEFAULT_MIN_COUNT2 = 3;
|
|
3423
3435
|
HierarchyDefinitionNavigator = class _HierarchyDefinitionNavigator extends ContentNavigator {
|
|
@@ -3467,7 +3479,7 @@ var init_hierarchyDefinition = __esm({
|
|
|
3467
3479
|
const mastered = /* @__PURE__ */ new Set();
|
|
3468
3480
|
try {
|
|
3469
3481
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3470
|
-
const userElo = (0,
|
|
3482
|
+
const userElo = (0, import_common8.toCourseElo)(courseReg.elo);
|
|
3471
3483
|
for (const prereqs of Object.values(this.config.prerequisites)) {
|
|
3472
3484
|
for (const prereq of prereqs) {
|
|
3473
3485
|
const tagElo = userElo.tags[prereq.tag];
|
|
@@ -3839,12 +3851,12 @@ var interferenceMitigator_exports = {};
|
|
|
3839
3851
|
__export(interferenceMitigator_exports, {
|
|
3840
3852
|
default: () => InterferenceMitigatorNavigator
|
|
3841
3853
|
});
|
|
3842
|
-
var
|
|
3854
|
+
var import_common9, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
|
|
3843
3855
|
var init_interferenceMitigator = __esm({
|
|
3844
3856
|
"src/core/navigators/filters/interferenceMitigator.ts"() {
|
|
3845
3857
|
"use strict";
|
|
3846
3858
|
init_navigators();
|
|
3847
|
-
|
|
3859
|
+
import_common9 = require("@vue-skuilder/common");
|
|
3848
3860
|
DEFAULT_MIN_COUNT3 = 10;
|
|
3849
3861
|
DEFAULT_MIN_ELAPSED_DAYS = 3;
|
|
3850
3862
|
DEFAULT_INTERFERENCE_DECAY = 0.8;
|
|
@@ -3929,7 +3941,7 @@ var init_interferenceMitigator = __esm({
|
|
|
3929
3941
|
const immature = /* @__PURE__ */ new Set();
|
|
3930
3942
|
try {
|
|
3931
3943
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3932
|
-
const userElo = (0,
|
|
3944
|
+
const userElo = (0, import_common9.toCourseElo)(courseReg.elo);
|
|
3933
3945
|
const minCount = this.config.maturityThreshold?.minCount ?? DEFAULT_MIN_COUNT3;
|
|
3934
3946
|
const minElo = this.config.maturityThreshold?.minElo;
|
|
3935
3947
|
const minElapsedDays = this.config.maturityThreshold?.minElapsedDays ?? DEFAULT_MIN_ELAPSED_DAYS;
|
|
@@ -4474,11 +4486,11 @@ function logCardProvenance(cards, maxCards = 3) {
|
|
|
4474
4486
|
}
|
|
4475
4487
|
}
|
|
4476
4488
|
}
|
|
4477
|
-
var
|
|
4489
|
+
var import_common10, VERBOSE_RESULTS, Pipeline;
|
|
4478
4490
|
var init_Pipeline = __esm({
|
|
4479
4491
|
"src/core/navigators/Pipeline.ts"() {
|
|
4480
4492
|
"use strict";
|
|
4481
|
-
|
|
4493
|
+
import_common10 = require("@vue-skuilder/common");
|
|
4482
4494
|
init_navigators();
|
|
4483
4495
|
init_logger();
|
|
4484
4496
|
init_orchestration();
|
|
@@ -4967,7 +4979,7 @@ var init_Pipeline = __esm({
|
|
|
4967
4979
|
let userCourseElo;
|
|
4968
4980
|
try {
|
|
4969
4981
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
4970
|
-
userCourseElo = (0,
|
|
4982
|
+
userCourseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
4971
4983
|
userElo = userCourseElo.global.score;
|
|
4972
4984
|
} catch (e) {
|
|
4973
4985
|
logger.debug(`[Pipeline] Could not get user ELO, using default: ${e}`);
|
|
@@ -5029,7 +5041,7 @@ var init_Pipeline = __esm({
|
|
|
5029
5041
|
*/
|
|
5030
5042
|
async getTagEloStatus(tagFilter) {
|
|
5031
5043
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
5032
|
-
const courseElo = (0,
|
|
5044
|
+
const courseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
5033
5045
|
const result = {};
|
|
5034
5046
|
if (!tagFilter) {
|
|
5035
5047
|
for (const [tag, data] of Object.entries(courseElo.tags)) {
|
|
@@ -5972,11 +5984,11 @@ ${JSON.stringify(config)}
|
|
|
5972
5984
|
function isSuccessRow(row) {
|
|
5973
5985
|
return "doc" in row && row.doc !== null && row.doc !== void 0;
|
|
5974
5986
|
}
|
|
5975
|
-
var
|
|
5987
|
+
var import_common11, CoursesDB, CourseDB;
|
|
5976
5988
|
var init_courseDB = __esm({
|
|
5977
5989
|
"src/impl/couch/courseDB.ts"() {
|
|
5978
5990
|
"use strict";
|
|
5979
|
-
|
|
5991
|
+
import_common11 = require("@vue-skuilder/common");
|
|
5980
5992
|
init_couch();
|
|
5981
5993
|
init_updateQueue();
|
|
5982
5994
|
init_types_legacy();
|
|
@@ -6125,14 +6137,14 @@ var init_courseDB = __esm({
|
|
|
6125
6137
|
docs.rows.forEach((r) => {
|
|
6126
6138
|
if (isSuccessRow(r)) {
|
|
6127
6139
|
if (r.doc && r.doc.elo) {
|
|
6128
|
-
ret.push((0,
|
|
6140
|
+
ret.push((0, import_common11.toCourseElo)(r.doc.elo));
|
|
6129
6141
|
} else {
|
|
6130
6142
|
logger.warn("no elo data for card: " + r.id);
|
|
6131
|
-
ret.push((0,
|
|
6143
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6132
6144
|
}
|
|
6133
6145
|
} else {
|
|
6134
6146
|
logger.warn("no elo data for card: " + JSON.stringify(r));
|
|
6135
|
-
ret.push((0,
|
|
6147
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6136
6148
|
}
|
|
6137
6149
|
});
|
|
6138
6150
|
return ret;
|
|
@@ -6335,7 +6347,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6335
6347
|
async getCourseTagStubs() {
|
|
6336
6348
|
return getCourseTagStubs(this.id);
|
|
6337
6349
|
}
|
|
6338
|
-
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0,
|
|
6350
|
+
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common11.blankCourseElo)()) {
|
|
6339
6351
|
try {
|
|
6340
6352
|
const resp = await addNote55(this.id, codeCourse, shape, data, author, tags, uploads, elo);
|
|
6341
6353
|
if (resp.ok) {
|
|
@@ -6344,19 +6356,19 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6344
6356
|
`[courseDB.addNote] Note added but card creation failed: ${resp.cardCreationError}`
|
|
6345
6357
|
);
|
|
6346
6358
|
return {
|
|
6347
|
-
status:
|
|
6359
|
+
status: import_common11.Status.error,
|
|
6348
6360
|
message: `Note was added but no cards were created: ${resp.cardCreationError}`,
|
|
6349
6361
|
id: resp.id
|
|
6350
6362
|
};
|
|
6351
6363
|
}
|
|
6352
6364
|
return {
|
|
6353
|
-
status:
|
|
6365
|
+
status: import_common11.Status.ok,
|
|
6354
6366
|
message: "",
|
|
6355
6367
|
id: resp.id
|
|
6356
6368
|
};
|
|
6357
6369
|
} else {
|
|
6358
6370
|
return {
|
|
6359
|
-
status:
|
|
6371
|
+
status: import_common11.Status.error,
|
|
6360
6372
|
message: "Unexpected error adding note"
|
|
6361
6373
|
};
|
|
6362
6374
|
}
|
|
@@ -6368,7 +6380,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6368
6380
|
message: ${err.message}`
|
|
6369
6381
|
);
|
|
6370
6382
|
return {
|
|
6371
|
-
status:
|
|
6383
|
+
status: import_common11.Status.error,
|
|
6372
6384
|
message: `Error adding note to course. ${e.reason || err.message}`
|
|
6373
6385
|
};
|
|
6374
6386
|
}
|
|
@@ -6562,7 +6574,7 @@ ${e.stack}` : JSON.stringify(e);
|
|
|
6562
6574
|
const courseDoc = (await u.getCourseRegistrationsDoc()).courses.find((c) => {
|
|
6563
6575
|
return c.courseID === this.id;
|
|
6564
6576
|
});
|
|
6565
|
-
targetElo = (0,
|
|
6577
|
+
targetElo = (0, import_common11.EloToNumber)(courseDoc.elo);
|
|
6566
6578
|
} catch {
|
|
6567
6579
|
targetElo = 1e3;
|
|
6568
6580
|
}
|
|
@@ -6985,11 +6997,11 @@ var init_classroomDB2 = __esm({
|
|
|
6985
6997
|
});
|
|
6986
6998
|
|
|
6987
6999
|
// src/study/TagFilteredContentSource.ts
|
|
6988
|
-
var
|
|
7000
|
+
var import_common12, TagFilteredContentSource;
|
|
6989
7001
|
var init_TagFilteredContentSource = __esm({
|
|
6990
7002
|
"src/study/TagFilteredContentSource.ts"() {
|
|
6991
7003
|
"use strict";
|
|
6992
|
-
|
|
7004
|
+
import_common12 = require("@vue-skuilder/common");
|
|
6993
7005
|
init_courseDB();
|
|
6994
7006
|
init_logger();
|
|
6995
7007
|
TagFilteredContentSource = class {
|
|
@@ -7075,7 +7087,7 @@ var init_TagFilteredContentSource = __esm({
|
|
|
7075
7087
|
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
7076
7088
|
*/
|
|
7077
7089
|
async getWeightedCards(limit) {
|
|
7078
|
-
if (!(0,
|
|
7090
|
+
if (!(0, import_common12.hasActiveFilter)(this.filter)) {
|
|
7079
7091
|
logger.warn("[TagFilteredContentSource] getWeightedCards called with no active filter");
|
|
7080
7092
|
return { cards: [] };
|
|
7081
7093
|
}
|
|
@@ -7163,19 +7175,19 @@ async function getStudySource(source, user) {
|
|
|
7163
7175
|
if (source.type === "classroom") {
|
|
7164
7176
|
return await StudentClassroomDB.factory(source.id, user);
|
|
7165
7177
|
} else {
|
|
7166
|
-
if ((0,
|
|
7178
|
+
if ((0, import_common13.hasActiveFilter)(source.tagFilter)) {
|
|
7167
7179
|
return new TagFilteredContentSource(source.id, source.tagFilter, user);
|
|
7168
7180
|
}
|
|
7169
7181
|
return getDataLayer().getCourseDB(source.id);
|
|
7170
7182
|
}
|
|
7171
7183
|
}
|
|
7172
|
-
var
|
|
7184
|
+
var import_common13;
|
|
7173
7185
|
var init_contentSource = __esm({
|
|
7174
7186
|
"src/core/interfaces/contentSource.ts"() {
|
|
7175
7187
|
"use strict";
|
|
7176
7188
|
init_factory();
|
|
7177
7189
|
init_classroomDB2();
|
|
7178
|
-
|
|
7190
|
+
import_common13 = require("@vue-skuilder/common");
|
|
7179
7191
|
init_TagFilteredContentSource();
|
|
7180
7192
|
}
|
|
7181
7193
|
});
|
|
@@ -7273,11 +7285,11 @@ var init_util = __esm({
|
|
|
7273
7285
|
});
|
|
7274
7286
|
|
|
7275
7287
|
// src/core/bulkImport/cardProcessor.ts
|
|
7276
|
-
var
|
|
7288
|
+
var import_common14;
|
|
7277
7289
|
var init_cardProcessor = __esm({
|
|
7278
7290
|
"src/core/bulkImport/cardProcessor.ts"() {
|
|
7279
7291
|
"use strict";
|
|
7280
|
-
|
|
7292
|
+
import_common14 = require("@vue-skuilder/common");
|
|
7281
7293
|
init_logger();
|
|
7282
7294
|
}
|
|
7283
7295
|
});
|
|
@@ -7782,13 +7794,13 @@ function getStreak(records) {
|
|
|
7782
7794
|
function getLapses(records) {
|
|
7783
7795
|
return records.filter((r) => r.isCorrect === false).length;
|
|
7784
7796
|
}
|
|
7785
|
-
var import_moment4,
|
|
7797
|
+
var import_moment4, import_common15, duration;
|
|
7786
7798
|
var init_SpacedRepetition = __esm({
|
|
7787
7799
|
"src/study/SpacedRepetition.ts"() {
|
|
7788
7800
|
"use strict";
|
|
7789
7801
|
init_util();
|
|
7790
7802
|
import_moment4 = __toESM(require("moment"), 1);
|
|
7791
|
-
|
|
7803
|
+
import_common15 = require("@vue-skuilder/common");
|
|
7792
7804
|
init_logger();
|
|
7793
7805
|
duration = import_moment4.default.duration;
|
|
7794
7806
|
}
|
|
@@ -7807,42 +7819,42 @@ var init_SrsService = __esm({
|
|
|
7807
7819
|
});
|
|
7808
7820
|
|
|
7809
7821
|
// src/study/services/tagRecent.ts
|
|
7810
|
-
var
|
|
7822
|
+
var import_common16;
|
|
7811
7823
|
var init_tagRecent = __esm({
|
|
7812
7824
|
"src/study/services/tagRecent.ts"() {
|
|
7813
7825
|
"use strict";
|
|
7814
|
-
|
|
7826
|
+
import_common16 = require("@vue-skuilder/common");
|
|
7815
7827
|
}
|
|
7816
7828
|
});
|
|
7817
7829
|
|
|
7818
7830
|
// src/study/services/EloService.ts
|
|
7819
|
-
var
|
|
7831
|
+
var import_common17;
|
|
7820
7832
|
var init_EloService = __esm({
|
|
7821
7833
|
"src/study/services/EloService.ts"() {
|
|
7822
7834
|
"use strict";
|
|
7823
|
-
|
|
7835
|
+
import_common17 = require("@vue-skuilder/common");
|
|
7824
7836
|
init_logger();
|
|
7825
7837
|
init_tagRecent();
|
|
7826
7838
|
}
|
|
7827
7839
|
});
|
|
7828
7840
|
|
|
7829
7841
|
// src/study/services/ResponseProcessor.ts
|
|
7830
|
-
var
|
|
7842
|
+
var import_common18;
|
|
7831
7843
|
var init_ResponseProcessor = __esm({
|
|
7832
7844
|
"src/study/services/ResponseProcessor.ts"() {
|
|
7833
7845
|
"use strict";
|
|
7834
7846
|
init_core();
|
|
7835
7847
|
init_logger();
|
|
7836
|
-
|
|
7848
|
+
import_common18 = require("@vue-skuilder/common");
|
|
7837
7849
|
}
|
|
7838
7850
|
});
|
|
7839
7851
|
|
|
7840
7852
|
// src/study/services/CardHydrationService.ts
|
|
7841
|
-
var
|
|
7853
|
+
var import_common19;
|
|
7842
7854
|
var init_CardHydrationService = __esm({
|
|
7843
7855
|
"src/study/services/CardHydrationService.ts"() {
|
|
7844
7856
|
"use strict";
|
|
7845
|
-
|
|
7857
|
+
import_common19 = require("@vue-skuilder/common");
|
|
7846
7858
|
init_logger();
|
|
7847
7859
|
}
|
|
7848
7860
|
});
|
|
@@ -10008,13 +10020,13 @@ async function dropUserFromClassroom(user, classID) {
|
|
|
10008
10020
|
async function getUserClassrooms(user) {
|
|
10009
10021
|
return getOrCreateClassroomRegistrationsDoc(user);
|
|
10010
10022
|
}
|
|
10011
|
-
var
|
|
10023
|
+
var import_common20, import_moment7, log3, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
|
|
10012
10024
|
var init_BaseUserDB = __esm({
|
|
10013
10025
|
"src/impl/common/BaseUserDB.ts"() {
|
|
10014
10026
|
"use strict";
|
|
10015
10027
|
init_core();
|
|
10016
10028
|
init_util();
|
|
10017
|
-
|
|
10029
|
+
import_common20 = require("@vue-skuilder/common");
|
|
10018
10030
|
import_moment7 = __toESM(require("moment"), 1);
|
|
10019
10031
|
init_types_legacy();
|
|
10020
10032
|
init_logger();
|
|
@@ -10117,7 +10129,7 @@ Currently logged-in as ${this._username}.`
|
|
|
10117
10129
|
);
|
|
10118
10130
|
}
|
|
10119
10131
|
const result = await this.syncStrategy.createAccount(username, password);
|
|
10120
|
-
if (result.status ===
|
|
10132
|
+
if (result.status === import_common20.Status.ok) {
|
|
10121
10133
|
log3(`Account created successfully, updating username to ${username}`);
|
|
10122
10134
|
this._username = username;
|
|
10123
10135
|
try {
|
|
@@ -10193,7 +10205,7 @@ Currently logged-in as ${this._username}.`
|
|
|
10193
10205
|
async resetUserData() {
|
|
10194
10206
|
if (this.syncStrategy.canAuthenticate()) {
|
|
10195
10207
|
return {
|
|
10196
|
-
status:
|
|
10208
|
+
status: import_common20.Status.error,
|
|
10197
10209
|
error: "Reset user data is only available for local-only mode. Use logout instead for remote sync."
|
|
10198
10210
|
};
|
|
10199
10211
|
}
|
|
@@ -10215,11 +10227,11 @@ Currently logged-in as ${this._username}.`
|
|
|
10215
10227
|
await localDB.bulkDocs(docsToDelete);
|
|
10216
10228
|
}
|
|
10217
10229
|
await this.init();
|
|
10218
|
-
return { status:
|
|
10230
|
+
return { status: import_common20.Status.ok };
|
|
10219
10231
|
} catch (error) {
|
|
10220
10232
|
logger.error("Failed to reset user data:", error);
|
|
10221
10233
|
return {
|
|
10222
|
-
status:
|
|
10234
|
+
status: import_common20.Status.error,
|
|
10223
10235
|
error: error instanceof Error ? error.message : "Unknown error during reset"
|
|
10224
10236
|
};
|
|
10225
10237
|
}
|
|
@@ -11560,14 +11572,14 @@ var init_auth = __esm({
|
|
|
11560
11572
|
});
|
|
11561
11573
|
|
|
11562
11574
|
// src/impl/couch/CouchDBSyncStrategy.ts
|
|
11563
|
-
var
|
|
11575
|
+
var import_common22, log4, CouchDBSyncStrategy;
|
|
11564
11576
|
var init_CouchDBSyncStrategy = __esm({
|
|
11565
11577
|
"src/impl/couch/CouchDBSyncStrategy.ts"() {
|
|
11566
11578
|
"use strict";
|
|
11567
11579
|
init_factory();
|
|
11568
11580
|
init_types_legacy();
|
|
11569
11581
|
init_logger();
|
|
11570
|
-
|
|
11582
|
+
import_common22 = require("@vue-skuilder/common");
|
|
11571
11583
|
init_common();
|
|
11572
11584
|
init_pouchdb_setup();
|
|
11573
11585
|
init_couch();
|
|
@@ -11708,32 +11720,32 @@ var init_CouchDBSyncStrategy = __esm({
|
|
|
11708
11720
|
}
|
|
11709
11721
|
}
|
|
11710
11722
|
return {
|
|
11711
|
-
status:
|
|
11723
|
+
status: import_common22.Status.ok,
|
|
11712
11724
|
error: void 0
|
|
11713
11725
|
};
|
|
11714
11726
|
} else {
|
|
11715
11727
|
return {
|
|
11716
|
-
status:
|
|
11728
|
+
status: import_common22.Status.error,
|
|
11717
11729
|
error: "Failed to log in after account creation"
|
|
11718
11730
|
};
|
|
11719
11731
|
}
|
|
11720
11732
|
} else {
|
|
11721
11733
|
logger.warn(`Signup not OK: ${JSON.stringify(signupRequest)}`);
|
|
11722
11734
|
return {
|
|
11723
|
-
status:
|
|
11735
|
+
status: import_common22.Status.error,
|
|
11724
11736
|
error: "Account creation failed"
|
|
11725
11737
|
};
|
|
11726
11738
|
}
|
|
11727
11739
|
} catch (e) {
|
|
11728
11740
|
if (e.reason === "Document update conflict.") {
|
|
11729
11741
|
return {
|
|
11730
|
-
status:
|
|
11742
|
+
status: import_common22.Status.error,
|
|
11731
11743
|
error: "This username is taken!"
|
|
11732
11744
|
};
|
|
11733
11745
|
}
|
|
11734
11746
|
logger.error(`Error on signup: ${JSON.stringify(e)}`);
|
|
11735
11747
|
return {
|
|
11736
|
-
status:
|
|
11748
|
+
status: import_common22.Status.error,
|
|
11737
11749
|
error: e.message || "Unknown error during account creation"
|
|
11738
11750
|
};
|
|
11739
11751
|
}
|