@vue-skuilder/db 0.2.4 → 0.2.5
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/core/index.js +5 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +5 -4
- package/dist/core/index.mjs.map +1 -1
- package/dist/impl/couch/index.js +5 -4
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +5 -4
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.js +5 -4
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +5 -4
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +58 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +207 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +207 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/navigators/generators/elo.ts +32 -11
- package/src/study/SessionController.ts +104 -3
- package/src/study/SessionOverlay.ts +245 -21
|
@@ -1689,12 +1689,13 @@ __export(elo_exports, {
|
|
|
1689
1689
|
default: () => ELONavigator
|
|
1690
1690
|
});
|
|
1691
1691
|
import { toCourseElo as toCourseElo2 } from "@vue-skuilder/common";
|
|
1692
|
-
var ELONavigator;
|
|
1692
|
+
var ELO_RELEVANCE_SIGMA, ELONavigator;
|
|
1693
1693
|
var init_elo = __esm({
|
|
1694
1694
|
"src/core/navigators/generators/elo.ts"() {
|
|
1695
1695
|
"use strict";
|
|
1696
1696
|
init_navigators();
|
|
1697
1697
|
init_logger();
|
|
1698
|
+
ELO_RELEVANCE_SIGMA = 300;
|
|
1698
1699
|
ELONavigator = class extends ContentNavigator {
|
|
1699
1700
|
/** Human-readable name for CardGenerator interface */
|
|
1700
1701
|
name;
|
|
@@ -1734,8 +1735,8 @@ var init_elo = __esm({
|
|
|
1734
1735
|
const scored = newCards.map((c) => {
|
|
1735
1736
|
const cardElo = c.elo ?? 1e3;
|
|
1736
1737
|
const distance = Math.abs(cardElo - userGlobalElo);
|
|
1737
|
-
const
|
|
1738
|
-
const samplingKey =
|
|
1738
|
+
const relevance = Math.exp(-((distance / ELO_RELEVANCE_SIGMA) ** 2));
|
|
1739
|
+
const samplingKey = relevance * (0.5 + 0.5 * Math.random());
|
|
1739
1740
|
return {
|
|
1740
1741
|
cardId: c.cardID,
|
|
1741
1742
|
courseId: c.courseID,
|
|
@@ -1747,7 +1748,7 @@ var init_elo = __esm({
|
|
|
1747
1748
|
strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
|
|
1748
1749
|
action: "generated",
|
|
1749
1750
|
score: samplingKey,
|
|
1750
|
-
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}),
|
|
1751
|
+
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), relevance ${relevance.toFixed(3)}, key ${samplingKey.toFixed(3)}`
|
|
1751
1752
|
}
|
|
1752
1753
|
]
|
|
1753
1754
|
};
|