@pie-element/complex-rubric 2.1.2-next.36 → 2.1.2-next.44

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 (95) hide show
  1. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.json +1 -0
  2. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.md +1001 -0
  3. package/configure/node_modules/@pie-element/multi-trait-rubric/LICENSE.md +5 -0
  4. package/configure/node_modules/@pie-element/multi-trait-rubric/README.md +55 -0
  5. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.json +1 -0
  6. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.md +892 -0
  7. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js +563 -0
  8. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js.map +1 -0
  9. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js +99 -0
  10. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js.map +1 -0
  11. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js +126 -0
  12. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js.map +1 -0
  13. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js +569 -0
  14. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js.map +1 -0
  15. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js +361 -0
  16. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js.map +1 -0
  17. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js +560 -0
  18. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js.map +1 -0
  19. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js +374 -0
  20. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js.map +1 -0
  21. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js +283 -0
  22. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js.map +1 -0
  23. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js +29 -0
  24. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js.map +1 -0
  25. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/package.json +18 -0
  26. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.json +1 -0
  27. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.md +233 -0
  28. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js +94 -0
  29. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js.map +1 -0
  30. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js +215 -0
  31. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js.map +1 -0
  32. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js +13 -0
  33. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js.map +1 -0
  34. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/package.json +15 -0
  35. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json +272 -0
  36. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json.md +206 -0
  37. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/config.js +8 -0
  38. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/generate.js +180 -0
  39. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/index.html +1 -0
  40. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/session.js +6 -0
  41. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json +298 -0
  42. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json.md +201 -0
  43. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js +85 -0
  44. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js.map +1 -0
  45. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js +161 -0
  46. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js.map +1 -0
  47. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js +330 -0
  48. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js.map +1 -0
  49. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js +103 -0
  50. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js.map +1 -0
  51. package/configure/node_modules/@pie-element/multi-trait-rubric/package.json +24 -0
  52. package/configure/node_modules/@pie-element/rubric/CHANGELOG.json +257 -0
  53. package/configure/node_modules/@pie-element/rubric/CHANGELOG.md +1271 -0
  54. package/configure/node_modules/@pie-element/rubric/LICENSE.md +5 -0
  55. package/configure/node_modules/@pie-element/rubric/README.md +3 -0
  56. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +197 -0
  57. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.md +1111 -0
  58. package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js +34 -0
  59. package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js.map +1 -0
  60. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js +130 -0
  61. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js.map +1 -0
  62. package/configure/node_modules/@pie-element/rubric/configure/lib/main.js +108 -0
  63. package/configure/node_modules/@pie-element/rubric/configure/lib/main.js.map +1 -0
  64. package/configure/node_modules/@pie-element/rubric/configure/package.json +17 -0
  65. package/configure/node_modules/@pie-element/rubric/configure/src/defaults.js +26 -0
  66. package/configure/node_modules/@pie-element/rubric/configure/src/index.js +64 -0
  67. package/configure/node_modules/@pie-element/rubric/configure/src/main.jsx +56 -0
  68. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.json +17 -0
  69. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.md +215 -0
  70. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +45 -0
  71. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js.map +1 -0
  72. package/configure/node_modules/@pie-element/rubric/controller/package.json +13 -0
  73. package/configure/node_modules/@pie-element/rubric/controller/src/__tests__/index.test.js +31 -0
  74. package/configure/node_modules/@pie-element/rubric/controller/src/index.js +38 -0
  75. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json +160 -0
  76. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json.md +127 -0
  77. package/configure/node_modules/@pie-element/rubric/docs/demo/config.js +8 -0
  78. package/configure/node_modules/@pie-element/rubric/docs/demo/generate.js +8 -0
  79. package/configure/node_modules/@pie-element/rubric/docs/demo/index.html +2 -0
  80. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json +96 -0
  81. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json.md +65 -0
  82. package/configure/node_modules/@pie-element/rubric/lib/index.js +88 -0
  83. package/configure/node_modules/@pie-element/rubric/lib/index.js.map +1 -0
  84. package/configure/node_modules/@pie-element/rubric/lib/main.js +188 -0
  85. package/configure/node_modules/@pie-element/rubric/lib/main.js.map +1 -0
  86. package/configure/node_modules/@pie-element/rubric/lib/print.js +114 -0
  87. package/configure/node_modules/@pie-element/rubric/lib/print.js.map +1 -0
  88. package/configure/node_modules/@pie-element/rubric/package.json +26 -0
  89. package/configure/node_modules/@pie-element/rubric/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +23003 -0
  90. package/configure/node_modules/@pie-element/rubric/src/__tests__/rubric-view.test.jsx +46 -0
  91. package/configure/node_modules/@pie-element/rubric/src/index.js +34 -0
  92. package/configure/node_modules/@pie-element/rubric/src/main.jsx +136 -0
  93. package/configure/node_modules/@pie-element/rubric/src/print.js +63 -0
  94. package/configure/package.json +2 -2
  95. package/package.json +4 -4
