@pie-element/complex-rubric 0.0.2-next.4424 → 0.1.0

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 (204) hide show
  1. package/dist/author/defaults.d.ts +232 -0
  2. package/dist/author/defaults.d.ts.map +1 -0
  3. package/dist/author/defaults.js +177 -0
  4. package/dist/author/index.d.ts +35 -0
  5. package/dist/author/index.d.ts.map +1 -0
  6. package/dist/author/index.js +86 -0
  7. package/dist/author/main.d.ts +24 -0
  8. package/dist/author/main.d.ts.map +1 -0
  9. package/dist/author/main.js +106 -0
  10. package/dist/controller/defaults.d.ts +40 -0
  11. package/dist/controller/defaults.d.ts.map +1 -0
  12. package/dist/controller/defaults.js +42 -0
  13. package/dist/controller/index.d.ts +26 -0
  14. package/dist/controller/index.d.ts.map +1 -0
  15. package/dist/controller/index.js +107 -0
  16. package/dist/controller/utils.d.ts +10 -0
  17. package/dist/controller/utils.d.ts.map +1 -0
  18. package/dist/controller/utils.js +4 -0
  19. package/dist/delivery/index.d.ts +24 -0
  20. package/dist/delivery/index.d.ts.map +1 -0
  21. package/dist/delivery/index.js +96 -0
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.iife.d.ts +9 -0
  25. package/dist/index.iife.d.ts.map +1 -0
  26. package/dist/index.iife.js +145 -0
  27. package/dist/index.js +2 -0
  28. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
  29. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
  30. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  31. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
  32. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
  33. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
  34. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  35. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
  36. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
  37. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
  38. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
  39. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
  40. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
  41. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
  42. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
  43. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
  44. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
  45. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
  46. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
  47. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
  48. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
  49. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
  50. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  51. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
  52. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
  53. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
  54. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
  55. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
  56. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
  57. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
  58. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
  59. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +16 -0
  60. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
  61. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
  62. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
  63. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
  64. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
  65. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
  66. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
  67. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
  68. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
  69. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
  70. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
  71. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
  72. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
  73. package/dist/print/index.d.ts +25 -0
  74. package/dist/print/index.d.ts.map +1 -0
  75. package/dist/print/index.js +84 -0
  76. package/package.json +65 -16
  77. package/src/author/defaults.tsx +223 -0
  78. package/{configure/src/index.js → src/author/index.ts} +69 -28
  79. package/src/author/main.tsx +172 -0
  80. package/src/controller/defaults.ts +49 -0
  81. package/src/controller/index.ts +230 -0
  82. package/src/controller/utils.ts +13 -0
  83. package/src/{index.js → delivery/index.ts} +65 -9
  84. package/src/index.iife.ts +16 -0
  85. package/src/index.ts +1 -0
  86. package/src/print/index.ts +150 -0
  87. package/LICENSE.md +0 -5
  88. package/README.md +0 -3
  89. package/configure/lib/defaults.js +0 -99
  90. package/configure/lib/defaults.js.map +0 -1
  91. package/configure/lib/index.js +0 -232
  92. package/configure/lib/index.js.map +0 -1
  93. package/configure/lib/main.js +0 -165
  94. package/configure/lib/main.js.map +0 -1
  95. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.json +0 -1
  96. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.md +0 -376
  97. package/configure/node_modules/@pie-element/multi-trait-rubric/LICENSE.md +0 -5
  98. package/configure/node_modules/@pie-element/multi-trait-rubric/README.md +0 -55
  99. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.json +0 -1
  100. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.md +0 -344
  101. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js +0 -455
  102. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js.map +0 -1
  103. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js +0 -82
  104. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js.map +0 -1
  105. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js +0 -112
  106. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js.map +0 -1
  107. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js +0 -438
  108. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js.map +0 -1
  109. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js +0 -324
  110. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js.map +0 -1
  111. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js +0 -490
  112. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js.map +0 -1
  113. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js +0 -334
  114. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js.map +0 -1
  115. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js +0 -254
  116. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js.map +0 -1
  117. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js +0 -29
  118. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js.map +0 -1
  119. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/package.json +0 -22
  120. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.json +0 -1
  121. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.md +0 -66
  122. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js +0 -9
  123. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js.map +0 -1
  124. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js +0 -122
  125. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js.map +0 -1
  126. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/package.json +0 -15
  127. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json +0 -226
  128. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json.md +0 -169
  129. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/config.js +0 -8
  130. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/generate.js +0 -108
  131. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/index.html +0 -1
  132. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/session.js +0 -6
  133. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json +0 -282
  134. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json.md +0 -189
  135. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js +0 -85
  136. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js.map +0 -1
  137. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js +0 -99
  138. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js.map +0 -1
  139. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js +0 -209
  140. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js.map +0 -1
  141. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js +0 -103
  142. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js.map +0 -1
  143. package/configure/node_modules/@pie-element/multi-trait-rubric/package.json +0 -24
  144. package/configure/node_modules/@pie-element/rubric/CHANGELOG.json +0 -257
  145. package/configure/node_modules/@pie-element/rubric/CHANGELOG.md +0 -731
  146. package/configure/node_modules/@pie-element/rubric/LICENSE.md +0 -5
  147. package/configure/node_modules/@pie-element/rubric/README.md +0 -3
  148. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +0 -197
  149. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.md +0 -615
  150. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js +0 -93
  151. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js.map +0 -1
  152. package/configure/node_modules/@pie-element/rubric/configure/package.json +0 -16
  153. package/configure/node_modules/@pie-element/rubric/configure/src/index.js +0 -38
  154. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.json +0 -17
  155. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.md +0 -105
  156. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +0 -14
  157. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js.map +0 -1
  158. package/configure/node_modules/@pie-element/rubric/controller/package.json +0 -9
  159. package/configure/node_modules/@pie-element/rubric/controller/src/__tests__/index.test.js +0 -35
  160. package/configure/node_modules/@pie-element/rubric/controller/src/index.js +0 -6
  161. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json +0 -24
  162. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json.md +0 -19
  163. package/configure/node_modules/@pie-element/rubric/docs/demo/config.js +0 -8
  164. package/configure/node_modules/@pie-element/rubric/docs/demo/generate.js +0 -8
  165. package/configure/node_modules/@pie-element/rubric/docs/demo/index.html +0 -3
  166. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json +0 -62
  167. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json.md +0 -35
  168. package/configure/node_modules/@pie-element/rubric/lib/index.js +0 -88
  169. package/configure/node_modules/@pie-element/rubric/lib/index.js.map +0 -1
  170. package/configure/node_modules/@pie-element/rubric/lib/main.js +0 -171
  171. package/configure/node_modules/@pie-element/rubric/lib/main.js.map +0 -1
  172. package/configure/node_modules/@pie-element/rubric/lib/print.js +0 -114
  173. package/configure/node_modules/@pie-element/rubric/lib/print.js.map +0 -1
  174. package/configure/node_modules/@pie-element/rubric/package.json +0 -25
  175. package/configure/node_modules/@pie-element/rubric/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -22767
  176. package/configure/node_modules/@pie-element/rubric/src/__tests__/rubric-view.test.jsx +0 -48
  177. package/configure/node_modules/@pie-element/rubric/src/index.js +0 -38
  178. package/configure/node_modules/@pie-element/rubric/src/main.jsx +0 -117
  179. package/configure/node_modules/@pie-element/rubric/src/print.js +0 -63
  180. package/configure/package.json +0 -22
  181. package/configure/src/__tests__/__snapshots__/main.test.jsx.snap +0 -106
  182. package/configure/src/__tests__/index.test.js +0 -41
  183. package/configure/src/__tests__/main.test.jsx +0 -104
  184. package/configure/src/defaults.js +0 -122
  185. package/configure/src/main.jsx +0 -117
  186. package/controller/lib/defaults.js +0 -99
  187. package/controller/lib/defaults.js.map +0 -1
  188. package/controller/lib/index.js +0 -147
  189. package/controller/lib/index.js.map +0 -1
  190. package/controller/package.json +0 -12
  191. package/controller/src/__tests__/index.test.js +0 -58
  192. package/controller/src/defaults.js +0 -121
  193. package/controller/src/index.js +0 -81
  194. package/docs/config-schema.json +0 -427
  195. package/docs/config-schema.json.md +0 -315
  196. package/docs/demo/config.js +0 -8
  197. package/docs/demo/generate.js +0 -119
  198. package/docs/demo/index.html +0 -1
  199. package/docs/demo/session.js +0 -6
  200. package/docs/pie-schema.json +0 -994
  201. package/docs/pie-schema.json.md +0 -660
  202. package/lib/index.js +0 -176
  203. package/lib/index.js.map +0 -1
  204. package/src/__tests__/index.test.js +0 -166
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/complex-rubric/controller/src/defaults.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare const RUBRIC_TYPES: {
10
+ SIMPLE_RUBRIC: string;
11
+ MULTI_TRAIT_RUBRIC: string;
12
+ rubricless: string;
13
+ };
14
+ declare const _default: {
15
+ rubricType: string;
16
+ rubrics: {
17
+ [RUBRIC_TYPES.SIMPLE_RUBRIC]: {
18
+ points: string[];
19
+ sampleAnswers: null[];
20
+ maxPoints: number;
21
+ excludeZero: boolean;
22
+ };
23
+ [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: {
24
+ description: boolean;
25
+ excludeZero: boolean;
26
+ halfScoring: boolean;
27
+ pointLabels: boolean;
28
+ scales: never[];
29
+ standards: boolean;
30
+ visibleToStudent: boolean;
31
+ };
32
+ [RUBRIC_TYPES.RUBRICLESS]: {
33
+ maxPoints: number;
34
+ excludeZero: boolean;
35
+ rubriclessInstructionEnabled: boolean;
36
+ };
37
+ };
38
+ };
39
+ export default _default;
40
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/controller/defaults.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAIH,QAAA,MAAM,YAAY;;;;CAIjB,CAAC;;;;QA4BE,CAAC,YAAY,CAAC,aAAa,CAAC;;;;;UAAoB;QAChD,CAAC,YAAY,CAAC,kBAAkB,CAAC;;;;;;;;UAAwB;QACzD,CAAC,YAAY,CAAC,UAAU,CAAC;;;;UAAwB;;;AALrD,wBAOE"}
@@ -0,0 +1,42 @@
1
+ //#region src/controller/defaults.ts
2
+ var e = {
3
+ SIMPLE_RUBRIC: "simpleRubric",
4
+ MULTI_TRAIT_RUBRIC: "multiTraitRubric",
5
+ rubricless: "rubricless"
6
+ }, t = {
7
+ description: !1,
8
+ excludeZero: !1,
9
+ halfScoring: !1,
10
+ pointLabels: !0,
11
+ scales: [],
12
+ standards: !1,
13
+ visibleToStudent: !0
14
+ }, n = {
15
+ points: [
16
+ "",
17
+ "",
18
+ "",
19
+ ""
20
+ ],
21
+ sampleAnswers: [
22
+ null,
23
+ null,
24
+ null,
25
+ null
26
+ ],
27
+ maxPoints: 3,
28
+ excludeZero: !1
29
+ }, r = {
30
+ maxPoints: 100,
31
+ excludeZero: !1,
32
+ rubriclessInstructionEnabled: !0
33
+ }, i = {
34
+ rubricType: "simpleRubric",
35
+ rubrics: {
36
+ [e.SIMPLE_RUBRIC]: n,
37
+ [e.MULTI_TRAIT_RUBRIC]: t,
38
+ [e.RUBRICLESS]: r
39
+ }
40
+ };
41
+ //#endregion
42
+ export { i as default };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/complex-rubric/controller/src/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export declare function createDefaultModel(model?: {}): Promise<unknown>;
10
+ export declare const normalize: (question: any) => any;
11
+ /**
12
+ * @param {*} question
13
+ * @param {*} session
14
+ * @param {*} env
15
+ */
16
+ export declare function model(question: any, session: any, env: any): Promise<any>;
17
+ export declare const getScore: () => number;
18
+ /**
19
+ * @param {Object} model - the main model
20
+ * @param {*} session
21
+ * @param {Object} env
22
+ */
23
+ export declare function outcome(): Promise<unknown>;
24
+ export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
25
+ export declare const validate: (model?: {}, config?: {}) => {};
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/controller/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAcH,wBAAgB,kBAAkB,CAAC,KAAK,KAAK,oBAE5C;AAED,eAAO,MAAM,SAAS,GAAI,aAAQ,QAAmC,CAAC;AAEtE;;;;GAIG;AACH,wBAAsB,KAAK,CAAC,QAAQ,KAAA,EAAE,OAAO,KAAA,EAAE,GAAG,KAAA,gBAwDjD;AAED,eAAO,MAAM,QAAQ,cAAU,CAAC;AAEhC;;;;GAIG;AACH,wBAAgB,OAAO,qBAEtB;AAED,eAAO,MAAM,4BAA4B,GAAI,aAAQ,EAAE,QAAG,qBAQzD,CAAC;AAuGF,eAAO,MAAM,QAAQ,GAAI,UAAU,EAAE,WAAW,OAgB/C,CAAC"}
@@ -0,0 +1,107 @@
1
+ import e from "./defaults.js";
2
+ import { markupToText as t } from "./utils.js";
3
+ //#region src/controller/index.ts
4
+ var n = {
5
+ SIMPLE_RUBRIC: "simpleRubric",
6
+ MULTI_TRAIT_RUBRIC: "multiTraitRubric",
7
+ rubricless: "rubricless"
8
+ };
9
+ function r(t = {}) {
10
+ return new Promise((n) => n({
11
+ ...e,
12
+ ...t
13
+ }));
14
+ }
15
+ var i = (t) => ({
16
+ ...e,
17
+ ...t
18
+ });
19
+ async function a(e, t, r) {
20
+ let a = i(e);
21
+ if (a.rubricType === n.SIMPLE_RUBRIC || a.rubricType === n.RUBRICLESS) return new Promise((e) => {
22
+ e(r && r.role && r.role === "instructor" ? {
23
+ ...a,
24
+ rubrics: {
25
+ ...a.rubrics,
26
+ multiTraitRubric: {
27
+ ...a.rubrics.multiTraitRubric,
28
+ visible: !1
29
+ }
30
+ }
31
+ } : {});
32
+ });
33
+ {
34
+ !r.role || r.role === "student" && a.rubrics && a.rubrics.multiTraitRubric ? a.rubrics.multiTraitRubric.visible = a.visibleToStudent : a.rubrics.multiTraitRubric.visible = !0;
35
+ let { scales: e, excludeZero: t } = a.rubrics.multiTraitRubric || {}, n = (e || []).map((e) => ({
36
+ ...e,
37
+ excludeZero: t
38
+ }));
39
+ return {
40
+ ...a,
41
+ rubrics: {
42
+ ...a.rubrics,
43
+ simpleRubric: {
44
+ ...a.rubrics.simpleRubric,
45
+ visible: !1
46
+ },
47
+ rubricless: {
48
+ ...a.rubrics.rubricless,
49
+ visible: !1
50
+ },
51
+ multiTraitRubric: {
52
+ ...a.rubrics.multiTraitRubric,
53
+ scales: n
54
+ }
55
+ }
56
+ };
57
+ }
58
+ }
59
+ var o = () => 0;
60
+ function s() {
61
+ return new Promise((e) => e({
62
+ score: 0,
63
+ empty: !0
64
+ }));
65
+ }
66
+ var c = (e, t) => new Promise((e) => {
67
+ t.mode !== "evaluate" && t.role === "instructor" ? e({ id: "1" }) : e(null);
68
+ }), l = (e) => {
69
+ let { points: n } = e, r = {}, i = {};
70
+ return (n || []).forEach((e, r) => {
71
+ !e || e === "<div></div>" ? i[r] = "Points descriptors cannot be empty." : n.slice(r + 1).some((n) => t(n) === t(e)) && (i[r] = "Points descriptors should be unique.");
72
+ }), Object.keys(i).length > 0 && (r.pointsDescriptorsErrors = i), r;
73
+ }, u = (e) => {
74
+ let { scales: n, description: r = !1, pointLabels: i = !1 } = e, a = {}, o = {}, s = {};
75
+ return (n || []).forEach((e, n) => {
76
+ let { traits: a = [] } = e, { scorePointsLabels: c = [] } = e, l = {}, u = {};
77
+ i && c.forEach((e, n) => {
78
+ !e || e === "<div></div>" ? u[n] = "Points labels should not be empty." : c.slice(n + 1).some((n) => t(n) === t(e)) && (u[n] = "Points labels should be unique.");
79
+ }), Object.keys(u).length > 0 && (s[n] = u), a.forEach((e, n) => {
80
+ if (!e.name || e.name === "<div></div>" ? l[n] = { name: "Trait names should not be empty." } : a.slice(n + 1).some((n) => t(n.name) === t(e.name)) && (l[n] = { name: "Trait names should be unique." }), r && (!e.description || e.description === "<div></div>")) l[n] = {
81
+ ...l[n],
82
+ description: "Trait description should not be empty"
83
+ };
84
+ else {
85
+ let i = a.slice(n + 1).some((n) => t(n.description) === t(e.description));
86
+ r && i && (l[n] = {
87
+ ...l[n],
88
+ description: "Trait descriptions should be unique."
89
+ });
90
+ }
91
+ }), Object.keys(l).length > 0 && (o[n] = l);
92
+ }), Object.keys(o).length > 0 && (a.traitsErrors = o), Object.keys(s).length > 0 && (a.scorePointsErrors = s), a;
93
+ }, d = (e = {}, t = {}) => {
94
+ let { rubrics: r = {}, rubricType: i } = e, { multiTraitRubric: a = {}, simpleRubric: o = {} } = r, s = {};
95
+ switch (i) {
96
+ case n.SIMPLE_RUBRIC:
97
+ default:
98
+ s = l(o);
99
+ break;
100
+ case n.MULTI_TRAIT_RUBRIC:
101
+ s = u(a);
102
+ break;
103
+ }
104
+ return s;
105
+ };
106
+ //#endregion
107
+ export { c as createCorrectResponseSession, r as createDefaultModel, o as getScore, a as model, i as normalize, s as outcome, d as validate };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/complex-rubric/controller/src/utils.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export declare const markupToText: (s: any) => any;
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/controller/utils.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,eAAO,MAAM,YAAY,GAAI,MAAC,QAE7B,CAAC"}
@@ -0,0 +1,4 @@
1
+ //#region src/controller/utils.ts
2
+ var e = (e) => (e || "").replace(/(<([^>]+)>)/gi, "");
3
+ //#endregion
4
+ export { e as markupToText };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/complex-rubric/src/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare class ComplexRubric extends HTMLElement {
10
+ constructor();
11
+ set type(t: any);
12
+ get type(): any;
13
+ set model(m: any);
14
+ setRubricModel(simpleRubric: any): void;
15
+ setMultiTraitRubricModel(multiTraitRubric: any): void;
16
+ setRubriclessModel(rubricless: any): void;
17
+ get multiTraitRubric(): Element | null;
18
+ get simpleRubric(): Element | null;
19
+ get rubricless(): Element | null;
20
+ connectedCallback(): void;
21
+ _render(): void;
22
+ }
23
+ export default ComplexRubric;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delivery/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAyBH,cAAM,aAAc,SAAQ,WAAW;;IAOrC,IAAI,IAAI,CAAC,CAAC,KAAA,EAET;IAED,IAAI,IAAI,QAEP;IAED,IAAI,KAAK,CAAC,CAAC,KAAA,EA2BV;IAED,cAAc,CAAC,YAAY,KAAA;IAW3B,wBAAwB,CAAC,gBAAgB,KAAA;IAWzC,kBAAkB,CAAC,UAAU,KAAA;IAW7B,IAAI,gBAAgB,mBAEnB;IAED,IAAI,YAAY,mBAEf;IAED,IAAI,UAAU,mBAEb;IAED,iBAAiB;IAIjB,OAAO;CAiCR;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,96 @@
1
+ import e from "@pie-element/rubric";
2
+ import t from "@pie-element/multi-trait-rubric";
3
+ import { RUBRIC_TYPES as n } from "@pie-lib/rubric";
4
+ //#region src/delivery/index.ts
5
+ var r = "complex-rubric-simple", i = "complex-rubric-multi-trait", a = class extends e {}, o = class extends t {};
6
+ customElements.get(r) || customElements.define(r, a), customElements.get(i) || customElements.define(i, o);
7
+ var s = class extends HTMLElement {
8
+ constructor() {
9
+ super(), this._model = {}, this._type = n.SIMPLE_RUBRIC;
10
+ }
11
+ set type(e) {
12
+ this._type = e;
13
+ }
14
+ get type() {
15
+ return this._type;
16
+ }
17
+ set model(e) {
18
+ this._model = e;
19
+ let t = this._type;
20
+ switch (this.type = e.rubricType, this._type) {
21
+ case n.SIMPLE_RUBRIC:
22
+ default:
23
+ customElements.whenDefined(r).then(() => {
24
+ this.setRubricModel(this.simpleRubric);
25
+ });
26
+ break;
27
+ case n.MULTI_TRAIT_RUBRIC:
28
+ customElements.whenDefined(i).then(() => {
29
+ this.setMultiTraitRubricModel(this.multiTraitRubric);
30
+ });
31
+ break;
32
+ case n.RUBRICLESS:
33
+ customElements.whenDefined(r).then(() => {
34
+ this.setRubriclessModel(this.rubricless);
35
+ });
36
+ break;
37
+ }
38
+ t !== this.type && this._render();
39
+ }
40
+ setRubricModel(e) {
41
+ if (this._model && this._model.rubrics && this._model.rubrics.simpleRubric) {
42
+ let { mode: t } = this._model;
43
+ e.model = {
44
+ ...this._model.rubrics.simpleRubric,
45
+ mode: t
46
+ };
47
+ }
48
+ }
49
+ setMultiTraitRubricModel(e) {
50
+ if (this._model && this._model.rubrics && this._model.rubrics.multiTraitRubric) {
51
+ let { mode: t } = this._model;
52
+ e.model = {
53
+ ...this._model.rubrics.multiTraitRubric,
54
+ mode: t
55
+ };
56
+ }
57
+ }
58
+ setRubriclessModel(e) {
59
+ if (this._model && this._model.rubrics && this._model.rubrics.rubricless) {
60
+ let { mode: t } = this._model;
61
+ e.model = {
62
+ ...this._model.rubrics.rubricless,
63
+ mode: t
64
+ };
65
+ }
66
+ }
67
+ get multiTraitRubric() {
68
+ return this.querySelector(`${i}#multiTraitRubric`);
69
+ }
70
+ get simpleRubric() {
71
+ return this.querySelector(`${r}#simpleRubric`);
72
+ }
73
+ get rubricless() {
74
+ return this.querySelector(`${r}#rubricless`);
75
+ }
76
+ connectedCallback() {
77
+ this._render();
78
+ }
79
+ _render() {
80
+ let e;
81
+ switch (e = this._type === n.SIMPLE_RUBRIC ? `<${r} id="simpleRubric" />` : this._type === n.RUBRICLESS ? `<${r} id="rubricless" />` : `<${i} id="multiTraitRubric" />`, this.innerHTML = e, this._type) {
82
+ case n.SIMPLE_RUBRIC:
83
+ default:
84
+ customElements.get(r) && this.setRubricModel(this.simpleRubric);
85
+ break;
86
+ case n.MULTI_TRAIT_RUBRIC:
87
+ customElements.get(i) && this.setMultiTraitRubricModel(this.multiTraitRubric);
88
+ break;
89
+ case n.RUBRICLESS:
90
+ customElements.get(r) && this.setRubriclessModel(this.rubricless);
91
+ break;
92
+ }
93
+ }
94
+ };
95
+ //#endregion
96
+ export { s as default };
@@ -0,0 +1,2 @@
1
+ export { default } from './delivery/index.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * IIFE entry point for complex-rubric element
3
+ * This file is only used for IIFE builds and includes auto-registration
4
+ *
5
+ * @sync-generated - Auto-generated during sync from pie-elements
6
+ */
7
+ import Element from './index.js';
8
+ export default Element;
9
+ //# sourceMappingURL=index.iife.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.iife.d.ts","sourceRoot":"","sources":["../src/index.iife.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,OAAO,MAAM,YAAY,CAAC;AAQjC,eAAe,OAAO,CAAC"}