@vue-skuilder/db 0.1.30 → 0.1.31-a
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-ygoFw9oV.d.ts → contentSource-BmnmvH8C.d.ts} +4 -19
- package/dist/{contentSource-B7nXusjk.d.cts → contentSource-DfBbaLA-.d.cts} +4 -19
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +11 -18
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +11 -17
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-BW7HvkMt.d.cts → dataLayerProvider-BeRXVMs5.d.cts} +1 -1
- package/dist/{dataLayerProvider-BfXUVDuG.d.ts → dataLayerProvider-CG9GfaAY.d.ts} +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 +11 -16
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +11 -16
- 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 +11 -16
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +11 -16
- 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 +11 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -17
- package/dist/index.mjs.map +1 -1
- package/docs/navigators-architecture.md +5 -64
- package/package.json +3 -3
- package/src/core/navigators/generators/elo.ts +17 -6
- package/src/core/navigators/index.ts +10 -43
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, W as WeightedCard } from '../../contentSource-
|
|
2
|
-
import { D as DataLayerProvider } from '../../dataLayerProvider-
|
|
1
|
+
import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, W as WeightedCard } from '../../contentSource-DfBbaLA-.cjs';
|
|
2
|
+
import { D as DataLayerProvider } from '../../dataLayerProvider-BeRXVMs5.cjs';
|
|
3
3
|
import { S as StaticCourseManifest } from '../../types-W8n-B6HG.cjs';
|
|
4
4
|
import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
|
|
5
5
|
import { S as SkuilderCourseData, Q as QualifiedCardID, T as TagStub, a as Tag } from '../../types-legacy-JXDxinpU.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, W as WeightedCard } from '../../contentSource-
|
|
2
|
-
import { D as DataLayerProvider } from '../../dataLayerProvider-
|
|
1
|
+
import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, W as WeightedCard } from '../../contentSource-BmnmvH8C.js';
|
|
2
|
+
import { D as DataLayerProvider } from '../../dataLayerProvider-CG9GfaAY.js';
|
|
3
3
|
import { S as StaticCourseManifest } from '../../types-CJrLM1Ew.js';
|
|
4
4
|
import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
|
|
5
5
|
import { S as SkuilderCourseData, Q as QualifiedCardID, T as TagStub, a as Tag } from '../../types-legacy-JXDxinpU.js';
|
|
@@ -1032,19 +1032,20 @@ var init_elo = __esm({
|
|
|
1032
1032
|
const scored = newCards.map((c, i) => {
|
|
1033
1033
|
const cardElo = cardEloData[i]?.global?.score ?? 1e3;
|
|
1034
1034
|
const distance = Math.abs(cardElo - userGlobalElo);
|
|
1035
|
-
const
|
|
1035
|
+
const rawScore = Math.max(0, 1 - distance / 500);
|
|
1036
|
+
const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
|
|
1036
1037
|
return {
|
|
1037
1038
|
cardId: c.cardID,
|
|
1038
1039
|
courseId: c.courseID,
|
|
1039
|
-
score,
|
|
1040
|
+
score: samplingKey,
|
|
1040
1041
|
provenance: [
|
|
1041
1042
|
{
|
|
1042
1043
|
strategy: "elo",
|
|
1043
1044
|
strategyName: this.strategyName || this.name,
|
|
1044
1045
|
strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
|
|
1045
1046
|
action: "generated",
|
|
1046
|
-
score,
|
|
1047
|
-
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}),
|
|
1047
|
+
score: samplingKey,
|
|
1048
|
+
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
|
|
1048
1049
|
}
|
|
1049
1050
|
]
|
|
1050
1051
|
};
|
|
@@ -2737,7 +2738,6 @@ __export(navigators_exports, {
|
|
|
2737
2738
|
getCardOrigin: () => getCardOrigin,
|
|
2738
2739
|
getRegisteredNavigator: () => getRegisteredNavigator,
|
|
2739
2740
|
getRegisteredNavigatorNames: () => getRegisteredNavigatorNames,
|
|
2740
|
-
getRegisteredNavigatorRole: () => getRegisteredNavigatorRole,
|
|
2741
2741
|
hasRegisteredNavigator: () => hasRegisteredNavigator,
|
|
2742
2742
|
initializeNavigatorRegistry: () => initializeNavigatorRegistry,
|
|
2743
2743
|
isFilter: () => isFilter,
|
|
@@ -2746,19 +2746,16 @@ __export(navigators_exports, {
|
|
|
2746
2746
|
pipelineDebugAPI: () => pipelineDebugAPI,
|
|
2747
2747
|
registerNavigator: () => registerNavigator
|
|
2748
2748
|
});
|
|
2749
|
-
function registerNavigator(implementingClass, constructor
|
|
2750
|
-
navigatorRegistry.set(implementingClass,
|
|
2751
|
-
logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}
|
|
2749
|
+
function registerNavigator(implementingClass, constructor) {
|
|
2750
|
+
navigatorRegistry.set(implementingClass, constructor);
|
|
2751
|
+
logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}`);
|
|
2752
2752
|
}
|
|
2753
2753
|
function getRegisteredNavigator(implementingClass) {
|
|
2754
|
-
return navigatorRegistry.get(implementingClass)
|
|
2754
|
+
return navigatorRegistry.get(implementingClass);
|
|
2755
2755
|
}
|
|
2756
2756
|
function hasRegisteredNavigator(implementingClass) {
|
|
2757
2757
|
return navigatorRegistry.has(implementingClass);
|
|
2758
2758
|
}
|
|
2759
|
-
function getRegisteredNavigatorRole(implementingClass) {
|
|
2760
|
-
return navigatorRegistry.get(implementingClass)?.role;
|
|
2761
|
-
}
|
|
2762
2759
|
function getRegisteredNavigatorNames() {
|
|
2763
2760
|
return Array.from(navigatorRegistry.keys());
|
|
2764
2761
|
}
|
|
@@ -2804,12 +2801,10 @@ function getCardOrigin(card) {
|
|
|
2804
2801
|
return "new";
|
|
2805
2802
|
}
|
|
2806
2803
|
function isGenerator(impl) {
|
|
2807
|
-
|
|
2808
|
-
return getRegisteredNavigatorRole(impl) === "generator" /* GENERATOR */;
|
|
2804
|
+
return NavigatorRoles[impl] === "generator" /* GENERATOR */;
|
|
2809
2805
|
}
|
|
2810
2806
|
function isFilter(impl) {
|
|
2811
|
-
|
|
2812
|
-
return getRegisteredNavigatorRole(impl) === "filter" /* FILTER */;
|
|
2807
|
+
return NavigatorRoles[impl] === "filter" /* FILTER */;
|
|
2813
2808
|
}
|
|
2814
2809
|
var navigatorRegistry, Navigators, NavigatorRole, NavigatorRoles, ContentNavigator;
|
|
2815
2810
|
var init_navigators = __esm({
|