@vue-skuilder/common 0.1.0 → 0.1.1

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 (106) hide show
  1. package/dist/bulkImport/cardParser.d.ts +45 -0
  2. package/dist/bulkImport/cardParser.d.ts.map +1 -0
  3. package/dist/bulkImport/cardParser.js +113 -0
  4. package/dist/bulkImport/cardParser.js.map +1 -0
  5. package/dist/bulkImport/cardParser.mjs +106 -0
  6. package/dist/bulkImport/types.d.ts +23 -0
  7. package/dist/bulkImport/types.d.ts.map +1 -0
  8. package/dist/bulkImport/types.js +6 -0
  9. package/dist/bulkImport/types.js.map +1 -0
  10. package/dist/bulkImport/types.mjs +5 -0
  11. package/dist/course-data.d.ts +17 -0
  12. package/dist/course-data.d.ts.map +1 -0
  13. package/dist/course-data.js +87 -0
  14. package/dist/course-data.js.map +1 -0
  15. package/dist/course-data.mjs +84 -0
  16. package/dist/db.d.ts +140 -0
  17. package/dist/db.d.ts.map +1 -0
  18. package/dist/db.js +46 -0
  19. package/dist/db.js.map +1 -0
  20. package/dist/db.mjs +39 -0
  21. package/dist/elo.d.ts +44 -0
  22. package/dist/elo.d.ts.map +1 -0
  23. package/dist/elo.js +162 -0
  24. package/dist/elo.js.map +1 -0
  25. package/dist/elo.mjs +152 -0
  26. package/dist/enums/DataShapeNames.d.ts +27 -0
  27. package/dist/enums/DataShapeNames.d.ts.map +1 -0
  28. package/dist/enums/DataShapeNames.js +40 -0
  29. package/dist/enums/DataShapeNames.js.map +1 -0
  30. package/dist/enums/DataShapeNames.mjs +37 -0
  31. package/dist/enums/FieldType.d.ts +18 -0
  32. package/dist/enums/FieldType.d.ts.map +1 -0
  33. package/dist/enums/FieldType.js +22 -0
  34. package/dist/enums/FieldType.js.map +1 -0
  35. package/dist/enums/FieldType.mjs +19 -0
  36. package/dist/enums/index.d.ts +3 -0
  37. package/dist/enums/index.d.ts.map +1 -0
  38. package/dist/enums/index.js +19 -0
  39. package/dist/enums/index.js.map +1 -0
  40. package/dist/enums/index.mjs +3 -0
  41. package/dist/fieldConverters.d.ts +17 -0
  42. package/dist/fieldConverters.d.ts.map +1 -0
  43. package/dist/fieldConverters.js +63 -0
  44. package/dist/fieldConverters.js.map +1 -0
  45. package/dist/fieldConverters.mjs +60 -0
  46. package/dist/index.d.ts +13 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +31 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/index.mjs +15 -0
  51. package/dist/interfaces/AnswerInterfaces.d.ts +7 -0
  52. package/dist/interfaces/AnswerInterfaces.d.ts.map +1 -0
  53. package/dist/interfaces/AnswerInterfaces.js +3 -0
  54. package/dist/interfaces/AnswerInterfaces.js.map +1 -0
  55. package/dist/interfaces/AnswerInterfaces.mjs +2 -0
  56. package/dist/interfaces/DataShape.d.ts +7 -0
  57. package/dist/interfaces/DataShape.d.ts.map +1 -0
  58. package/dist/interfaces/DataShape.js +4 -0
  59. package/dist/interfaces/DataShape.js.map +1 -0
  60. package/dist/interfaces/DataShape.mjs +3 -0
  61. package/dist/interfaces/FieldDefinition.d.ts +12 -0
  62. package/dist/interfaces/FieldDefinition.d.ts.map +1 -0
  63. package/dist/interfaces/FieldDefinition.js +3 -0
  64. package/dist/interfaces/FieldDefinition.js.map +1 -0
  65. package/dist/interfaces/FieldDefinition.mjs +2 -0
  66. package/dist/interfaces/Tagger.d.ts +7 -0
  67. package/dist/interfaces/Tagger.d.ts.map +1 -0
  68. package/dist/interfaces/Tagger.js +3 -0
  69. package/dist/interfaces/Tagger.js.map +1 -0
  70. package/dist/interfaces/Tagger.mjs +2 -0
  71. package/dist/interfaces/Validator.d.ts +14 -0
  72. package/dist/interfaces/Validator.d.ts.map +1 -0
  73. package/dist/interfaces/Validator.js +16 -0
  74. package/dist/interfaces/Validator.js.map +1 -0
  75. package/dist/interfaces/Validator.mjs +13 -0
  76. package/dist/interfaces/ViewData.d.ts +6 -0
  77. package/dist/interfaces/ViewData.d.ts.map +1 -0
  78. package/dist/interfaces/ViewData.js +19 -0
  79. package/dist/interfaces/ViewData.js.map +1 -0
  80. package/dist/interfaces/ViewData.mjs +16 -0
  81. package/dist/interfaces/index.d.ts +7 -0
  82. package/dist/interfaces/index.d.ts.map +1 -0
  83. package/dist/interfaces/index.js +23 -0
  84. package/dist/interfaces/index.js.map +1 -0
  85. package/dist/interfaces/index.mjs +7 -0
  86. package/dist/logshim.d.ts +2 -0
  87. package/dist/logshim.d.ts.map +1 -0
  88. package/dist/logshim.js +9 -0
  89. package/dist/logshim.js.map +1 -0
  90. package/dist/logshim.mjs +5 -0
  91. package/dist/namespacer.d.ts +22 -0
  92. package/dist/namespacer.d.ts.map +1 -0
  93. package/dist/namespacer.js +54 -0
  94. package/dist/namespacer.js.map +1 -0
  95. package/dist/namespacer.mjs +50 -0
  96. package/dist/validators.d.ts +7 -0
  97. package/dist/validators.d.ts.map +1 -0
  98. package/dist/validators.js +24 -0
  99. package/dist/validators.js.map +1 -0
  100. package/dist/validators.mjs +21 -0
  101. package/dist/wire-format.d.ts +141 -0
  102. package/dist/wire-format.d.ts.map +1 -0
  103. package/dist/wire-format.js +21 -0
  104. package/dist/wire-format.js.map +1 -0
  105. package/dist/wire-format.mjs +18 -0
  106. package/package.json +2 -3
