@vue-skuilder/standalone-ui 0.2.1 → 0.2.3
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/assets/{TagViewer-D34iA3OS.js → TagViewer-DNyvVy4Y.js} +2 -2
- package/dist/assets/{TagViewer-D34iA3OS.js.map → TagViewer-DNyvVy4Y.js.map} +1 -1
- package/dist/assets/{common-ui.es-B6UqZKxa.js → common-ui.es-BLg_8nr-.js} +6 -6
- package/dist/assets/common-ui.es-BLg_8nr-.js.map +1 -0
- package/dist/assets/common-ui.es-CYWOpJag.js +1 -0
- package/dist/assets/{dist-B6gIbmvQ.js → dist-Dw3a5Op4.js} +9 -9
- package/dist/assets/dist-Dw3a5Op4.js.map +1 -0
- package/dist/assets/{index-5H45bc-8.js → index-BUyUeqxf.js} +5 -5
- package/dist/assets/{index-5H45bc-8.js.map → index-BUyUeqxf.js.map} +1 -1
- package/dist/assets/{index-CwbD9tGY.css → index-Dq44sLx5.css} +1 -1
- package/dist/index.html +4 -4
- package/dist-lib/questions.cjs.js +10 -10
- package/dist-lib/questions.cjs.js.map +1 -1
- package/dist-lib/questions.mjs +109 -40
- package/dist-lib/questions.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/assets/common-ui.es-B6UqZKxa.js.map +0 -1
- package/dist/assets/common-ui.es-r5-FfEsi.js +0 -1
- package/dist/assets/dist-B6gIbmvQ.js.map +0 -1
package/dist-lib/questions.mjs
CHANGED
|
@@ -27128,29 +27128,29 @@ var import___vite_browser_external, import___vite_browser_external$1, import___v
|
|
|
27128
27128
|
}, (t) => !d.some((c) => t.cardID === c.cardID))).map((t) => ({
|
|
27129
27129
|
...t,
|
|
27130
27130
|
status: "new"
|
|
27131
|
-
}))
|
|
27132
|
-
let
|
|
27131
|
+
})).map((t) => {
|
|
27132
|
+
let c = t.elo ?? 1e3, d = Math.abs(c - u), m = Math.max(0, 1 - d / 500), g = m > 0 ? Math.random() ** (1 / m) : 0;
|
|
27133
27133
|
return {
|
|
27134
27134
|
cardId: t.cardID,
|
|
27135
27135
|
courseId: t.courseID,
|
|
27136
|
-
score:
|
|
27136
|
+
score: g,
|
|
27137
27137
|
provenance: [{
|
|
27138
27138
|
strategy: "elo",
|
|
27139
27139
|
strategyName: this.strategyName || this.name,
|
|
27140
27140
|
strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
|
|
27141
27141
|
action: "generated",
|
|
27142
|
-
score:
|
|
27143
|
-
reason: `ELO distance ${Math.round(
|
|
27142
|
+
score: g,
|
|
27143
|
+
reason: `ELO distance ${Math.round(d)} (card: ${Math.round(c)}, user: ${Math.round(u)}), raw ${m.toFixed(3)}, key ${g.toFixed(3)}`
|
|
27144
27144
|
}]
|
|
27145
27145
|
};
|
|
27146
27146
|
});
|
|
27147
|
-
|
|
27148
|
-
let
|
|
27149
|
-
if (
|
|
27150
|
-
let t =
|
|
27151
|
-
logger.info(`[ELO] Course ${this.course.getCourseID()}: ${
|
|
27147
|
+
m.sort((t, c) => c.score - t.score);
|
|
27148
|
+
let g = m.slice(0, t);
|
|
27149
|
+
if (g.length > 0) {
|
|
27150
|
+
let t = g.slice(0, 3).map((t) => t.score.toFixed(2)).join(", ");
|
|
27151
|
+
logger.info(`[ELO] Course ${this.course.getCourseID()}: ${g.length} new cards (top scores: ${t})`);
|
|
27152
27152
|
} else logger.info(`[ELO] Course ${this.course.getCourseID()}: No new cards available`);
|
|
27153
|
-
return { cards:
|
|
27153
|
+
return { cards: g };
|
|
27154
27154
|
}
|
|
27155
27155
|
};
|
|
27156
27156
|
} }), generators_exports = {}, init_generators = __esm({ "src/core/navigators/generators/index.ts"() {} }), prescribed_exports = {}, __export(prescribed_exports, { default: () => PrescribedCardsGenerator }), init_prescribed = __esm({ "src/core/navigators/generators/prescribed.ts"() {
|
|
@@ -27958,7 +27958,10 @@ var import___vite_browser_external, import___vite_browser_external$1, import___v
|
|
|
27958
27958
|
init_signal(), init_types_legacy(), init_logger();
|
|
27959
27959
|
} }), init_orchestration = __esm({ "src/core/orchestration/index.ts"() {
|
|
27960
27960
|
init_logger(), init_gradient(), init_learning(), init_signal(), init_recording(), MIN_SPREAD = .1, MAX_SPREAD = .5, MIN_WEIGHT = .1, MAX_WEIGHT = 3;
|
|
27961
|
-
} }), Pipeline_exports = {}, __export(Pipeline_exports, {
|
|
27961
|
+
} }), Pipeline_exports = {}, __export(Pipeline_exports, {
|
|
27962
|
+
Pipeline: () => Pipeline,
|
|
27963
|
+
mergeHints: () => mergeHints2
|
|
27964
|
+
}), init_Pipeline = __esm({ "src/core/navigators/Pipeline.ts"() {
|
|
27962
27965
|
init_navigators(), init_logger(), init_orchestration(), init_PipelineDebugger(), VERBOSE_RESULTS = !0, Pipeline = class extends ContentNavigator {
|
|
27963
27966
|
constructor(t, c, u, d) {
|
|
27964
27967
|
super(), _defineProperty$2(this, "generator", void 0), _defineProperty$2(this, "filters", void 0), _defineProperty$2(this, "_cachedOrchestration", null), _defineProperty$2(this, "_tagCache", /* @__PURE__ */ new Map()), _defineProperty$2(this, "_ephemeralHints", null), this.generator = t, this.filters = c, this.user = u, this.course = d, d.getCourseConfig().then((t) => {
|
|
@@ -28392,7 +28395,7 @@ var import___vite_browser_external, import___vite_browser_external$1, import___v
|
|
|
28392
28395
|
}
|
|
28393
28396
|
}, CourseDB = class {
|
|
28394
28397
|
constructor(t, c, u) {
|
|
28395
|
-
_defineProperty$2(this, "db", void 0), _defineProperty$2(this, "remoteDB", void 0), _defineProperty$2(this, "id", void 0), _defineProperty$2(this, "_getCurrentUser", void 0), _defineProperty$2(this, "updateQueue", void 0), _defineProperty$2(this, "_pendingHints", null), this.id = t;
|
|
28398
|
+
_defineProperty$2(this, "db", void 0), _defineProperty$2(this, "remoteDB", void 0), _defineProperty$2(this, "id", void 0), _defineProperty$2(this, "_getCurrentUser", void 0), _defineProperty$2(this, "updateQueue", void 0), _defineProperty$2(this, "_pendingHints", null), _defineProperty$2(this, "_eloPoolCache", null), _defineProperty$2(this, "_eloPoolTtlMs", 300 * 1e3), _defineProperty$2(this, "_cachedNavigator", null), _defineProperty$2(this, "_navigatorTtlMs", 300 * 1e3), this.id = t;
|
|
28396
28399
|
let d = getCourseDB2(this.id);
|
|
28397
28400
|
this.remoteDB = d, this.db = u ?? d, this._getCurrentUser = c, this.updateQueue = new UpdateQueue(this.remoteDB, this.remoteDB);
|
|
28398
28401
|
}
|
|
@@ -28637,7 +28640,7 @@ ${g.rows.map((t) => ` ${t.id}-${t.key}
|
|
|
28637
28640
|
})).rows.map((t) => t.doc);
|
|
28638
28641
|
}
|
|
28639
28642
|
async addNavigationStrategy(t) {
|
|
28640
|
-
return logger.debug(`[courseDB] Adding navigation strategy: ${t._id}`), this.remoteDB.put(t).then(() => {});
|
|
28643
|
+
return logger.debug(`[courseDB] Adding navigation strategy: ${t._id}`), this.invalidateNavigatorCache(), this.remoteDB.put(t).then(() => {});
|
|
28641
28644
|
}
|
|
28642
28645
|
updateNavigationStrategy(t, c) {
|
|
28643
28646
|
return logger.debug(`[courseDB] Updating navigation strategy: ${t}`), logger.debug(JSON.stringify(c)), Promise.resolve();
|
|
@@ -28665,12 +28668,31 @@ ${t.stack}` : JSON.stringify(t);
|
|
|
28665
28668
|
async getWeightedCards(t) {
|
|
28666
28669
|
let c = await this._getCurrentUser();
|
|
28667
28670
|
try {
|
|
28668
|
-
let u = await this.
|
|
28669
|
-
return this._pendingHints && (u.setEphemeralHints(this._pendingHints), this._pendingHints = null), u.getWeightedCards(t);
|
|
28671
|
+
let { navigator: u } = await this._getCachedNavigator(c);
|
|
28672
|
+
return this._pendingHints && (u.setEphemeralHints(this._pendingHints), this._pendingHints = null), await u.getWeightedCards(t);
|
|
28670
28673
|
} catch (t) {
|
|
28671
28674
|
throw logger.error(`[courseDB] Error getting weighted cards: ${t}`), t;
|
|
28672
28675
|
}
|
|
28673
28676
|
}
|
|
28677
|
+
async _getCachedNavigator(t) {
|
|
28678
|
+
let c = t.getUsername(), u = Date.now();
|
|
28679
|
+
if (this._cachedNavigator && this._cachedNavigator.userId === c && u - this._cachedNavigator.builtAt < this._navigatorTtlMs) return {
|
|
28680
|
+
navigator: this._cachedNavigator.navigator,
|
|
28681
|
+
cacheStatus: "hit"
|
|
28682
|
+
};
|
|
28683
|
+
let d = await this.createNavigator(t);
|
|
28684
|
+
return this._cachedNavigator = {
|
|
28685
|
+
navigator: d,
|
|
28686
|
+
userId: c,
|
|
28687
|
+
builtAt: u
|
|
28688
|
+
}, {
|
|
28689
|
+
navigator: d,
|
|
28690
|
+
cacheStatus: "miss"
|
|
28691
|
+
};
|
|
28692
|
+
}
|
|
28693
|
+
invalidateNavigatorCache() {
|
|
28694
|
+
this._cachedNavigator = null;
|
|
28695
|
+
}
|
|
28674
28696
|
async getCardsCenteredAtELO(t = {
|
|
28675
28697
|
limit: 99,
|
|
28676
28698
|
elo: "user"
|
|
@@ -28688,11 +28710,28 @@ ${t.stack}` : JSON.stringify(t);
|
|
|
28688
28710
|
let t = await GET_CACHED(`elo-bounds-${this.id}`, () => this.getELOBounds());
|
|
28689
28711
|
u = Math.round(t.low + Math.random() * (t.high - t.low));
|
|
28690
28712
|
} else u = t.elo;
|
|
28691
|
-
let d =
|
|
28692
|
-
|
|
28713
|
+
let d = Math.max(2e3, t.limit * 4), m = Date.now(), g = "hit";
|
|
28714
|
+
if (!this._eloPoolCache || m - this._eloPoolCache.fetchedAt > this._eloPoolTtlMs) {
|
|
28715
|
+
let t = await this.getCardsByELO(u, d);
|
|
28716
|
+
t.length > 0 && (this._eloPoolCache = {
|
|
28717
|
+
rows: t,
|
|
28718
|
+
fetchedAt: m
|
|
28719
|
+
}), g = "miss";
|
|
28720
|
+
}
|
|
28721
|
+
let rankAgainstCurrentElo = () => {
|
|
28722
|
+
let t = this._eloPoolCache?.rows ?? [];
|
|
28723
|
+
return (c ? t.filter((t) => c(t)) : t).map((t) => ({ ...t })).sort((t, c) => Math.abs((t.elo ?? u) - u) - Math.abs((c.elo ?? u) - u));
|
|
28724
|
+
}, b = rankAgainstCurrentElo();
|
|
28725
|
+
if (b.length < t.limit && (g === "hit" || !this._eloPoolCache)) {
|
|
28726
|
+
let t = await this.getCardsByELO(u, d);
|
|
28727
|
+
t.length > 0 && (this._eloPoolCache = {
|
|
28728
|
+
rows: t,
|
|
28729
|
+
fetchedAt: m
|
|
28730
|
+
}), b = rankAgainstCurrentElo(), g = "refresh";
|
|
28731
|
+
}
|
|
28693
28732
|
let S = [];
|
|
28694
|
-
for (; S.length < t.limit &&
|
|
28695
|
-
let t = randIntWeightedTowardZero(
|
|
28733
|
+
for (; S.length < t.limit && b.length > 0;) {
|
|
28734
|
+
let t = randIntWeightedTowardZero(b.length), c = b.splice(t, 1)[0];
|
|
28696
28735
|
S.push(c);
|
|
28697
28736
|
}
|
|
28698
28737
|
return S.map((t) => ({
|
|
@@ -30938,7 +30977,7 @@ ${c.id}:`), logger.info(JSON.stringify(c.doc, null, 2));
|
|
|
30938
30977
|
return `${typeof this.q[0]}:
|
|
30939
30978
|
` + this.q.map((t) => ` ${t.courseID}+${t.cardID}: ${t.status}`).join("\n");
|
|
30940
30979
|
}
|
|
30941
|
-
}, init_couch(), init_recording(), init_Loggable(), init_types_legacy(), init_logger(), CouchDBToStaticPacker = class {
|
|
30980
|
+
}, init_couch(), init_core(), init_recording(), init_Loggable(), init_types_legacy(), init_logger(), CouchDBToStaticPacker = class {
|
|
30942
30981
|
constructor(t = {}) {
|
|
30943
30982
|
_defineProperty$2(this, "config", void 0), _defineProperty$2(this, "sourceDB", null), this.config = {
|
|
30944
30983
|
chunkSize: 1e3,
|
|
@@ -31538,7 +31577,7 @@ ${c.id}:`), logger.info(JSON.stringify(c.doc, null, 2));
|
|
|
31538
31577
|
isLocalPath(t) {
|
|
31539
31578
|
return !t.startsWith("http://") && !t.startsWith("https://");
|
|
31540
31579
|
}
|
|
31541
|
-
}, init_dataDirectory(), init_navigators(), QuotaRoundRobinMixer = class {
|
|
31580
|
+
}, init_dataDirectory(), init_navigators(), init_Pipeline(), QuotaRoundRobinMixer = class {
|
|
31542
31581
|
mix(t, c) {
|
|
31543
31582
|
if (t.length === 0) return [];
|
|
31544
31583
|
let u = Math.ceil(c / t.length), d = t.map((t) => [...t.weighted].sort((t, c) => c.score - t.score).slice(0, u));
|
|
@@ -31711,7 +31750,7 @@ ${c.id}:`), logger.info(JSON.stringify(c.doc, null, 2));
|
|
|
31711
31750
|
return this.newQ.toString + "\n" + this.reviewQ.toString + "\n" + this.failedQ.toString;
|
|
31712
31751
|
}
|
|
31713
31752
|
constructor(t, c, u, d, m, g) {
|
|
31714
|
-
super(), _defineProperty$2(this, "_className", "SessionController"), _defineProperty$2(this, "services", void 0), _defineProperty$2(this, "srsService", void 0), _defineProperty$2(this, "eloService", void 0), _defineProperty$2(this, "hydrationService", void 0), _defineProperty$2(this, "mixer", void 0), _defineProperty$2(this, "dataLayer", void 0), _defineProperty$2(this, "courseNameCache", /* @__PURE__ */ new Map()), _defineProperty$2(this, "_defaultBatchLimit", 20), _defineProperty$2(this, "_initialReviewCap", 200), _defineProperty$2(this, "sources", void 0), _defineProperty$2(this, "_sessionRecord", []), _defineProperty$2(this, "_currentCard", null), _defineProperty$2(this, "reviewQ", new ItemQueue()), _defineProperty$2(this, "newQ", new ItemQueue()), _defineProperty$2(this, "failedQ", new ItemQueue()), _defineProperty$2(this, "_replanPromise", null), _defineProperty$2(this, "_wellIndicatedRemaining", 0), _defineProperty$2(this, "_suppressQualityReplan", !1), _defineProperty$2(this, "_minCardsGuarantee", 0), _defineProperty$2(this, "startTime", void 0), _defineProperty$2(this, "endTime", void 0), _defineProperty$2(this, "_secondsRemaining", void 0), _defineProperty$2(this, "_intervalHandle", void 0), this.dataLayer = u, this.mixer = m || new QuotaRoundRobinMixer(), this.srsService = new SrsService(u.getUserDB()), this.eloService = new EloService(u, u.getUserDB()), this.hydrationService = new CardHydrationService(d, (t) => u.getCourseDB(t), () => this._getItemsToHydrate()), this.services = { response: new ResponseProcessor(this.srsService, this.eloService) }, this.sources = t, this.startTime = /* @__PURE__ */ new Date(), this._secondsRemaining = c, this.endTime = new Date(this.startTime.valueOf() + 1e3 * this._secondsRemaining), g?.defaultBatchLimit !== void 0 && (this._defaultBatchLimit = g.defaultBatchLimit), g?.initialReviewCap !== void 0 && (this._initialReviewCap = g.initialReviewCap), this.log(`Session constructed:
|
|
31753
|
+
super(), _defineProperty$2(this, "_className", "SessionController"), _defineProperty$2(this, "services", void 0), _defineProperty$2(this, "srsService", void 0), _defineProperty$2(this, "eloService", void 0), _defineProperty$2(this, "hydrationService", void 0), _defineProperty$2(this, "mixer", void 0), _defineProperty$2(this, "dataLayer", void 0), _defineProperty$2(this, "courseNameCache", /* @__PURE__ */ new Map()), _defineProperty$2(this, "_defaultBatchLimit", 20), _defineProperty$2(this, "_initialReviewCap", 200), _defineProperty$2(this, "sources", void 0), _defineProperty$2(this, "_sessionRecord", []), _defineProperty$2(this, "_currentCard", null), _defineProperty$2(this, "reviewQ", new ItemQueue()), _defineProperty$2(this, "newQ", new ItemQueue()), _defineProperty$2(this, "failedQ", new ItemQueue()), _defineProperty$2(this, "_replanPromise", null), _defineProperty$2(this, "_wellIndicatedRemaining", 0), _defineProperty$2(this, "_suppressQualityReplan", !1), _defineProperty$2(this, "_minCardsGuarantee", 0), _defineProperty$2(this, "_sessionHints", null), _defineProperty$2(this, "_outcomeObservers", []), _defineProperty$2(this, "_sessionControls", null), _defineProperty$2(this, "startTime", void 0), _defineProperty$2(this, "endTime", void 0), _defineProperty$2(this, "_secondsRemaining", void 0), _defineProperty$2(this, "_intervalHandle", void 0), this.dataLayer = u, this.mixer = m || new QuotaRoundRobinMixer(), this.srsService = new SrsService(u.getUserDB()), this.eloService = new EloService(u, u.getUserDB()), this.hydrationService = new CardHydrationService(d, (t) => u.getCourseDB(t), () => this._getItemsToHydrate()), this.services = { response: new ResponseProcessor(this.srsService, this.eloService) }, this.sources = t, this.startTime = /* @__PURE__ */ new Date(), this._secondsRemaining = c, this.endTime = new Date(this.startTime.valueOf() + 1e3 * this._secondsRemaining), g?.defaultBatchLimit !== void 0 && (this._defaultBatchLimit = g.defaultBatchLimit), g?.initialReviewCap !== void 0 && (this._initialReviewCap = g.initialReviewCap), g?.outcomeObservers?.length && (this._outcomeObservers = [...g.outcomeObservers]), this.log(`Session constructed:
|
|
31715
31754
|
startTime: ${this.startTime}
|
|
31716
31755
|
endTime: ${this.endTime}
|
|
31717
31756
|
defaultBatchLimit: ${this._defaultBatchLimit}
|
|
@@ -31760,23 +31799,54 @@ ${c.id}:`), logger.info(JSON.stringify(c.doc, null, 2));
|
|
|
31760
31799
|
}), await d;
|
|
31761
31800
|
}
|
|
31762
31801
|
_replanHasIntent(t) {
|
|
31763
|
-
return !!(t.label || t.limit !== void 0 || t.minFollowUpCards !== void 0 || t.mode && t.mode !== "replace" || t.hints && Object.keys(t.hints).length > 0);
|
|
31802
|
+
return !!(t.label || t.limit !== void 0 || t.minFollowUpCards !== void 0 || t.mode && t.mode !== "replace" || t.hints && Object.keys(t.hints).length > 0 || t.sessionHints !== void 0);
|
|
31764
31803
|
}
|
|
31765
31804
|
async _runReplan(t) {
|
|
31766
31805
|
t.hints || (t.hints = {});
|
|
31767
31806
|
let c = t.hints, u = new Set(c.excludeCards ?? []);
|
|
31768
31807
|
this._currentCard?.item.cardID && u.add(this._currentCard.item.cardID);
|
|
31769
31808
|
for (let t of this._sessionRecord) u.add(t.card.card_id);
|
|
31770
|
-
|
|
31771
|
-
let c = t.label ? {
|
|
31772
|
-
...t.hints,
|
|
31773
|
-
_label: t.label
|
|
31774
|
-
} : t.hints;
|
|
31775
|
-
for (let t of this.sources) t.setEphemeralHints?.(c);
|
|
31776
|
-
}
|
|
31809
|
+
this.newQ.length > 0 && u.add(this.newQ.peek(0).cardID), c.excludeCards = [...u], t.sessionHints !== void 0 && (this._sessionHints = t.sessionHints, this.log(`[Replan] Session hints ${t.sessionHints ? "set" : "cleared"}: ${JSON.stringify(t.sessionHints)}`)), this._applyHintsToSources(t.hints, t.label);
|
|
31777
31810
|
let d = t.label ? ` [${t.label}]` : "";
|
|
31778
31811
|
this.log(`Mid-session replan requested${d} (limit: ${t.limit ?? "default"}, mode: ${t.mode ?? "replace"}${t.hints ? ", with hints" : ""})`), t.minFollowUpCards !== void 0 && t.minFollowUpCards > 0 && (this._minCardsGuarantee = Math.max(this._minCardsGuarantee, t.minFollowUpCards), this.log(`[Replan] Card guarantee set to ${this._minCardsGuarantee}`)), await this._executeReplan(t);
|
|
31779
31812
|
}
|
|
31813
|
+
setSessionHints(t) {
|
|
31814
|
+
this._sessionHints = t, this.log(`Session hints ${t ? "set" : "cleared"}: ${JSON.stringify(t)}`);
|
|
31815
|
+
}
|
|
31816
|
+
getSessionHints() {
|
|
31817
|
+
return this._sessionHints;
|
|
31818
|
+
}
|
|
31819
|
+
mergeSessionHints(t) {
|
|
31820
|
+
this._sessionHints = mergeHints2([this._sessionHints, t]) ?? null, this.log(`Session hints merged: ${JSON.stringify(this._sessionHints)}`);
|
|
31821
|
+
}
|
|
31822
|
+
_applyHintsToSources(t, c) {
|
|
31823
|
+
let u = t && c ? {
|
|
31824
|
+
...t,
|
|
31825
|
+
_label: c
|
|
31826
|
+
} : t, d = mergeHints2([this._sessionHints, u]);
|
|
31827
|
+
if (d) for (let t of this.sources) t.setEphemeralHints?.(d);
|
|
31828
|
+
}
|
|
31829
|
+
_getSessionControls() {
|
|
31830
|
+
return this._sessionControls || (this._sessionControls = {
|
|
31831
|
+
getSessionHints: () => this.getSessionHints(),
|
|
31832
|
+
setSessionHints: (t) => this.setSessionHints(t),
|
|
31833
|
+
mergeSessionHints: (t) => this.mergeSessionHints(t),
|
|
31834
|
+
requestReplan: (t) => this.requestReplan(t)
|
|
31835
|
+
}), this._sessionControls;
|
|
31836
|
+
}
|
|
31837
|
+
async _notifyOutcomeObservers(t, c, u) {
|
|
31838
|
+
if (this._outcomeObservers.length === 0 || !isQuestionRecord(t)) return;
|
|
31839
|
+
let d = {
|
|
31840
|
+
record: t,
|
|
31841
|
+
card: c.card,
|
|
31842
|
+
result: u
|
|
31843
|
+
}, m = this._getSessionControls();
|
|
31844
|
+
for (let t of this._outcomeObservers) try {
|
|
31845
|
+
await t(d, m);
|
|
31846
|
+
} catch (t) {
|
|
31847
|
+
this.error("[OutcomeObserver] observer threw; ignoring", t);
|
|
31848
|
+
}
|
|
31849
|
+
}
|
|
31780
31850
|
async _replanUncoalesced(t) {
|
|
31781
31851
|
let c = this._runReplan(t);
|
|
31782
31852
|
this._replanPromise = c.finally(() => {
|
|
@@ -31787,6 +31857,7 @@ ${c.id}:`), logger.info(JSON.stringify(c.doc, null, 2));
|
|
|
31787
31857
|
if (!t) return {};
|
|
31788
31858
|
let c = [
|
|
31789
31859
|
"hints",
|
|
31860
|
+
"sessionHints",
|
|
31790
31861
|
"limit",
|
|
31791
31862
|
"mode",
|
|
31792
31863
|
"label",
|
|
@@ -31862,7 +31933,9 @@ ${c.id}:`), logger.info(JSON.stringify(c.doc, null, 2));
|
|
|
31862
31933
|
};
|
|
31863
31934
|
}
|
|
31864
31935
|
async getWeightedContent(t) {
|
|
31865
|
-
let c = t?.replan ?? !1, u = t?.additive ?? !1, d = t?.limit ?? this._defaultBatchLimit, m = c ? d : d + this._initialReviewCap
|
|
31936
|
+
let c = t?.replan ?? !1, u = t?.additive ?? !1, d = t?.limit ?? this._defaultBatchLimit, m = c ? d : d + this._initialReviewCap;
|
|
31937
|
+
c || this._applyHintsToSources();
|
|
31938
|
+
let g = [];
|
|
31866
31939
|
for (let t = 0; t < this.sources.length; t++) {
|
|
31867
31940
|
let c = this.sources[t];
|
|
31868
31941
|
try {
|
|
@@ -31968,8 +32041,8 @@ ${c.id}:`), logger.info(JSON.stringify(c.doc, null, 2));
|
|
|
31968
32041
|
return this.log("Exhausted 20 skip attempts finding a hydratable card"), this._currentCard = null, endSessionTracking(), null;
|
|
31969
32042
|
}
|
|
31970
32043
|
async submitResponse(t, c, u, d, m, g, b, S, C) {
|
|
31971
|
-
let w = { ...d.item };
|
|
31972
|
-
return await this.
|
|
32044
|
+
let w = { ...d.item }, T = await this.services.response.processResponse(t, c, w, u, d, m, g, b, S, C);
|
|
32045
|
+
return await this._notifyOutcomeObservers(t, d, T), T;
|
|
31973
32046
|
}
|
|
31974
32047
|
dismissCurrentCard(t = "dismiss-success") {
|
|
31975
32048
|
if (this._currentCard) if (t === "dismiss-success") this.hydrationService.removeCard(this._currentCard.item.cardID);
|
|
@@ -42918,11 +42991,7 @@ var Ee$1, De$1, Oe$1, ke$1, Ae$1, je$1, Me$1, Ne$1, Pe$1, Fe$1, Ie$1, Le$1, Z$2,
|
|
|
42918
42991
|
}
|
|
42919
42992
|
}))).filter((t) => t !== null)), this.timeRemaining = this.sessionTimeLimit * 60, t = await Promise.all(this.contentSources.filter((t) => t.type === "classroom").map(async (t) => await this.dataLayer.getClassroomDB(t.id, "student"))), t.forEach((t) => {});
|
|
42920
42993
|
let c = {};
|
|
42921
|
-
|
|
42922
|
-
for (let t of this.sessionContentSources) t.setEphemeralHints?.(this.sessionConfig.initHints);
|
|
42923
|
-
console.log("[StudySession] Applied init hints to content sources");
|
|
42924
|
-
}
|
|
42925
|
-
await this.sessionController.prepareSession(), this.intervalHandler = setInterval(this.tick, 1e3), this.sessionPrepared = !0, console.log("[StudySession] Session preparation complete, emitting session-prepared event"), this.$emit("session-prepared"), console.log("[StudySession] Event emission completed");
|
|
42994
|
+
this.sessionConfig?.defaultBatchLimit !== void 0 && (c.defaultBatchLimit = this.sessionConfig.defaultBatchLimit), this.sessionConfig?.initialReviewCap !== void 0 && (c.initialReviewCap = this.sessionConfig.initialReviewCap), this.sessionConfig?.outcomeObservers?.length && (c.outcomeObservers = this.sessionConfig.outcomeObservers), this.sessionController = markRaw(new SessionController(this.sessionContentSources, 60 * this.sessionTimeLimit, this.dataLayer, this.getViewComponent, void 0, c)), this.sessionController.sessionRecord = this.sessionRecord, this.sessionConfig?.initHints && (this.sessionController.setSessionHints(this.sessionConfig.initHints), console.log("[StudySession] Applied init hints as session-durable hints")), await this.sessionController.prepareSession(), this.intervalHandler = setInterval(this.tick, 1e3), this.sessionPrepared = !0, console.log("[StudySession] Session preparation complete, emitting session-prepared event"), this.$emit("session-prepared"), console.log("[StudySession] Event emission completed");
|
|
42926
42995
|
} catch (t) {
|
|
42927
42996
|
console.error("[StudySession] Error during session preparation:", t), this.$emit("session-error", {
|
|
42928
42997
|
message: "Failed to prepare study session",
|
|
@@ -43039,7 +43108,7 @@ var Ee$1, De$1, Oe$1, ke$1, Ae$1, je$1, Me$1, Ne$1, Pe$1, Fe$1, Ie$1, Le$1, Z$2,
|
|
|
43039
43108
|
key: 4,
|
|
43040
43109
|
ref: "shadowWrapper",
|
|
43041
43110
|
class: "card-transition-container"
|
|
43042
|
-
}, on = { key: 0 }, __name(_sfc_render$15, "_sfc_render"), sn = /* @__PURE__ */ F$3(Qt, [["render", _sfc_render$15], ["__scopeId", "data-v-
|
|
43111
|
+
}, on = { key: 0 }, __name(_sfc_render$15, "_sfc_render"), sn = /* @__PURE__ */ F$3(Qt, [["render", _sfc_render$15], ["__scopeId", "data-v-de7119e9"]]), cn = /* @__PURE__ */ defineComponent({
|
|
43043
43112
|
name: "MultipleChoiceOption",
|
|
43044
43113
|
components: { MarkdownRenderer: /* @__PURE__ */ defineAsyncComponent(() => Promise.resolve().then(() => (init_MarkdownRenderer_DoVbFpA6(), MarkdownRenderer_DoVbFpA6_exports)).then((t) => t.n)) },
|
|
43045
43114
|
props: {
|