@vue-skuilder/db 0.2.33 → 0.2.35

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.
Files changed (49) hide show
  1. package/dist/{contentSource-JmWYu8IK.d.ts → contentSource-BteiDpxH.d.ts} +2 -2
  2. package/dist/{contentSource-CTQ4kWhR.d.cts → contentSource-FQZcZopC.d.cts} +2 -2
  3. package/dist/core/index.d.cts +5 -5
  4. package/dist/core/index.d.ts +5 -5
  5. package/dist/core/index.js +2 -1
  6. package/dist/core/index.js.map +1 -1
  7. package/dist/core/index.mjs +2 -1
  8. package/dist/core/index.mjs.map +1 -1
  9. package/dist/{dataLayerProvider-DfI_KYAe.d.cts → dataLayerProvider-3y21KtF-.d.cts} +1 -1
  10. package/dist/{dataLayerProvider-rlLE2Mf-.d.ts → dataLayerProvider-C_QWzHf-.d.ts} +1 -1
  11. package/dist/diagnostics/index.d.cts +108 -5
  12. package/dist/diagnostics/index.d.ts +108 -5
  13. package/dist/diagnostics/index.js +129 -0
  14. package/dist/diagnostics/index.js.map +1 -1
  15. package/dist/diagnostics/index.mjs +128 -0
  16. package/dist/diagnostics/index.mjs.map +1 -1
  17. package/dist/impl/couch/index.d.cts +3 -3
  18. package/dist/impl/couch/index.d.ts +3 -3
  19. package/dist/impl/couch/index.js +2 -1
  20. package/dist/impl/couch/index.js.map +1 -1
  21. package/dist/impl/couch/index.mjs +2 -1
  22. package/dist/impl/couch/index.mjs.map +1 -1
  23. package/dist/impl/static/index.d.cts +4 -4
  24. package/dist/impl/static/index.d.ts +4 -4
  25. package/dist/impl/static/index.js +2 -1
  26. package/dist/impl/static/index.js.map +1 -1
  27. package/dist/impl/static/index.mjs +2 -1
  28. package/dist/impl/static/index.mjs.map +1 -1
  29. package/dist/{index-Ktg72jKb.d.cts → index-BIum9Ue2.d.cts} +1 -1
  30. package/dist/{index-CVGehe_t.d.ts → index-C745YB_6.d.ts} +1 -1
  31. package/dist/index.d.cts +12 -10
  32. package/dist/index.d.ts +12 -10
  33. package/dist/index.js +27 -17
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +32 -18
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/{types-D0oQeJAi.d.cts → types-BcWVH4ww.d.cts} +1 -1
  38. package/dist/{types-dXWfyz9B.d.ts → types-DF0JuPbs.d.ts} +1 -1
  39. package/dist/{types-legacy-BkOYOR6U.d.cts → types-legacy-DdVjg81H.d.cts} +1 -1
  40. package/dist/{types-legacy-BkOYOR6U.d.ts → types-legacy-DdVjg81H.d.ts} +1 -1
  41. package/dist/util/packer/index.d.cts +3 -3
  42. package/dist/util/packer/index.d.ts +3 -3
  43. package/package.json +3 -3
  44. package/src/core/navigators/filters/eloDistance.ts +10 -0
  45. package/src/courseConfigRegistration.ts +22 -10
  46. package/src/diagnostics/derive.ts +6 -0
  47. package/src/diagnostics/index.ts +1 -0
  48. package/src/diagnostics/tagElo.ts +257 -0
  49. package/src/study/SpacedRepetition.ts +23 -6
package/dist/index.mjs CHANGED
@@ -5517,7 +5517,7 @@ var FRAMEWORK_VERSION, hostAppVersion, DEFAULT_STRATEGY_HASH;
5517
5517
  var init_versionStamps = __esm({
5518
5518
  "src/core/versionStamps.ts"() {
5519
5519
  "use strict";
5520
- FRAMEWORK_VERSION = true ? "0.2.33" : "dev";
5520
+ FRAMEWORK_VERSION = true ? "0.2.35" : "dev";
5521
5521
  DEFAULT_STRATEGY_HASH = "default";
5522
5522
  }
5523
5523
  });