package/dist/db.js ADDED
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocType = void 0;
4
+ exports.getCardHistoryID = getCardHistoryID;
5
+ exports.parseCardHistoryID = parseCardHistoryID;
6
+ exports.areQuestionRecords = areQuestionRecords;
7
+ exports.isQuestionRecord = isQuestionRecord;
8
+ var DocType;
9
+ (function (DocType) {
10
+ DocType["DISPLAYABLE_DATA"] = "DISPLAYABLE_DATA";
11
+ DocType["CARD"] = "CARD";
12
+ DocType["DATASHAPE"] = "DATASHAPE";
13
+ DocType["QUESTIONTYPE"] = "QUESTION";
14
+ DocType["VIEW"] = "VIEW";
15
+ DocType["PEDAGOGY"] = "PEDAGOGY";
16
+ DocType["CARDRECORD"] = "CARDRECORD";
17
+ DocType["SCHEDULED_CARD"] = "SCHEDULED_CARD";
18
+ DocType["TAG"] = "TAG";
19
+ })(DocType || (exports.DocType = DocType = {}));
20
+ const cardHistoryPrefix = 'cardH';
21
+ function getCardHistoryID(courseID, cardID) {
22
+ return `${cardHistoryPrefix}-${courseID}-${cardID}`;
23
+ }
24
+ function parseCardHistoryID(id) {
25
+ const split = id.split('-');
26
+ let error = '';
27
+ error += split.length === 3 ? '' : `\n\tgiven ID has incorrect number of '-' characters`;
28
+ error +=
29
+ split[0] === cardHistoryPrefix ? '' : `\n\tgiven ID does not start with ${cardHistoryPrefix}`;
30
+ if (split.length === 3 && split[0] === cardHistoryPrefix) {
31
+ return {
32
+ courseID: split[1],
33
+ cardID: split[2],
34
+ };
35
+ }
36
+ else {
37
+ throw new Error('parseCardHistory Error:' + error);
38
+ }
39
+ }
40
+ function areQuestionRecords(h) {
41
+ return isQuestionRecord(h.records[0]);
42
+ }
43
+ function isQuestionRecord(c) {
44
+ return c.userAnswer !== undefined;
45
+ }
46
+ //# sourceMappingURL=db.js.map
package/dist/db.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,OAUX;AAVD,WAAY,OAAO;IACjB,gDAAqC,CAAA;IACrC,wBAAa,CAAA;IACb,kCAAuB,CAAA;IACvB,oCAAyB,CAAA;IACzB,wBAAa,CAAA;IACb,gCAAqB,CAAA;IACrB,oCAAyB,CAAA;IACzB,4CAAiC,CAAA;IACjC,sBAAW,CAAA;AACb,CAAC,EAVW,OAAO,KAAP,OAAO,QAUlB;AAiED,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAElC,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,MAAc;IAC/D,OAAO,GAAG,iBAAiB,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAU;IAI3C,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,KAAK,GAAW,EAAE,CAAC;IACvB,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qDAAqD,CAAC;IACzF,KAAK;QACH,KAAK,CAAC,CAAC,CAAC,KAAK,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oCAAoC,iBAAiB,EAAE,CAAC;IAEhG,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,iBAAiB,EAAE,CAAC;QACzD,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;SACjB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,KAAK,CAAC,CAAC;IACrD,CAAC;AACH,CAAC;AAsED,MAAM,UAAU,kBAAkB,CAAC,CAA0B;IAC3D,OAAO,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,CAAa;IAC5C,OAAQ,CAAoB,CAAC,UAAU,KAAK,SAAS,CAAC;AACxD,CAAC"}
package/dist/db.mjs ADDED
@@ -0,0 +1,39 @@
1
+ export var DocType;
2
+ (function (DocType) {
3
+ DocType["DISPLAYABLE_DATA"] = "DISPLAYABLE_DATA";
4
+ DocType["CARD"] = "CARD";
5
+ DocType["DATASHAPE"] = "DATASHAPE";
6
+ DocType["QUESTIONTYPE"] = "QUESTION";
7
+ DocType["VIEW"] = "VIEW";
8
+ DocType["PEDAGOGY"] = "PEDAGOGY";
9
+ DocType["CARDRECORD"] = "CARDRECORD";
10
+ DocType["SCHEDULED_CARD"] = "SCHEDULED_CARD";
11
+ DocType["TAG"] = "TAG";
12
+ })(DocType || (DocType = {}));
13
+ const cardHistoryPrefix = 'cardH';
14
+ export function getCardHistoryID(courseID, cardID) {
15
+ return `${cardHistoryPrefix}-${courseID}-${cardID}`;
16
+ }
17
+ export function parseCardHistoryID(id) {
18
+ const split = id.split('-');
19
+ let error = '';
20
+ error += split.length === 3 ? '' : `\n\tgiven ID has incorrect number of '-' characters`;
21
+ error +=
22
+ split[0] === cardHistoryPrefix ? '' : `\n\tgiven ID does not start with ${cardHistoryPrefix}`;
23
+ if (split.length === 3 && split[0] === cardHistoryPrefix) {
24
+ return {
25
+ courseID: split[1],
26
+ cardID: split[2],
27
+ };
28
+ }
29
+ else {
30
+ throw new Error('parseCardHistory Error:' + error);
31
+ }
32
+ }
33
+ export function areQuestionRecords(h) {
34
+ return isQuestionRecord(h.records[0]);
35
+ }
36
+ export function isQuestionRecord(c) {
37
+ return c.userAnswer !== undefined;
38
+ }
39
+ //# sourceMappingURL=db.js.map
package/dist/elo.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ export declare class EloRanker {
2
+ k: number;
3
+ constructor(k?: number);
4
+ setKFactor(k: number): void;
5
+ getKFactor(): number;
6
+ getExpected(a: number, b: number): number;
7
+ updateRating(expected: number, actual: number, current: number): number;
8
+ }
9
+ export type CourseElo = {
10
+ global: EloRank;
11
+ tags: {
12
+ [tagID: string]: EloRank;
13
+ };
14
+ misc: {
15
+ [eloID: string]: EloRank;
16
+ };
17
+ };
18
+ type EloRank = {
19
+ score: number;
20
+ count: number;
21
+ };
22
+ type Eloish = number | EloRank | CourseElo;
23
+ export declare function blankCourseElo(): CourseElo;
24
+ export declare function EloToNumber(elo: Eloish): number;
25
+ export declare function toElo(elo: number | EloRank): EloRank;
26
+ export declare function toCourseElo(elo: Eloish | undefined): CourseElo;
27
+ export declare function isCourseElo(x: unknown): x is CourseElo;
28
+ /**
29
+ * Calculates updated ELO scores for users and content after they interact
30
+ *
31
+ * @param userElo current ELO score of the user
32
+ * @param cardElo current ELO score of the card
33
+ * @param userScore user performance against the card in range [0,1]
34
+ * @param k optional scaling factor. Higher values -> larger score adjustments. Default 32.
35
+ * @returns
36
+ */
37
+ export declare function adjustCourseScores(aElo: Eloish, bElo: Eloish, userScore: number, options?: {
38
+ globalOnly: boolean;
39
+ }): {
40
+ userElo: CourseElo;
41
+ cardElo: CourseElo;
42
+ };
43
+ export {};
44
+ //# sourceMappingURL=elo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elo.d.ts","sourceRoot":"","sources":["../src/elo.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;IACD,CAAC,EAAE,MAAM;gBAAT,CAAC,GAAE,MAAW;IAEjC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAG3B,UAAU,IAAI,MAAM;IAIpB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAGzC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;CAGxE;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE;QACJ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,CAAC;IACF,IAAI,EAAE;QACJ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3C,wBAAgB,cAAc,IAAI,SAAS,CAS1C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAS/C;AACD,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CASpD;AACD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CA+B9D;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,SAAS,CAMtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IACR,UAAU,EAAE,OAAO,CAAC;CACrB,GACA;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;CACpB,CA+BA"}
package/dist/elo.js ADDED
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EloRanker = void 0;
4
+ exports.blankCourseElo = blankCourseElo;
5
+ exports.EloToNumber = EloToNumber;
6
+ exports.toElo = toElo;
7
+ exports.toCourseElo = toCourseElo;
8
+ exports.isCourseElo = isCourseElo;
9
+ exports.adjustCourseScores = adjustCourseScores;
10
+ class EloRanker {
11
+ k;
12
+ constructor(k = 32) {
13
+ this.k = k;
14
+ }
15
+ setKFactor(k) {
16
+ this.k = k;
17
+ }
18
+ getKFactor() {
19
+ return this.k;
20
+ }
21
+ getExpected(a, b) {
22
+ return 1 / (1 + Math.pow(10, (b - a) / 400));
23
+ }
24
+ updateRating(expected, actual, current) {
25
+ return Math.round(current + this.k * (actual - expected));
26
+ }
27
+ }
28
+ exports.EloRanker = EloRanker;
29
+ function blankCourseElo() {
30
+ return {
31
+ global: {
32
+ score: 990 + Math.round(Math.random() * 20),
33
+ count: 0,
34
+ },
35
+ tags: {},
36
+ misc: {},
37
+ };
38
+ }
39
+ function EloToNumber(elo) {
40
+ if (typeof elo === 'number') {
41
+ return elo;
42
+ }
43
+ else if (isCourseElo(elo)) {
44
+ return elo.global.score;
45
+ }
46
+ {
47
+ return elo.score;
48
+ }
49
+ }
50
+ function toElo(elo) {
51
+ if (typeof elo === 'number') {
52
+ return {
53
+ score: elo,
54
+ count: 0,
55
+ };
56
+ }
57
+ else {
58
+ return elo;
59
+ }
60
+ }
61
+ function toCourseElo(elo) {
62
+ if (typeof elo === 'string') {
63
+ throw new Error('unsuitiably typed input to toCourseElo');
64
+ }
65
+ if (typeof elo === 'number') {
66
+ return {
67
+ global: {
68
+ score: elo,
69
+ count: 0,
70
+ },
71
+ misc: {},
72
+ tags: {},
73
+ };
74
+ }
75
+ else if (isCourseElo(elo)) {
76
+ return elo;
77
+ }
78
+ else if (elo === undefined) {
79
+ return {
80
+ global: {
81
+ score: 995 + Math.random() * 10,
82
+ count: 0,
83
+ },
84
+ tags: {},
85
+ misc: {},
86
+ };
87
+ }
88
+ else {
89
+ return {
90
+ global: elo,
91
+ tags: {},
92
+ misc: {},
93
+ };
94
+ }
95
+ }
96
+ function isCourseElo(x) {
97
+ if (!x || typeof x !== 'object') {
98
+ return false;
99
+ }
100
+ return 'global' in x && 'tags' in x;
101
+ }
102
+ /**
103
+ * Calculates updated ELO scores for users and content after they interact
104
+ *
105
+ * @param userElo current ELO score of the user
106
+ * @param cardElo current ELO score of the card
107
+ * @param userScore user performance against the card in range [0,1]
108
+ * @param k optional scaling factor. Higher values -> larger score adjustments. Default 32.
109
+ * @returns
110
+ */
111
+ function adjustCourseScores(aElo, bElo, userScore, options) {
112
+ if (userScore < 0 || userScore > 1) {
113
+ throw new Error(`ELO performance rating must be between 0 and 1 - received ${userScore}`);
114
+ }
115
+ const userElo = toCourseElo(aElo);
116
+ const cardElo = toCourseElo(bElo);
117
+ if (options == undefined || !options.globalOnly) {
118
+ // grade on each tag present for the card
119
+ Object.keys(cardElo.tags).forEach((k) => {
120
+ const userTagElo = userElo.tags[k]
121
+ ? userElo.tags[k]
122
+ : {
123
+ count: 0,
124
+ score: userElo.global.score, // todo: 1000?
125
+ };
126
+ const adjusted = adjustScores(userTagElo, cardElo.tags[k], userScore);
127
+ userElo.tags[k] = adjusted.userElo;
128
+ cardElo.tags[k] = adjusted.cardElo;
129
+ });
130
+ }
131
+ const adjusted = adjustScores(userElo.global, cardElo.global, userScore);
132
+ userElo.global = adjusted.userElo;
133
+ cardElo.global = adjusted.cardElo;
134
+ return {
135
+ userElo,
136
+ cardElo,
137
+ };
138
+ }
139
+ function adjustScores(userElo, cardElo, userScore) {
140
+ if (userScore < 0 || userScore > 1) {
141
+ throw new Error(`ELO performance rating must be between 0 and 1 - received ${userScore}`);
142
+ }
143
+ // todo: how to calculate here?
144
+ // todo: should / must these be equal?
145
+ // todo: 176 - these K values should be a fcn of `.count` values of userElo and cardElo
146
+ const userRanker = new EloRanker(16);
147
+ const cardRanker = new EloRanker(16);
148
+ const exp = userRanker.getExpected(userElo.score, cardElo.score);
149
+ const updatedUserElo = userRanker.updateRating(exp, userScore, userElo.score);
150
+ const updatedCardElo = cardRanker.updateRating(1 - exp, 1 - userScore, cardElo.score);
151
+ return {
152
+ userElo: {
153
+ score: updatedUserElo,
154
+ count: userElo.count + 1,
155
+ },
156
+ cardElo: {
157
+ score: updatedCardElo,
158
+ count: cardElo.count + 1,
159
+ },
160
+ };
161
+ }
162
+ //# sourceMappingURL=elo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elo.js","sourceRoot":"","sources":["../src/elo.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAS;IACD;IAAnB,YAAmB,IAAY,EAAE;QAAd,MAAC,GAAD,CAAC,CAAa;IAAG,CAAC;IAErC,UAAU,CAAC,CAAS;QAClB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,UAAU;QACR,OAAO,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,CAAS,EAAE,CAAS;QAC9B,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,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IAErC,MAAM,GAAG,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEjE,MAAM,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9E,MAAM,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEtF,OAAO;QACL,OAAO,EAAE;YACP,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC;SACzB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC;SACzB;KACF,CAAC;AACJ,CAAC"}
package/dist/elo.mjs ADDED
@@ -0,0 +1,152 @@
1
+ export class EloRanker {
2
+ k;
3
+ constructor(k = 32) {
4
+ this.k = k;
5
+ }
6
+ setKFactor(k) {
7
+ this.k = k;
8
+ }
9
+ getKFactor() {
10
+ return this.k;
11
+ }
12
+ getExpected(a, b) {
13
+ return 1 / (1 + Math.pow(10, (b - a) / 400));
14
+ }
15
+ updateRating(expected, actual, current) {
16
+ return Math.round(current + this.k * (actual - expected));
17
+ }
18
+ }
19
+ export function blankCourseElo() {
20
+ return {
21
+ global: {
22
+ score: 990 + Math.round(Math.random() * 20),
23
+ count: 0,
24
+ },
25
+ tags: {},
26
+ misc: {},
27
+ };
28
+ }
29
+ export function EloToNumber(elo) {
30
+ if (typeof elo === 'number') {
31
+ return elo;
32
+ }
33
+ else if (isCourseElo(elo)) {
34
+ return elo.global.score;
35
+ }
36
+ {
37
+ return elo.score;
38
+ }
39
+ }
40
+ export function toElo(elo) {
41
+ if (typeof elo === 'number') {
42
+ return {
43
+ score: elo,
44
+ count: 0,
45
+ };
46
+ }
47
+ else {
48
+ return elo;
49
+ }
50
+ }
51
+ export function toCourseElo(elo) {
52
+ if (typeof elo === 'string') {
53
+ throw new Error('unsuitiably typed input to toCourseElo');
54
+ }
55
+ if (typeof elo === 'number') {
56
+ return {
57
+ global: {
58
+ score: elo,
59
+ count: 0,
60
+ },
61
+ misc: {},
62
+ tags: {},
63
+ };
64
+ }
65
+ else if (isCourseElo(elo)) {
66
+ return elo;
67
+ }
68
+ else if (elo === undefined) {
69
+ return {
70
+ global: {
71
+ score: 995 + Math.random() * 10,
72
+ count: 0,
73
+ },
74
+ tags: {},
75
+ misc: {},
76
+ };
77
+ }
78
+ else {
79
+ return {
80
+ global: elo,
81
+ tags: {},
82
+ misc: {},
83
+ };
84
+ }
85
+ }
86
+ export function isCourseElo(x) {
87
+ if (!x || typeof x !== 'object') {
88
+ return false;
89
+ }
90
+ return 'global' in x && 'tags' in x;
91
+ }
92
+ /**
93
+ * Calculates updated ELO scores for users and content after they interact
94
+ *
95
+ * @param userElo current ELO score of the user
96
+ * @param cardElo current ELO score of the card
97
+ * @param userScore user performance against the card in range [0,1]
98
+ * @param k optional scaling factor. Higher values -> larger score adjustments. Default 32.
99
+ * @returns
100
+ */
101
+ export function adjustCourseScores(aElo, bElo, userScore, options) {
102
+ if (userScore < 0 || userScore > 1) {
103
+ throw new Error(`ELO performance rating must be between 0 and 1 - received ${userScore}`);
104
+ }
105
+ const userElo = toCourseElo(aElo);
106
+ const cardElo = toCourseElo(bElo);
107
+ if (options == undefined || !options.globalOnly) {
108
+ // grade on each tag present for the card
109
+ Object.keys(cardElo.tags).forEach((k) => {
110
+ const userTagElo = userElo.tags[k]
111
+ ? userElo.tags[k]
112
+ : {
113
+ count: 0,
114
+ score: userElo.global.score, // todo: 1000?
115
+ };
116
+ const adjusted = adjustScores(userTagElo, cardElo.tags[k], userScore);
117
+ userElo.tags[k] = adjusted.userElo;
118
+ cardElo.tags[k] = adjusted.cardElo;
119
+ });
120
+ }
121
+ const adjusted = adjustScores(userElo.global, cardElo.global, userScore);
122
+ userElo.global = adjusted.userElo;
123
+ cardElo.global = adjusted.cardElo;
124
+ return {
125
+ userElo,
126
+ cardElo,
127
+ };
128
+ }
129
+ function adjustScores(userElo, cardElo, userScore) {
130
+ if (userScore < 0 || userScore > 1) {
131
+ throw new Error(`ELO performance rating must be between 0 and 1 - received ${userScore}`);
132
+ }
133
+ // todo: how to calculate here?
134
+ // todo: should / must these be equal?
135
+ // todo: 176 - these K values should be a fcn of `.count` values of userElo and cardElo
136
+ const userRanker = new EloRanker(16);
137
+ const cardRanker = new EloRanker(16);
138
+ const exp = userRanker.getExpected(userElo.score, cardElo.score);
139
+ const updatedUserElo = userRanker.updateRating(exp, userScore, userElo.score);
140
+ const updatedCardElo = cardRanker.updateRating(1 - exp, 1 - userScore, cardElo.score);
141
+ return {
142
+ userElo: {
143
+ score: updatedUserElo,
144
+ count: userElo.count + 1,
145
+ },
146
+ cardElo: {
147
+ score: updatedCardElo,
148
+ count: cardElo.count + 1,
149
+ },
150
+ };
151
+ }
152
+ //# sourceMappingURL=elo.js.map
@@ -0,0 +1,27 @@
1
+ export declare enum DataShapeName {
2
+ BLANK = "",
3
+ Basic = "Basic",
4
+ Blanks = "Blanks",
5
+ Default = "Default",
6
+ MATH_SingleDigitAddition = "SingleDigitAddition",
7
+ MATH_SingleDigitSubtraction = "SingleDigitSubtraction",
8
+ MATH_SingleDigitDivision = "SingleDigitDivision",
9
+ MATH_SingleDigitMultiplication = "SingleDigitMultiplication",
10
+ MATH_EqualityTest = "EqualityTest",
11
+ MATH_OneStepEquation = "OneStepEquation",
12
+ MATH_AngleCategorize = "AngleCategorize",
13
+ MATH_SupplimentaryAngles = "SupplimentaryAngles",
14
+ MATH_CountBy = "CountBy",
15
+ FRENCH_AudioParse = "AudioParse",
16
+ FRENCH_Vocab = "Vocab",
17
+ WORDWORK_Spelling = "WordWork_Spelling",
18
+ PIANO_Echo = "Piano_Echo",
19
+ PIANO_PlayNote = "Piano_PlayNote",
20
+ PITCH_chroma = "Pitch_chroma",
21
+ SIGHTSING_IdentifyKey = "SightSing_IdentifyKey",
22
+ CHESS_puzzle = "CHESS_puzzle",
23
+ CHESS_forks = "CHESS_forks",
24
+ TYPING_singleLetter = "TYPING_singleLetter",
25
+ TYPING_fallingLetters = "TYPING_fallingLetters"
26
+ }
27
+ //# sourceMappingURL=DataShapeNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataShapeNames.d.ts","sourceRoot":"","sources":["../../src/enums/DataShapeNames.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,KAAK,KAAK;IAEV,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,OAAO,YAAY;IAGnB,wBAAwB,wBAAwB;IAChD,2BAA2B,2BAA2B;IACtD,wBAAwB,wBAAwB;IAChD,8BAA8B,8BAA8B;IAC5D,iBAAiB,iBAAiB;IAClC,oBAAoB,oBAAoB;IACxC,oBAAoB,oBAAoB;IACxC,wBAAwB,wBAAwB;IAChD,YAAY,YAAY;IAGxB,iBAAiB,eAAe;IAChC,YAAY,UAAU;IAGtB,iBAAiB,sBAAsB;IAGvC,UAAU,eAAe;IACzB,cAAc,mBAAmB;IAGjC,YAAY,iBAAiB;IAG7B,qBAAqB,0BAA0B;IAG/C,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAG3B,mBAAmB,wBAAwB;IAC3C,qBAAqB,0BAA0B;CAChD"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataShapeName = void 0;
4
+ var DataShapeName;
5
+ (function (DataShapeName) {
6
+ DataShapeName["BLANK"] = "";
7
+ // Shared base-course types
8
+ DataShapeName["Basic"] = "Basic";
9
+ DataShapeName["Blanks"] = "Blanks";
10
+ DataShapeName["Default"] = "Default";
11
+ // Math
12
+ DataShapeName["MATH_SingleDigitAddition"] = "SingleDigitAddition";
13
+ DataShapeName["MATH_SingleDigitSubtraction"] = "SingleDigitSubtraction";
14
+ DataShapeName["MATH_SingleDigitDivision"] = "SingleDigitDivision";
15
+ DataShapeName["MATH_SingleDigitMultiplication"] = "SingleDigitMultiplication";
16
+ DataShapeName["MATH_EqualityTest"] = "EqualityTest";
17
+ DataShapeName["MATH_OneStepEquation"] = "OneStepEquation";
18
+ DataShapeName["MATH_AngleCategorize"] = "AngleCategorize";
19
+ DataShapeName["MATH_SupplimentaryAngles"] = "SupplimentaryAngles";
20
+ DataShapeName["MATH_CountBy"] = "CountBy";
21
+ // French
22
+ DataShapeName["FRENCH_AudioParse"] = "AudioParse";
23
+ DataShapeName["FRENCH_Vocab"] = "Vocab";
24
+ // WordWork
25
+ DataShapeName["WORDWORK_Spelling"] = "WordWork_Spelling";
26
+ // Piano
27
+ DataShapeName["PIANO_Echo"] = "Piano_Echo";
28
+ DataShapeName["PIANO_PlayNote"] = "Piano_PlayNote";
29
+ // Pitch
30
+ DataShapeName["PITCH_chroma"] = "Pitch_chroma";
31
+ // SightSing
32
+ DataShapeName["SIGHTSING_IdentifyKey"] = "SightSing_IdentifyKey";
33
+ // Chess
34
+ DataShapeName["CHESS_puzzle"] = "CHESS_puzzle";
35
+ DataShapeName["CHESS_forks"] = "CHESS_forks";
36
+ // Typing
37
+ DataShapeName["TYPING_singleLetter"] = "TYPING_singleLetter";
38
+ DataShapeName["TYPING_fallingLetters"] = "TYPING_fallingLetters";
39
+ })(DataShapeName || (exports.DataShapeName = DataShapeName = {}));
40
+ //# sourceMappingURL=DataShapeNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataShapeNames.js","sourceRoot":"","sources":["../../src/enums/DataShapeNames.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aA0CX;AA1CD,WAAY,aAAa;IACvB,2BAAU,CAAA;IACV,2BAA2B;IAC3B,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IAEnB,OAAO;IACP,iEAAgD,CAAA;IAChD,uEAAsD,CAAA;IACtD,iEAAgD,CAAA;IAChD,6EAA4D,CAAA;IAC5D,mDAAkC,CAAA;IAClC,yDAAwC,CAAA;IACxC,yDAAwC,CAAA;IACxC,iEAAgD,CAAA;IAChD,yCAAwB,CAAA;IAExB,SAAS;IACT,iDAAgC,CAAA;IAChC,uCAAsB,CAAA;IAEtB,WAAW;IACX,wDAAuC,CAAA;IAEvC,QAAQ;IACR,0CAAyB,CAAA;IACzB,kDAAiC,CAAA;IAEjC,QAAQ;IACR,8CAA6B,CAAA;IAE7B,YAAY;IACZ,gEAA+C,CAAA;IAE/C,QAAQ;IACR,8CAA6B,CAAA;IAC7B,4CAA2B,CAAA;IAE3B,SAAS;IACT,4DAA2C,CAAA;IAC3C,gEAA+C,CAAA;AACjD,CAAC,EA1CW,aAAa,KAAb,aAAa,QA0CxB"}
@@ -0,0 +1,37 @@
1
+ export var DataShapeName;
2
+ (function (DataShapeName) {
3
+ DataShapeName["BLANK"] = "";
4
+ // Shared base-course types
5
+ DataShapeName["Basic"] = "Basic";
6
+ DataShapeName["Blanks"] = "Blanks";
7
+ DataShapeName["Default"] = "Default";
8
+ // Math
9
+ DataShapeName["MATH_SingleDigitAddition"] = "SingleDigitAddition";
10
+ DataShapeName["MATH_SingleDigitSubtraction"] = "SingleDigitSubtraction";
11
+ DataShapeName["MATH_SingleDigitDivision"] = "SingleDigitDivision";
12
+ DataShapeName["MATH_SingleDigitMultiplication"] = "SingleDigitMultiplication";
13
+ DataShapeName["MATH_EqualityTest"] = "EqualityTest";
14
+ DataShapeName["MATH_OneStepEquation"] = "OneStepEquation";
15
+ DataShapeName["MATH_AngleCategorize"] = "AngleCategorize";
16
+ DataShapeName["MATH_SupplimentaryAngles"] = "SupplimentaryAngles";
17
+ DataShapeName["MATH_CountBy"] = "CountBy";
18
+ // French
19
+ DataShapeName["FRENCH_AudioParse"] = "AudioParse";
20
+ DataShapeName["FRENCH_Vocab"] = "Vocab";
21
+ // WordWork
22
+ DataShapeName["WORDWORK_Spelling"] = "WordWork_Spelling";
23
+ // Piano
24
+ DataShapeName["PIANO_Echo"] = "Piano_Echo";
25
+ DataShapeName["PIANO_PlayNote"] = "Piano_PlayNote";
26
+ // Pitch
27
+ DataShapeName["PITCH_chroma"] = "Pitch_chroma";
28
+ // SightSing
29
+ DataShapeName["SIGHTSING_IdentifyKey"] = "SightSing_IdentifyKey";
30
+ // Chess
31
+ DataShapeName["CHESS_puzzle"] = "CHESS_puzzle";
32
+ DataShapeName["CHESS_forks"] = "CHESS_forks";
33
+ // Typing
34
+ DataShapeName["TYPING_singleLetter"] = "TYPING_singleLetter";
35
+ DataShapeName["TYPING_fallingLetters"] = "TYPING_fallingLetters";
36
+ })(DataShapeName || (DataShapeName = {}));
37
+ //# sourceMappingURL=DataShapeNames.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * These are the defined types of user input that can hydrate a configured
3
+ * dataShape.
4
+ *
5
+ * These field types map to input elements and specific validation and processing functions.
6
+ */
7
+ export declare enum FieldType {
8
+ STRING = "string",
9
+ NUMBER = "number",
10
+ INT = "int",
11
+ IMAGE = "image",
12
+ MARKDOWN = "markdown",
13
+ AUDIO = "audio",
14
+ MIDI = "midi",
15
+ MEDIA_UPLOADS = "uploads",
16
+ CHESS_PUZZLE = "chess_puzzle"
17
+ }
18
+ //# sourceMappingURL=FieldType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldType.d.ts","sourceRoot":"","sources":["../../src/enums/FieldType.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,SAAS;IACnB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,aAAa,YAAY;IACzB,YAAY,iBAAiB;CAC9B"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldType = void 0;
4
+ /**
5
+ * These are the defined types of user input that can hydrate a configured
6
+ * dataShape.
7
+ *
8
+ * These field types map to input elements and specific validation and processing functions.
9
+ */
10
+ var FieldType;
11
+ (function (FieldType) {
12
+ FieldType["STRING"] = "string";
13
+ FieldType["NUMBER"] = "number";
14
+ FieldType["INT"] = "int";
15
+ FieldType["IMAGE"] = "image";
16
+ FieldType["MARKDOWN"] = "markdown";
17
+ FieldType["AUDIO"] = "audio";
18
+ FieldType["MIDI"] = "midi";
19
+ FieldType["MEDIA_UPLOADS"] = "uploads";
20
+ FieldType["CHESS_PUZZLE"] = "chess_puzzle";
21
+ })(FieldType || (exports.FieldType = FieldType = {}));
22
+ //# sourceMappingURL=FieldType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldType.js","sourceRoot":"","sources":["../../src/enums/FieldType.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAUX;AAVD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,wBAAW,CAAA;IACX,4BAAe,CAAA;IACf,kCAAqB,CAAA;IACrB,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,sCAAyB,CAAA;IACzB,0CAA6B,CAAA;AAC/B,CAAC,EAVW,SAAS,KAAT,SAAS,QAUpB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * These are the defined types of user input that can hydrate a configured
3
+ * dataShape.
4
+ *
5
+ * These field types map to input elements and specific validation and processing functions.
6
+ */
7
+ export var FieldType;
8
+ (function (FieldType) {
9
+ FieldType["STRING"] = "string";
10
+ FieldType["NUMBER"] = "number";
11
+ FieldType["INT"] = "int";
12
+ FieldType["IMAGE"] = "image";
13
+ FieldType["MARKDOWN"] = "markdown";
14
+ FieldType["AUDIO"] = "audio";
15
+ FieldType["MIDI"] = "midi";
16
+ FieldType["MEDIA_UPLOADS"] = "uploads";
17
+ FieldType["CHESS_PUZZLE"] = "chess_puzzle";
18
+ })(FieldType || (FieldType = {}));
19
+ //# sourceMappingURL=FieldType.js.map
@@ -0,0 +1,3 @@
1
+ export * from './DataShapeNames.js';
2
+ export * from './FieldType.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}