@@ -0,0 +1,215 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [2.0.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@2.0.2...@pie-element/rubric-controller@2.0.3) (2023-11-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib ([74283d7](https://github.com/pie-framework/pie-elements/commit/74283d71b12ab9c82875ce995368e5e39f4face6))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.0.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@2.0.1...@pie-element/rubric-controller@2.0.2) (2023-11-27)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * update pie-lib/pie-toolbox PD-597 ([1ec84aa](https://github.com/pie-framework/pie-elements/commit/1ec84aadae515088ef65b99f780a5e5dca516f99))
23
+ * update pie-libs PD-2996 ([cd092c6](https://github.com/pie-framework/pie-elements/commit/cd092c6b5c4db91645394cd23febc1f9a07f46f9))
24
+
25
+
26
+
27
+
28
+
29
+ ## [2.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@2.0.0...@pie-element/rubric-controller@2.0.1) (2023-11-09)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * update pie-lib/pie-toolbox PD-3221, PD-3249, PD-2765 ([9de1563](https://github.com/pie-framework/pie-elements/commit/9de1563d636983c3ddceee0279c0709d396d4f96))
35
+
36
+
37
+
38
+
39
+
40
+ # [2.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.12...@pie-element/rubric-controller@2.0.0) (2023-11-07)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * update pie-lib version to fix imports for pie-lib/pie-toolbox/editable-html ([a90cbf6](https://github.com/pie-framework/pie-elements/commit/a90cbf6be81824e7266df23c2dc49b259337c1b6))
46
+ * update pie-lib/pie-toolbox version ([212cbfa](https://github.com/pie-framework/pie-elements/commit/212cbfad27b29f0b1b2a3706ba82f6fb59147001))
47
+ * update pie-lib/pie-toolbox version ([b791e10](https://github.com/pie-framework/pie-elements/commit/b791e10857928766e2d73c6aa80b3fb50fd1afac))
48
+ * update pie-lib/pie-toolbox version ([7f64f9f](https://github.com/pie-framework/pie-elements/commit/7f64f9f2b874fd08bd8f6f05c1c4292c34ac6338))
49
+
50
+
51
+ ### Code Refactoring
52
+
53
+ * replaced all pie-lib packages with the new pie-toolbox package that contains all of them. ([073d7e5](https://github.com/pie-framework/pie-elements/commit/073d7e5175f7a73069f09d2ceda799682acce494))
54
+
55
+
56
+ ### BREAKING CHANGES
57
+
58
+ * using pie-lib/pie-toolbox now, instead of any other pie-lib package.
59
+
60
+
61
+
62
+
63
+
64
+ ## [1.2.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.11...@pie-element/rubric-controller@1.2.12) (2023-07-06)
65
+
66
+
67
+ ### Bug Fixes
68
+
69
+ * updated editable-html dependent packages for PD-2150 ([ffa6297](https://github.com/pie-framework/pie-elements/commit/ffa62977a9e329c1e12ea1dfcb2af4ba4c993bca))
70
+
71
+
72
+
73
+
74
+
75
+ ## [1.2.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.10...@pie-element/rubric-controller@1.2.11) (2023-04-25)
76
+
77
+
78
+ ### Bug Fixes
79
+
80
+ * update pie-libs PD-2762 ([7ac4313](https://github.com/pie-framework/pie-elements/commit/7ac431346b822fe3bbb0d13375f044f6ce1f426b))
81
+
82
+
83
+
84
+
85
+
86
+ ## [1.2.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.9...@pie-element/rubric-controller@1.2.10) (2023-03-30)
87
+
88
+
89
+ ### Bug Fixes
90
+
91
+ * revert adding pie-lib/rubric and remove its usage from controller ([2e58a35](https://github.com/pie-framework/pie-elements/commit/2e58a35e3490f4c002c82206eec3b74b215f3e57))
92
+
93
+
94
+
95
+
96
+
97
+ ## [1.2.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.8...@pie-element/rubric-controller@1.2.9) (2023-03-30)
98
+
99
+
100
+ ### Bug Fixes
101
+
102
+ * add dependencies ([4156132](https://github.com/pie-framework/pie-elements/commit/415613209380f7bc613b1ae7908586bbe43e32bf))
103
+
104
+
105
+
106
+
107
+
108
+ ## [1.2.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.7...@pie-element/rubric-controller@1.2.8) (2022-12-07)
109
+
110
+ **Note:** Version bump only for package @pie-element/rubric-controller
111
+
112
+
113
+
114
+
115
+
116
+ ## [1.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.2...@pie-element/rubric-controller@1.2.4) (2021-11-11)
117
+
118
+ **Note:** Version bump only for package @pie-element/rubric-controller
119
+
120
+
121
+
122
+
123
+
124
+ ## [1.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.2...@pie-element/rubric-controller@1.2.3) (2021-11-11)
125
+
126
+ **Note:** Version bump only for package @pie-element/rubric-controller
127
+
128
+
129
+
130
+
131
+
132
+ ## [1.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.0...@pie-element/rubric-controller@1.2.2) (2021-08-05)
133
+
134
+
135
+ ### Bug Fixes
136
+
137
+ * force bump ([5ea7295](https://github.com/pie-framework/pie-elements/commit/5ea7295e4755fbc492a76e7ec69e5fc35b196919))
138
+
139
+
140
+
141
+
142
+
143
+ # [1.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.8...@pie-element/rubric-controller@1.2.0) (2021-06-29)
144
+
145
+
146
+ ### Features
147
+
148
+ * **rubric:** Added sample answers to the model - PD-621 ([#559](https://github.com/pie-framework/pie-elements/issues/559)) ([d436b47](https://github.com/pie-framework/pie-elements/commit/d436b47b1cb8dd7cfbd82dbd2de4dd5eab36905c))
149
+
150
+
151
+
152
+
153
+
154
+ ## [1.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.6...@pie-element/rubric-controller@1.1.8) (2021-03-03)
155
+
156
+ **Note:** Version bump only for package @pie-element/rubric-controller
157
+
158
+
159
+
160
+
161
+
162
+ ## [1.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.4...@pie-element/rubric-controller@1.1.6) (2021-03-03)
163
+
164
+ **Note:** Version bump only for package @pie-element/rubric-controller
165
+
166
+
167
+
168
+
169
+
170
+ ## [1.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.3...@pie-element/rubric-controller@1.1.4) (2020-05-25)
171
+
172
+ **Note:** Version bump only for package @pie-element/rubric-controller
173
+
174
+
175
+
176
+
177
+
178
+ ## [1.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.2...@pie-element/rubric-controller@1.1.3) (2020-05-25)
179
+
180
+ **Note:** Version bump only for package @pie-element/rubric-controller
181
+
182
+
183
+
184
+
185
+
186
+ ## [1.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.1...@pie-element/rubric-controller@1.1.2) (2020-04-14)
187
+
188
+ **Note:** Version bump only for package @pie-element/rubric-controller
189
+
190
+
191
+
192
+
193
+
194
+ ## [1.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.0.2...@pie-element/rubric-controller@1.1.1) (2020-04-10)
195
+
196
+
197
+ ### Bug Fixes
198
+
199
+ * bump all packages to avoid tag conflict ([d9ec9a8](https://github.com/pie-framework/pie-elements/commit/d9ec9a8))
200
+
201
+
202
+
203
+
204
+
205
+ ## [1.0.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.0.1...@pie-element/rubric-controller@1.0.2) (2019-06-17)
206
+
207
+ **Note:** Version bump only for package @pie-element/rubric-controller
208
+
209
+
210
+
211
+
212
+
213
+ ## 1.0.1 (2019-05-31)
214
+
215
+ **Note:** Version bump only for package @pie-element/rubric-controller
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.model = model;
7
+ exports.validate = validate;
8
+
9
+ function model(model, session, env) {
10
+ return new Promise(function (resolve) {
11
+ var modelResult = !model ? {} : model;
12
+ resolve(env && env.role && env.role === 'instructor' ? modelResult : {});
13
+ });
14
+ }
15
+
16
+ function markupToText(s) {
17
+ return (s || '').replace(/(<([^>]+)>)/ig, '');
18
+ } // IMPORTANT! If you make any changes to this function, please make sure you also update complex-rubric/controller/validateSimpleRubric function!“.
19
+
20
+
21
+ function validate(model, config) {
22
+ var points = model.points;
23
+ var errors = {};
24
+ var pointsDescriptorsErrors = {};
25
+ (points || []).forEach(function (point, index) {
26
+ if (!point || point === '<div></div>') {
27
+ pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';
28
+ } else {
29
+ var identicalPointDescr = points.slice(index + 1).some(function (p) {
30
+ return markupToText(p) === markupToText(point);
31
+ });
32
+
33
+ if (identicalPointDescr) {
34
+ pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';
35
+ }
36
+ }
37
+ });
38
+
39
+ if (Object.keys(pointsDescriptorsErrors).length > 0) {
40
+ errors.pointsDescriptorsErrors = pointsDescriptorsErrors;
41
+ }
42
+
43
+ return errors;
44
+ }
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.js"],"names":["model","session","env","Promise","resolve","modelResult","role","markupToText","s","replace","validate","config","points","errors","pointsDescriptorsErrors","forEach","point","index","identicalPointDescr","slice","some","p","Object","keys","length"],"mappings":";;;;;;;;AAAO,SAASA,KAAT,CAAeA,KAAf,EAAsBC,OAAtB,EAA+BC,GAA/B,EAAoC;AACzC,SAAO,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAa;AAC9B,QAAMC,WAAW,GAAG,CAACL,KAAD,GAAS,EAAT,GAAcA,KAAlC;AACAI,IAAAA,OAAO,CAACF,GAAG,IAAIA,GAAG,CAACI,IAAX,IAAmBJ,GAAG,CAACI,IAAJ,KAAa,YAAhC,GAA+CD,WAA/C,GAA6D,EAA9D,CAAP;AACD,GAHM,CAAP;AAID;;AAGD,SAASE,YAAT,CAAsBC,CAAtB,EAAyB;AACvB,SAAO,CAACA,CAAC,IAAI,EAAN,EAAUC,OAAV,CAAkB,eAAlB,EAAmC,EAAnC,CAAP;AACD,C,CAGD;;;AACO,SAASC,QAAT,CAAmBV,KAAnB,EAA0BW,MAA1B,EAAkC;AACvC,MAAQC,MAAR,GAAmBZ,KAAnB,CAAQY,MAAR;AACA,MAAMC,MAAM,GAAG,EAAf;AACA,MAAMC,uBAAuB,GAAG,EAAhC;AAEA,GAACF,MAAM,IAAI,EAAX,EAAeG,OAAf,CAAuB,UAACC,KAAD,EAAQC,KAAR,EAAkB;AACvC,QAAG,CAACD,KAAD,IAASA,KAAK,KAAK,aAAtB,EAAqC;AACnCF,MAAAA,uBAAuB,CAACG,KAAD,CAAvB,GAAiC,qCAAjC;AACD,KAFD,MAGI;AACF,UAAMC,mBAAmB,GAAGN,MAAM,CAACO,KAAP,CAAaF,KAAK,GAAG,CAArB,EAAwBG,IAAxB,CAA6B,UAAAC,CAAC;AAAA,eAAId,YAAY,CAACc,CAAD,CAAZ,KAAoBd,YAAY,CAACS,KAAD,CAApC;AAAA,OAA9B,CAA5B;;AAEA,UAAIE,mBAAJ,EAAyB;AACvBJ,QAAAA,uBAAuB,CAACG,KAAD,CAAvB,GAAiC,sCAAjC;AACD;AACF;AACF,GAXD;;AAaA,MAAGK,MAAM,CAACC,IAAP,CAAYT,uBAAZ,EAAqCU,MAArC,GAA8C,CAAjD,EAAmD;AACjDX,IAAAA,MAAM,CAACC,uBAAP,GAAiCA,uBAAjC;AACD;;AAED,SAAOD,MAAP;AACD","sourcesContent":["export function model(model, session, env) {\n return new Promise((resolve) => {\n const modelResult = !model ? {} : model;\n resolve(env && env.role && env.role === 'instructor' ? modelResult : {});\n });\n}\n\n\nfunction markupToText(s) {\n return (s || '').replace(/(<([^>]+)>)/ig, '');\n}\n\n\n// IMPORTANT! If you make any changes to this function, please make sure you also update complex-rubric/controller/validateSimpleRubric function!“.\nexport function validate (model, config) {\n const { points } = model;\n const errors = {};\n const pointsDescriptorsErrors = {};\n\n (points || []).forEach((point, index) => {\n if(!point|| point === '<div></div>') {\n pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';\n }\n else{\n const identicalPointDescr = points.slice(index + 1).some(p => markupToText(p) === markupToText(point));\n\n if (identicalPointDescr) {\n pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';\n }\n }\n });\n\n if(Object.keys(pointsDescriptorsErrors).length > 0){\n errors.pointsDescriptorsErrors = pointsDescriptorsErrors;\n }\n\n return errors;\n}\n"],"file":"index.js"}
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@pie-element/rubric-controller",
3
+ "private": true,
4
+ "version": "2.0.3",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "test": "./node_modules/.bin/jest"
8
+ },
9
+ "dependencies": {
10
+ "@pie-lib/pie-toolbox": "1.2.3",
11
+ "lodash": "^4.17.15"
12
+ }
13
+ }
@@ -0,0 +1,31 @@
1
+ import { model } from '../index';
2
+
3
+ describe('rubric model', () => {
4
+ let state = {
5
+ points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
6
+ sampleAnswers: [null, 'just right', 'not left', null],
7
+ maxPoints: 4,
8
+ excludeZero: false,
9
+ };
10
+
11
+ let session = {};
12
+ let env, result;
13
+
14
+ it('returns no model for gather', async () => {
15
+ env = { mode: 'gather' };
16
+ result = await model(state, session, env);
17
+ expect(result).toEqual({});
18
+ });
19
+
20
+ it('returns no model for student role', async () => {
21
+ env = { mode: 'gather', role: 'student' };
22
+ result = await model(state, session, env);
23
+ expect(result).toEqual({});
24
+ });
25
+
26
+ it('returns model for instructor role', async () => {
27
+ env = { mode: 'gather', role: 'instructor' };
28
+ result = await model(state, session, env);
29
+ expect(result).toEqual(state);
30
+ });
31
+ });
@@ -0,0 +1,38 @@
1
+ export function model(model, session, env) {
2
+ return new Promise((resolve) => {
3
+ const modelResult = !model ? {} : model;
4
+ resolve(env && env.role && env.role === 'instructor' ? modelResult : {});
5
+ });
6
+ }
7
+
8
+
9
+ function markupToText(s) {
10
+ return (s || '').replace(/(<([^>]+)>)/ig, '');
11
+ }
12
+
13
+
14
+ // IMPORTANT! If you make any changes to this function, please make sure you also update complex-rubric/controller/validateSimpleRubric function!“.
15
+ export function validate (model, config) {
16
+ const { points } = model;
17
+ const errors = {};
18
+ const pointsDescriptorsErrors = {};
19
+
20
+ (points || []).forEach((point, index) => {
21
+ if(!point|| point === '<div></div>') {
22
+ pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';
23
+ }
24
+ else{
25
+ const identicalPointDescr = points.slice(index + 1).some(p => markupToText(p) === markupToText(point));
26
+
27
+ if (identicalPointDescr) {
28
+ pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';
29
+ }
30
+ }
31
+ });
32
+
33
+ if(Object.keys(pointsDescriptorsErrors).length > 0){
34
+ errors.pointsDescriptorsErrors = pointsDescriptorsErrors;
35
+ }
36
+
37
+ return errors;
38
+ }
@@ -0,0 +1,160 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "settingsPanelDisabled": {
5
+ "description": "Indicates if the settings panel is not available",
6
+ "type": "boolean",
7
+ "title": "settingsPanelDisabled"
8
+ },
9
+ "showExcludeZero": {
10
+ "title": "ConfigureProp",
11
+ "type": "object",
12
+ "properties": {
13
+ "settings": {
14
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
15
+ "type": "boolean",
16
+ "title": "settings"
17
+ },
18
+ "label": {
19
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
20
+ "type": "string",
21
+ "title": "label"
22
+ }
23
+ }
24
+ },
25
+ "showMaxPoint": {
26
+ "title": "ConfigureProp",
27
+ "type": "object",
28
+ "properties": {
29
+ "settings": {
30
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
31
+ "type": "boolean",
32
+ "title": "settings"
33
+ },
34
+ "label": {
35
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
36
+ "type": "string",
37
+ "title": "label"
38
+ }
39
+ }
40
+ },
41
+ "width": {
42
+ "description": "How large can the rubric be",
43
+ "type": "string",
44
+ "title": "width"
45
+ },
46
+ "mathMlOptions": {
47
+ "title": "ConfigureMathMLProp",
48
+ "type": "object",
49
+ "properties": {
50
+ "mmlOutput": {
51
+ "description": "Indicates if model should have mathML output instead of latex",
52
+ "type": "number",
53
+ "title": "mmlOutput"
54
+ },
55
+ "mmlEditing": {
56
+ "description": "Indicates if mathML that's already in model should be editable",
57
+ "type": "number",
58
+ "title": "mmlEditing"
59
+ }
60
+ }
61
+ },
62
+ "showPrompt": {
63
+ "description": "Determines whether prompt field will be displayed or not",
64
+ "default": true,
65
+ "type": "boolean",
66
+ "title": "showPrompt"
67
+ },
68
+ "promptLabel": {
69
+ "description": "The label for the item stem/prompt field",
70
+ "default": "Item Stemm",
71
+ "type": "string",
72
+ "title": "promptLabel"
73
+ },
74
+ "contentDimensions": {
75
+ "description": "Indicates the dimensions configuration for the authoring container\nNote: Some items have a default minimum width because of their content, but if\nthe minWidth is lower than this, the overflow behavior will take care of that",
76
+ "default": ": {}",
77
+ "type": "object",
78
+ "properties": {
79
+ "maxHeight": {
80
+ "description": "Indicates the max height of the authoring container",
81
+ "default": "undefined",
82
+ "type": [
83
+ "string",
84
+ "number"
85
+ ],
86
+ "title": "maxHeight"
87
+ },
88
+ "maxWidth": {
89
+ "description": "Indicates the max width of the authoring container",
90
+ "default": "undefined",
91
+ "type": [
92
+ "string",
93
+ "number"
94
+ ],
95
+ "title": "maxWidth"
96
+ },
97
+ "minHeight": {
98
+ "description": "Indicates the min height of the authoring container",
99
+ "default": "undefined",
100
+ "type": [
101
+ "string",
102
+ "number"
103
+ ],
104
+ "title": "minHeight"
105
+ },
106
+ "minWidth": {
107
+ "description": "Indicates the min width of the authoring container",
108
+ "default": "undefined",
109
+ "type": [
110
+ "string",
111
+ "number"
112
+ ],
113
+ "title": "minWidth"
114
+ }
115
+ },
116
+ "title": "contentDimensions"
117
+ },
118
+ "settingsPartialScoring": {
119
+ "description": "Indicates whether the settings panel wil allow the author to modify settings for partial scoring",
120
+ "default": true,
121
+ "type": "boolean",
122
+ "title": "settingsPartialScoring"
123
+ }
124
+ },
125
+ "definitions": {
126
+ "ConfigureProp": {
127
+ "title": "ConfigureProp",
128
+ "type": "object",
129
+ "properties": {
130
+ "settings": {
131
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
132
+ "type": "boolean",
133
+ "title": "settings"
134
+ },
135
+ "label": {
136
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
137
+ "type": "string",
138
+ "title": "label"
139
+ }
140
+ }
141
+ },
142
+ "ConfigureMathMLProp": {
143
+ "title": "ConfigureMathMLProp",
144
+ "type": "object",
145
+ "properties": {
146
+ "mmlOutput": {
147
+ "description": "Indicates if model should have mathML output instead of latex",
148
+ "type": "number",
149
+ "title": "mmlOutput"
150
+ },
151
+ "mmlEditing": {
152
+ "description": "Indicates if mathML that's already in model should be editable",
153
+ "type": "number",
154
+ "title": "mmlEditing"
155
+ }
156
+ }
157
+ }
158
+ },
159
+ "$schema": "http://json-schema.org/draft-07/schema#"
160
+ }
@@ -0,0 +1,127 @@
1
+ The schema defines the following properties:
2
+
3
+ # `settingsPanelDisabled` (boolean)
4
+
5
+ Indicates if the settings panel is not available
6
+
7
+ # `showExcludeZero` (object)
8
+
9
+ Properties of the `showExcludeZero` object:
10
+
11
+ ## `settings` (boolean)
12
+
13
+ Indicates if the item has to be displayed in the Settings Panel
14
+
15
+ ## `label` (string)
16
+
17
+ Indicates the label for the item that has to be displayed in the Settings Panel
18
+
19
+ # `showMaxPoint` (object)
20
+
21
+ Properties of the `showMaxPoint` object:
22
+
23
+ ## `settings` (boolean)
24
+
25
+ Indicates if the item has to be displayed in the Settings Panel
26
+
27
+ ## `label` (string)
28
+
29
+ Indicates the label for the item that has to be displayed in the Settings Panel
30
+
31
+ # `width` (string)
32
+
33
+ How large can the rubric be
34
+
35
+ # `mathMlOptions` (object)
36
+
37
+ Properties of the `mathMlOptions` object:
38
+
39
+ ## `mmlOutput` (number)
40
+
41
+ Indicates if model should have mathML output instead of latex
42
+
43
+ ## `mmlEditing` (number)
44
+
45
+ Indicates if mathML that's already in model should be editable
46
+
47
+ # `showPrompt` (boolean)
48
+
49
+ Determines whether prompt field will be displayed or not
50
+
51
+ Default: `true`
52
+
53
+ # `promptLabel` (string)
54
+
55
+ The label for the item stem/prompt field
56
+
57
+ Default: `"Item Stemm"`
58
+
59
+ # `contentDimensions` (object)
60
+
61
+ Indicates the dimensions configuration for the authoring container
62
+ Note: Some items have a default minimum width because of their content, but if
63
+ the minWidth is lower than this, the overflow behavior will take care of that
64
+
65
+ Properties of the `contentDimensions` object:
66
+
67
+ ## `maxHeight` (string,number)
68
+
69
+ Indicates the max height of the authoring container
70
+
71
+ Default: `"undefined"`
72
+
73
+ ## `maxWidth` (string,number)
74
+
75
+ Indicates the max width of the authoring container
76
+
77
+ Default: `"undefined"`
78
+
79
+ ## `minHeight` (string,number)
80
+
81
+ Indicates the min height of the authoring container
82
+
83
+ Default: `"undefined"`
84
+
85
+ ## `minWidth` (string,number)
86
+
87
+ Indicates the min width of the authoring container
88
+
89
+ Default: `"undefined"`
90
+
91
+ Default: `": {}"`
92
+
93
+ # `settingsPartialScoring` (boolean)
94
+
95
+ Indicates whether the settings panel wil allow the author to modify settings for partial scoring
96
+
97
+ Default: `true`
98
+
99
+ ---
100
+
101
+ # Sub Schemas
102
+
103
+ The schema defines the following additional types:
104
+
105
+ ## `ConfigureProp` (object)
106
+
107
+ Properties of the `ConfigureProp` object:
108
+
109
+ ### `settings` (boolean)
110
+
111
+ Indicates if the item has to be displayed in the Settings Panel
112
+
113
+ ### `label` (string)
114
+
115
+ Indicates the label for the item that has to be displayed in the Settings Panel
116
+
117
+ ## `ConfigureMathMLProp` (object)
118
+
119
+ Properties of the `ConfigureMathMLProp` object:
120
+
121
+ ### `mmlOutput` (number)
122
+
123
+ Indicates if model should have mathML output instead of latex
124
+
125
+ ### `mmlEditing` (number)
126
+
127
+ Indicates if mathML that's already in model should be editable
@@ -0,0 +1,8 @@
1
+ const { model } = require('./generate');
2
+
3
+ module.exports = {
4
+ elements: {
5
+ 'pie-rubric': '../..',
6
+ },
7
+ models: [model('1', 'pie-rubric')],
8
+ };
@@ -0,0 +1,8 @@
1
+ exports.model = (id, element) => ({
2
+ id,
3
+ element,
4
+ points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
5
+ sampleAnswers: [null, 'just right', 'not left', null],
6
+ maxPoints: 4,
7
+ excludeZero: false,
8
+ });
@@ -0,0 +1,2 @@
1
+ <p />
2
+ <pie-rubric pie-id="1"></pie-rubric>