@@ -8105,21 +8105,26 @@ function newQuestionInterval(user, cardHistory) {
8105
8105
  const interval = lastInterval * (0.75 + skill);
8106
8106
  cardHistory.lapses = getLapses(cardHistory.records);
8107
8107
  cardHistory.streak = getStreak(cardHistory.records);
8108
+ let ret = interval;
8108
8109
  if (cardHistory.lapses && cardHistory.streak && cardHistory.bestInterval && (cardHistory.lapses >= 0 || cardHistory.streak >= 0)) {
8109
- const ret = (cardHistory.lapses * interval + cardHistory.streak * cardHistory.bestInterval) / (cardHistory.lapses + cardHistory.streak);
8110
+ ret = (cardHistory.lapses * interval + cardHistory.streak * cardHistory.bestInterval) / (cardHistory.lapses + cardHistory.streak);
8110
8111
  logger.debug(`Weighted average interval calculation:
8111
8112
  (${cardHistory.lapses} * ${interval} + ${cardHistory.streak} * ${cardHistory.bestInterval}) / (${cardHistory.lapses} + ${cardHistory.streak}) = ${ret}`);
8112
- return ret;
8113
- } else {
8114
- return interval;
8115
8113
  }
8114
+ if (currentAttempt.fluent === false) {
8115
+ logger.debug(
8116
+ `Correct but not fluent: capping interval ${ret}s at ${SLOW_CORRECT_MAX_INTERVAL}s`
8117
+ );
8118
+ return Math.min(ret, SLOW_CORRECT_MAX_INTERVAL);
8119
+ }
8120
+ return ret;
8116
8121
  } else {
8117
8122
  return 0;
8118
8123
  }
8119
8124
  }
8120
8125
  function lastSuccessfulInterval(cardHistory) {
8121
8126
  for (let i = cardHistory.length - 1; i >= 1; i--) {
8122
- if (cardHistory[i].priorAttemps === 0 && cardHistory[i].isCorrect) {
8127
+ if (cardHistory[i].priorAttemps === 0 && cardHistory[i].isCorrect && cardHistory[i].fluent !== false) {
8123
8128
  const lastInterval = secondsBetween(cardHistory[i - 1].timeStamp, cardHistory[i].timeStamp);
8124
8129
  const ret = Math.max(lastInterval, 20 * 60 * 60);
8125
8130
  logger.debug(`Last interval w/ this card was: ${lastInterval}s, returning ${ret}s`);
@@ -8150,13 +8155,14 @@ function secondsBetween(start, end) {
8150
8155
  const ret = duration(end.diff(start)).asSeconds();
8151
8156
  return ret;
8152
8157
  }
8153
- var duration;
8158
+ var duration, SLOW_CORRECT_MAX_INTERVAL;
8154
8159
  var init_SpacedRepetition = __esm({
8155
8160
  "src/study/SpacedRepetition.ts"() {
8156
8161
  "use strict";
8157
8162
  init_util();
8158
8163
  init_logger();
8159
8164
  duration = moment4.duration;
8165
+ SLOW_CORRECT_MAX_INTERVAL = 20 * 60 * 60;
8160
8166
  }
8161
8167
  });
8162
8168
 
@@ -16489,7 +16495,11 @@ init_courseLookupDB();
16489
16495
 
16490
16496
  // src/courseConfigRegistration.ts
16491
16497
  init_logger();
16492
- import { NameSpacer as NameSpacer2, toZodJSON } from "@vue-skuilder/common";
16498
+ import {
16499
+ NameSpacer as NameSpacer2,
16500
+ toCourseElo as toCourseElo9,
16501
+ toZodJSON
16502
+ } from "@vue-skuilder/common";
16493
16503
  function isDataShapeRegistered(dataShape, courseConfig) {
16494
16504
  const namespacedName = NameSpacer2.getDataShapeString({
16495
16505
  dataShape: dataShape.name,
@@ -16690,16 +16700,20 @@ async function registerSeedData(question, courseDB, username) {
16690
16700
  if (question.questionClass.seedData && Array.isArray(question.questionClass.seedData)) {
16691
16701
  logger.info(`Registering seed data for question: ${question.name}`);
16692
16702
  try {
16693
- const seedDataPromises = question.questionClass.seedData.filter(() => question.dataShapes.length > 0).map(
16694
- (seedDataItem) => courseDB.addNote(
16695
- question.course,
16696
- question.dataShapes[0],
16697
- seedDataItem,
16698
- username,
16699
- []
16700
- )
16701
- );
16702
- await Promise.all(seedDataPromises);
16703
+ if (question.dataShapes.length > 0) {
16704
+ for (const seedDataItem of question.questionClass.seedData) {
16705
+ const meta = question.questionClass.seedMeta?.(seedDataItem) ?? {};
16706
+ await courseDB.addNote(
16707
+ question.course,
16708
+ question.dataShapes[0],
16709
+ seedDataItem,
16710
+ username,
16711
+ meta.tags ?? [],
16712
+ void 0,
16713
+ meta.elo !== void 0 ? toCourseElo9(meta.elo) : void 0
16714
+ );
16715
+ }
16716
+ }
16703
16717
  logger.info(`Seed data registered for question: ${question.name}`);
16704
16718
  } catch (error) {
16705
16719
  logger.warn(