@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
|
@@ -1589,13 +1589,14 @@ var elo_exports = {};
|
|
|
1589
1589
|
__export(elo_exports, {
|
|
1590
1590
|
default: () => ELONavigator
|
|
1591
1591
|
});
|
|
1592
|
-
var import_common5, ELONavigator;
|
|
1592
|
+
var import_common5, ELO_RELEVANCE_SIGMA, ELONavigator;
|
|
1593
1593
|
var init_elo = __esm({
|
|
1594
1594
|
"src/core/navigators/generators/elo.ts"() {
|
|
1595
1595
|
"use strict";
|
|
1596
1596
|
init_navigators();
|
|
1597
1597
|
import_common5 = require("@vue-skuilder/common");
|
|
1598
1598
|
init_logger();
|
|
1599
|
+
ELO_RELEVANCE_SIGMA = 300;
|
|
1599
1600
|
ELONavigator = class extends ContentNavigator {
|
|
1600
1601
|
/** Human-readable name for CardGenerator interface */
|
|
1601
1602
|
name;
|
|
@@ -1635,8 +1636,8 @@ var init_elo = __esm({
|
|
|
1635
1636
|
const scored = newCards.map((c) => {
|
|
1636
1637
|
const cardElo = c.elo ?? 1e3;
|
|
1637
1638
|
const distance = Math.abs(cardElo - userGlobalElo);
|
|
1638
|
-
const
|
|
1639
|
-
const samplingKey =
|
|
1639
|
+
const relevance = Math.exp(-((distance / ELO_RELEVANCE_SIGMA) ** 2));
|
|
1640
|
+
const samplingKey = relevance * (0.5 + 0.5 * Math.random());
|
|
1640
1641
|
return {
|
|
1641
1642
|
cardId: c.cardID,
|
|
1642
1643
|
courseId: c.courseID,
|
|
@@ -1648,7 +1649,7 @@ var init_elo = __esm({
|
|
|
1648
1649
|
strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
|
|
1649
1650
|
action: "generated",
|
|
1650
1651
|
score: samplingKey,
|
|
1651
|
-
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}),
|
|
1652
|
+
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), relevance ${relevance.toFixed(3)}, key ${samplingKey.toFixed(3)}`
|
|
1652
1653
|
}
|
|
1653
1654
|
]
|
|
1654
1655
|
};
|