@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
@@ -1,117 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import Radio from '@material-ui/core/Radio';
4
- import RadioGroup from '@material-ui/core/RadioGroup';
5
- import { withStyles } from '@material-ui/core/styles';
6
- import { FormControlLabel } from '@material-ui/core';
7
- import { RUBRIC_TYPES } from '@pie-lib/rubric';
8
-
9
- const styles = {
10
- rubric: {
11
- display: 'flex',
12
- flexDirection: 'column',
13
- padding: '16px 0 32px'
14
- }
15
- };
16
-
17
- export class Main extends React.Component {
18
- static propTypes = {
19
- classes: PropTypes.object,
20
- configuration: PropTypes.object,
21
- model: PropTypes.object,
22
- onModelChanged: PropTypes.func,
23
- onConfigurationChanged: PropTypes.func
24
- };
25
-
26
- onModelChanged = (model) => {
27
- const { onModelChanged } = this.props;
28
-
29
- return onModelChanged(model);
30
- }
31
-
32
- onChangeRubricType = (e) => {
33
- const { model } = this.props;
34
-
35
- const rubricType = e.target.value;
36
- this.onModelChanged({
37
- ...model,
38
- rubricType,
39
- });
40
- };
41
-
42
- render() {
43
- const {
44
- classes,
45
- model,
46
- configuration
47
- } = this.props;
48
- const { rubricType, rubrics = {} } = model;
49
- const { multiTraitRubric } = configuration;
50
- let rubricTag = '';
51
-
52
- switch (rubricType) {
53
- case RUBRIC_TYPES.SIMPLE_RUBRIC:
54
- default:
55
- rubricTag = <rubric-configure
56
- id="simpleRubric"
57
- key="simple-rubric"
58
- ref={ref => {
59
- if (ref) {
60
- this.simpleRubric = ref;
61
- this.simpleRubric.model = rubrics.simpleRubric;
62
- }
63
- }}
64
- />;
65
- break;
66
- case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:
67
- rubricTag = <multi-trait-rubric-configure
68
- id="multiTraitRubric"
69
- key="multi-trait-rubric"
70
- ref={ref => {
71
- if (ref) {
72
- this.multiTraitRubric = ref;
73
- this.multiTraitRubric.model = {
74
- ...rubrics.multiTraitRubric
75
- };
76
- this.multiTraitRubric.configuration = multiTraitRubric;
77
- }
78
- }}
79
- />;
80
- break;
81
- }
82
-
83
- return (
84
- <div className={classes.design}>
85
- <div>
86
- <div>
87
- <RadioGroup
88
- aria-label='rubric-type'
89
- name='rubricType'
90
- value={rubricType}
91
- defaultValue={RUBRIC_TYPES.SIMPLE_RUBRIC}
92
- onChange={this.onChangeRubricType}
93
- >
94
- <FormControlLabel
95
- value={RUBRIC_TYPES.SIMPLE_RUBRIC}
96
- control={<Radio/>}
97
- checked={rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC}
98
- label='Simple Rubric'
99
- />
100
- <FormControlLabel
101
- value={RUBRIC_TYPES.MULTI_TRAIT_RUBRIC}
102
- control={<Radio/>}
103
- checked={rubricType === RUBRIC_TYPES.MULTI_TRAIT_RUBRIC}
104
- label='Multi Trait Rubric'
105
- />
106
- </RadioGroup>
107
- </div>
108
- <div>
109
- {rubricTag}
110
- </div>
111
- </div>
112
- </div>
113
- );
114
- }
115
- }
116
-
117
- export default withStyles(styles)(Main);
@@ -1,99 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var multiTraitDefaultModel = {
8
- visibleToStudent: true,
9
- halfScoring: false,
10
- pointLabels: true,
11
- description: false,
12
- standards: false,
13
- scales: [],
14
- excludeZero: false
15
- };
16
- var rubricDefaultModel = {
17
- points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
18
- sampleAnswers: [null, 'just right', 'not left', null],
19
- maxPoints: 4,
20
- excludeZero: false
21
- };
22
- var multiTraitDefaultConfiguration = {
23
- settingsPanelDisabled: true,
24
- excludeZeroDialogBoxContent: {
25
- title: 'Exclude 0 (Zero) from Score Point Values.',
26
- text: "<div>\n You are about to exclude 0 from score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the left\n </li>\n <li>\n remove 0 column with its Label and Description\n </li>\n </ul>\n </div>"
27
- },
28
- includeZeroDialogBoxContent: {
29
- title: 'Include 0 (Zero) in Score Point Values.',
30
- text: "<div>\n You are about to include 0 in score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the right\n </li>\n <li>\n add 0 column with empty Label and Descriptions\n </li>\n </ul>\n </div>"
31
- },
32
- deleteTraitDialogBoxContent: {
33
- title: 'Delete Trait',
34
- text: 'Are you sure you want to delete this trait?'
35
- },
36
- deleteScaleDialogBoxContent: {
37
- title: 'Delete Scale',
38
- text: 'Are you sure you want to delete this scale?'
39
- },
40
- maxPointsDialogBoxContent: {
41
- title: 'Decreasing Max Points.',
42
- text: " You are about to decrease max score point value.\n <br/>\n All the Labels and Descriptions for scores above Max Point will be deleted."
43
- },
44
- spellCheck: {
45
- label: 'Spellcheck',
46
- settings: false,
47
- enabled: true
48
- },
49
- showExcludeZero: {
50
- settings: true,
51
- label: 'Exclude Zero'
52
- },
53
- showScorePointLabels: {
54
- settings: true,
55
- label: 'Show Score Point Labels'
56
- },
57
- showDescription: {
58
- settings: true,
59
- label: 'Show Description'
60
- },
61
- showVisibleToStudent: {
62
- settings: true,
63
- label: 'Visible to Student'
64
- },
65
- showHalfScoring: {
66
- settings: true,
67
- label: 'Half Scoring'
68
- },
69
- width: '900px',
70
- // these should not be set to true (should not be used) for now
71
- showStandards: {
72
- settings: false,
73
- label: 'Show Standards'
74
- },
75
- showLevelTagInput: {
76
- settings: false,
77
- label: 'Show Level Tag Input',
78
- enabled: false
79
- },
80
- dragAndDrop: {
81
- settings: true,
82
- label: 'Enable Drag and Drop',
83
- enabled: false
84
- }
85
- };
86
- var _default = {
87
- model: {
88
- rubricType: 'simpleRubric',
89
- rubrics: {
90
- simpleRubric: rubricDefaultModel,
91
- multiTraitRubric: multiTraitDefaultModel
92
- }
93
- },
94
- configuration: {
95
- multiTraitRubric: multiTraitDefaultConfiguration
96
- }
97
- };
98
- exports["default"] = _default;
99
- //# sourceMappingURL=defaults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["multiTraitDefaultModel","visibleToStudent","halfScoring","pointLabels","description","standards","scales","excludeZero","rubricDefaultModel","points","sampleAnswers","maxPoints","multiTraitDefaultConfiguration","settingsPanelDisabled","excludeZeroDialogBoxContent","title","text","includeZeroDialogBoxContent","deleteTraitDialogBoxContent","deleteScaleDialogBoxContent","maxPointsDialogBoxContent","spellCheck","label","settings","enabled","showExcludeZero","showScorePointLabels","showDescription","showVisibleToStudent","showHalfScoring","width","showStandards","showLevelTagInput","dragAndDrop","model","rubricType","rubrics","simpleRubric","multiTraitRubric","configuration"],"mappings":";;;;;;AAAA,IAAMA,sBAAsB,GAAG;AAC7BC,EAAAA,gBAAgB,EAAE,IADW;AAE7BC,EAAAA,WAAW,EAAE,KAFgB;AAG7BC,EAAAA,WAAW,EAAE,IAHgB;AAI7BC,EAAAA,WAAW,EAAE,KAJgB;AAK7BC,EAAAA,SAAS,EAAE,KAL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,IADU;AAEpBD,IAAAA,KAAK,EAAE;AAFa,GA7De;AAiErCK,EAAAA,eAAe,EAAE;AACfJ,IAAAA,QAAQ,EAAE,IADK;AAEfD,IAAAA,KAAK,EAAE;AAFQ,GAjEoB;AAqErCM,EAAAA,oBAAoB,EAAE;AACpBL,IAAAA,QAAQ,EAAE,IADU;AAEpBD,IAAAA,KAAK,EAAE;AAFa,GArEe;AAyErCO,EAAAA,eAAe,EAAE;AACfN,IAAAA,QAAQ,EAAE,IADK;AAEfD,IAAAA,KAAK,EAAE;AAFQ,GAzEoB;AA6ErCQ,EAAAA,KAAK,EAAE,OA7E8B;AA8ErC;AACAC,EAAAA,aAAa,EAAE;AACbR,IAAAA,QAAQ,EAAE,KADG;AAEbD,IAAAA,KAAK,EAAE;AAFM,GA/EsB;AAmFrCU,EAAAA,iBAAiB,EAAE;AACjBT,IAAAA,QAAQ,EAAE,KADO;AAEjBD,IAAAA,KAAK,EAAE,sBAFU;AAGjBE,IAAAA,OAAO,EAAE;AAHQ,GAnFkB;AAwFrCS,EAAAA,WAAW,EAAE;AACXV,IAAAA,QAAQ,EAAE,IADC;AAEXD,IAAAA,KAAK,EAAE,sBAFI;AAGXE,IAAAA,OAAO,EAAE;AAHE;AAxFwB,CAAvC;eA+Fe;AACbU,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAE,cADP;AAELC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,YAAY,EAAE7B,kBAAhB;AAAoC8B,MAAAA,gBAAgB,EAAEtC;AAAtD;AAFJ,GADM;AAKbuC,EAAAA,aAAa,EAAE;AACbD,IAAAA,gBAAgB,EAAE1B;AADL;AALF,C","sourcesContent":["const multiTraitDefaultModel = {\n visibleToStudent: true,\n halfScoring: false,\n pointLabels: true,\n description: false,\n standards: false,\n scales: [],\n excludeZero: false,\n};\n\nconst rubricDefaultModel = {\n points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],\n sampleAnswers: [null, 'just right', 'not left', null],\n maxPoints: 4,\n excludeZero: false\n};\n\nconst multiTraitDefaultConfiguration = {\n settingsPanelDisabled: true,\n excludeZeroDialogBoxContent: {\n title: 'Exclude 0 (Zero) from Score Point Values.',\n text: `<div>\n You are about to exclude 0 from score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the left\n </li>\n <li>\n remove 0 column with its Label and Description\n </li>\n </ul>\n </div>`\n },\n includeZeroDialogBoxContent: {\n title: 'Include 0 (Zero) in Score Point Values.',\n text: `<div>\n You are about to include 0 in score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the right\n </li>\n <li>\n add 0 column with empty Label and Descriptions\n </li>\n </ul>\n </div>`\n },\n deleteTraitDialogBoxContent: {\n title: 'Delete Trait',\n text: 'Are you sure you want to delete this trait?'\n },\n deleteScaleDialogBoxContent: {\n title: 'Delete Scale',\n text: 'Are you sure you want to delete this scale?'\n },\n maxPointsDialogBoxContent: {\n title: 'Decreasing Max Points.',\n text: ` You are about to decrease max score point value.\n <br/>\n All the Labels and Descriptions for scores above Max Point will be deleted.`\n },\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true\n },\n showExcludeZero: {\n settings: true,\n label: 'Exclude Zero',\n },\n showScorePointLabels: {\n settings: true,\n label: 'Show Score Point Labels',\n },\n showDescription: {\n settings: true,\n label: 'Show Description',\n },\n showVisibleToStudent: {\n settings: true,\n label: 'Visible to Student',\n },\n showHalfScoring: {\n settings: true,\n label: 'Half Scoring',\n },\n width: '900px',\n // these should not be set to true (should not be used) for now\n showStandards: {\n settings: false,\n label: 'Show Standards',\n },\n showLevelTagInput: {\n settings: false,\n label: 'Show Level Tag Input',\n enabled: false\n },\n dragAndDrop: {\n settings: true,\n label: 'Enable Drag and Drop',\n enabled: false,\n }\n};\n\nexport default {\n model: {\n rubricType: 'simpleRubric',\n rubrics: { simpleRubric: rubricDefaultModel, multiTraitRubric: multiTraitDefaultModel }\n },\n configuration: {\n multiTraitRubric: multiTraitDefaultConfiguration\n }\n};\n"],"file":"defaults.js"}
@@ -1,147 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createCorrectResponseSession = void 0;
9
- exports.createDefaultModel = createDefaultModel;
10
- exports.getScore = void 0;
11
- exports.model = model;
12
- exports.normalize = void 0;
13
- exports.outcome = outcome;
14
-
15
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
16
-
17
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
18
-
19
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
20
-
21
- var _defaults = _interopRequireDefault(require("./defaults"));
22
-
23
- var _rubric = require("@pie-lib/rubric");
24
-
25
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
-
27
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
-
29
- function createDefaultModel() {
30
- var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
31
- return new Promise(function (resolve) {
32
- return resolve(_objectSpread(_objectSpread({}, _defaults["default"].model), model));
33
- });
34
- }
35
-
36
- var normalize = function normalize(question) {
37
- return _objectSpread(_objectSpread({}, _defaults["default"].model), question);
38
- };
39
- /**
40
- *
41
- * @param {*} question
42
- * @param {*} session
43
- * @param {*} env
44
- */
45
-
46
-
47
- exports.normalize = normalize;
48
-
49
- function model(_x, _x2, _x3) {
50
- return _model.apply(this, arguments);
51
- }
52
-
53
- function _model() {
54
- _model = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(question, session, env) {
55
- var normalizedQuestion, _ref, scales, excludeZero, parsedScales;
56
-
57
- return _regenerator["default"].wrap(function _callee$(_context) {
58
- while (1) {
59
- switch (_context.prev = _context.next) {
60
- case 0:
61
- normalizedQuestion = normalize(question);
62
-
63
- if (!(normalizedQuestion.rubricType === _rubric.RUBRIC_TYPES.SIMPLE_RUBRIC)) {
64
- _context.next = 5;
65
- break;
66
- }
67
-
68
- return _context.abrupt("return", new Promise(function (resolve) {
69
- resolve(env && env.role && env.role === 'instructor' ? _objectSpread(_objectSpread({}, normalizedQuestion), {}, {
70
- rubrics: _objectSpread(_objectSpread({}, normalizedQuestion.rubrics), {}, {
71
- multiTraitRubric: _objectSpread(_objectSpread({}, normalizedQuestion.rubrics.multiTraitRubric), {}, {
72
- visible: false
73
- })
74
- })
75
- }) : {});
76
- }));
77
-
78
- case 5:
79
- if (!env.role || env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric) {
80
- normalizedQuestion.rubrics.multiTraitRubric.visible = normalizedQuestion.visibleToStudent;
81
- } else {
82
- normalizedQuestion.rubrics.multiTraitRubric.visible = true;
83
- } // todo update pie-ui instead of parsing this here:
84
-
85
-
86
- _ref = normalizedQuestion.rubrics.multiTraitRubric || {}, scales = _ref.scales, excludeZero = _ref.excludeZero;
87
- parsedScales = (scales || []).map(function (scale) {
88
- return _objectSpread(_objectSpread({}, scale), {}, {
89
- excludeZero: excludeZero
90
- });
91
- });
92
- return _context.abrupt("return", _objectSpread(_objectSpread({}, normalizedQuestion), {}, {
93
- rubrics: _objectSpread(_objectSpread({}, normalizedQuestion.rubrics), {}, {
94
- simpleRubric: _objectSpread(_objectSpread({}, normalizedQuestion.rubrics.simpleRubric), {}, {
95
- visible: false
96
- }),
97
- multiTraitRubric: _objectSpread(_objectSpread({}, normalizedQuestion.rubrics.multiTraitRubric), {}, {
98
- scales: parsedScales
99
- })
100
- })
101
- }));
102
-
103
- case 9:
104
- case "end":
105
- return _context.stop();
106
- }
107
- }
108
- }, _callee);
109
- }));
110
- return _model.apply(this, arguments);
111
- }
112
-
113
- var getScore = function getScore() {
114
- return 0;
115
- };
116
- /**
117
- * @param {Object} model - the main model
118
- * @param {*} session
119
- * @param {Object} env
120
- */
121
-
122
-
123
- exports.getScore = getScore;
124
-
125
- function outcome(model, session, env) {
126
- return new Promise(function (resolve) {
127
- return resolve({
128
- score: 0,
129
- empty: true
130
- });
131
- });
132
- }
133
-
134
- var createCorrectResponseSession = function createCorrectResponseSession(question, env) {
135
- return new Promise(function (resolve) {
136
- if (env.mode !== 'evaluate' && env.role === 'instructor') {
137
- resolve({
138
- id: '1'
139
- });
140
- } else {
141
- resolve(null);
142
- }
143
- });
144
- };
145
-
146
- exports.createCorrectResponseSession = createCorrectResponseSession;
147
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["createDefaultModel","model","Promise","resolve","defaults","normalize","question","session","env","normalizedQuestion","rubricType","RUBRIC_TYPES","SIMPLE_RUBRIC","role","rubrics","multiTraitRubric","visible","visibleToStudent","scales","excludeZero","parsedScales","map","scale","simpleRubric","getScore","outcome","score","empty","createCorrectResponseSession","mode","id"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEO,SAASA,kBAAT,GAAwC;AAAA,MAAZC,KAAY,uEAAJ,EAAI;AAC7C,SAAO,IAAIC,OAAJ,CAAY,UAAAC,OAAO;AAAA,WAAIA,OAAO,iCAAMC,qBAASH,KAAf,GAAyBA,KAAzB,EAAX;AAAA,GAAnB,C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EO;AACL3B,MAAAA,OAAO,CAAC,IAAD,CAAP;AACD;AACF,GANM,CAAP;AAOD,CARM","sourcesContent":["import defaults from './defaults';\nimport { RUBRIC_TYPES } from '@pie-lib/rubric';\n\nexport function createDefaultModel(model = {}) {\n return new Promise(resolve => resolve({ ...defaults.model, ...model }));\n}\n\nexport const normalize = question => ({ ...defaults.model, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n if (normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC) {\n return new Promise(resolve => {\n resolve((env && env.role && env.role === 'instructor') ?\n {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n visible: false\n }\n }\n }\n : {});\n });\n } else {\n if (!env.role || env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric) {\n normalizedQuestion.rubrics.multiTraitRubric.visible = normalizedQuestion.visibleToStudent;\n } else {\n normalizedQuestion.rubrics.multiTraitRubric.visible = true;\n }\n\n // todo update pie-ui instead of parsing this here:\n const { scales, excludeZero } = normalizedQuestion.rubrics.multiTraitRubric || {};\n const parsedScales = (scales || []).map(scale => ({ ...scale, excludeZero }));\n\n return {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n simpleRubric: {\n ...normalizedQuestion.rubrics.simpleRubric,\n visible: false\n },\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n scales: parsedScales\n }\n }\n };\n }\n}\n\nexport const getScore = () => 0;\n\n/**\n * @param {Object} model - the main model\n * @param {*} session\n * @param {Object} env\n */\nexport function outcome(model, session, env) {\n return new Promise(resolve => resolve({ score: 0, empty: true }));\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise(resolve => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n"],"file":"index.js"}
@@ -1,12 +0,0 @@
1
- {
2
- "name": "@pie-element/complex-rubric-controller",
3
- "private": true,
4
- "version": "0.0.1",
5
- "main": "lib/index.js",
6
- "scripts": {
7
- "test": "./node_modules/.bin/jest"
8
- },
9
- "dependencies": {
10
- "@pie-lib/rubric": "^0.4.39"
11
- }
12
- }
@@ -1,58 +0,0 @@
1
- import { model } from '../index';
2
- import defaultModel from '../defaults';
3
-
4
- jest.mock('@pie-lib/rubric', () => ({
5
- RUBRIC_TYPES: {
6
- SIMPLE_RUBRIC: 'simpleRubric',
7
- MULTI_TRAIT_RUBRIC: 'multiTraitRubric'
8
- }
9
- }));
10
-
11
- describe('complex rubric model', () => {
12
- let state = { ...defaultModel.model };
13
- let session = {};
14
- let env, result;
15
-
16
- it('returns no model for gather', async () => {
17
- env = { mode: 'gather' };
18
- result = await model(state, session, env);
19
- expect(result).toEqual({});
20
- });
21
-
22
- it('returns no model for student role', async () => {
23
- env = { mode: 'gather', role: 'student' };
24
- result = await model(state, session, env);
25
- expect(result).toEqual({});
26
- });
27
-
28
- it('returns model for instructor role and simple rubric', async () => {
29
- env = { mode: 'gather', role: 'instructor' };
30
- result = await model(state, session, env);
31
- expect(result).toEqual({
32
- ...state,
33
- rubrics: {
34
- ...state.rubrics,
35
- multiTraitRubric: {
36
- ...state.rubrics.multiTraitRubric,
37
- visible: false
38
- }
39
- }
40
- });
41
- });
42
-
43
- it('returns model for instructor role and multi trait rubric', async () => {
44
- env = { mode: 'gather', role: 'instructor' };
45
- result = await model({ ...state, rubricType: 'multiTraitRubric' }, session, env);
46
- expect(result).toEqual({
47
- ...state,
48
- rubricType: 'multiTraitRubric',
49
- rubrics: {
50
- ...state.rubrics,
51
- simpleRubric: {
52
- ...state.rubrics.simpleRubric,
53
- visible: false
54
- }
55
- }
56
- });
57
- });
58
- });
@@ -1,121 +0,0 @@
1
- const multiTraitDefaultModel = {
2
- visibleToStudent: true,
3
- halfScoring: false,
4
- pointLabels: true,
5
- description: false,
6
- standards: false,
7
- scales: [],
8
- excludeZero: false,
9
- };
10
-
11
- const rubricDefaultModel = {
12
- points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
13
- sampleAnswers: [null, 'just right', 'not left', null],
14
- maxPoints: 4,
15
- excludeZero: false
16
- };
17
-
18
- const multiTraitDefaultConfiguration = {
19
- settingsPanelDisabled: true,
20
- excludeZeroDialogBoxContent: {
21
- title: 'Exclude 0 (Zero) from Score Point Values.',
22
- text: `<div>
23
- You are about to exclude 0 from score point values.
24
- <br/>
25
- Some of the existing data has to be changed.
26
- <br/>
27
- Please choose if you want to:
28
- <ul>
29
- <li>
30
- shift Labels and Descriptions to the left
31
- </li>
32
- <li>
33
- remove 0 column with its Label and Description
34
- </li>
35
- </ul>
36
- </div>`
37
- },
38
- includeZeroDialogBoxContent: {
39
- title: 'Include 0 (Zero) in Score Point Values.',
40
- text: `<div>
41
- You are about to include 0 in score point values.
42
- <br/>
43
- Some of the existing data has to be changed.
44
- <br/>
45
- Please choose if you want to:
46
- <ul>
47
- <li>
48
- shift Labels and Descriptions to the right
49
- </li>
50
- <li>
51
- add 0 column with empty Label and Descriptions
52
- </li>
53
- </ul>
54
- </div>`
55
- },
56
- deleteTraitDialogBoxContent: {
57
- title: 'Delete Trait',
58
- text: 'Are you sure you want to delete this trait?'
59
- },
60
- deleteScaleDialogBoxContent: {
61
- title: 'Delete Scale',
62
- text: 'Are you sure you want to delete this scale?'
63
- },
64
- maxPointsDialogBoxContent: {
65
- title: 'Decreasing Max Points.',
66
- text: ` You are about to decrease max score point value.
67
- <br/>
68
- All the Labels and Descriptions for scores above Max Point will be deleted.`
69
- },
70
- spellCheck: {
71
- label: 'Spellcheck',
72
- settings: false,
73
- enabled: true
74
- },
75
- showExcludeZero: {
76
- settings: true,
77
- label: 'Exclude Zero',
78
- },
79
- showScorePointLabels: {
80
- settings: true,
81
- label: 'Show Score Point Labels',
82
- },
83
- showDescription: {
84
- settings: true,
85
- label: 'Show Description',
86
- },
87
- showVisibleToStudent: {
88
- settings: true,
89
- label: 'Visible to Student',
90
- },
91
- showHalfScoring: {
92
- settings: true,
93
- label: 'Half Scoring',
94
- },
95
- width: '900px',
96
- // these should not be set to true (should not be used) for now
97
- showStandards: {
98
- settings: false,
99
- label: 'Show Standards',
100
- },
101
- showLevelTagInput: {
102
- settings: false,
103
- label: 'Show Level Tag Input',
104
- enabled: false
105
- },
106
- dragAndDrop: {
107
- settings: true,
108
- label: 'Enable Drag and Drop',
109
- enabled: false,
110
- }
111
- };
112
-
113
- export default {
114
- model: {
115
- rubricType: 'simpleRubric',
116
- rubrics: { simpleRubric: rubricDefaultModel, multiTraitRubric: multiTraitDefaultModel }
117
- },
118
- configuration: {
119
- multiTraitRubric: multiTraitDefaultConfiguration
120
- }
121
- };
@@ -1,81 +0,0 @@
1
- import defaults from './defaults';
2
- import { RUBRIC_TYPES } from '@pie-lib/rubric';
3
-
4
- export function createDefaultModel(model = {}) {
5
- return new Promise(resolve => resolve({ ...defaults.model, ...model }));
6
- }
7
-
8
- export const normalize = question => ({ ...defaults.model, ...question });
9
-
10
- /**
11
- *
12
- * @param {*} question
13
- * @param {*} session
14
- * @param {*} env
15
- */
16
- export async function model(question, session, env) {
17
- const normalizedQuestion = normalize(question);
18
-
19
- if (normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC) {
20
- return new Promise(resolve => {
21
- resolve((env && env.role && env.role === 'instructor') ?
22
- {
23
- ...normalizedQuestion,
24
- rubrics: {
25
- ...normalizedQuestion.rubrics,
26
- multiTraitRubric: {
27
- ...normalizedQuestion.rubrics.multiTraitRubric,
28
- visible: false
29
- }
30
- }
31
- }
32
- : {});
33
- });
34
- } else {
35
- if (!env.role || env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric) {
36
- normalizedQuestion.rubrics.multiTraitRubric.visible = normalizedQuestion.visibleToStudent;
37
- } else {
38
- normalizedQuestion.rubrics.multiTraitRubric.visible = true;
39
- }
40
-
41
- // todo update pie-ui instead of parsing this here:
42
- const { scales, excludeZero } = normalizedQuestion.rubrics.multiTraitRubric || {};
43
- const parsedScales = (scales || []).map(scale => ({ ...scale, excludeZero }));
44
-
45
- return {
46
- ...normalizedQuestion,
47
- rubrics: {
48
- ...normalizedQuestion.rubrics,
49
- simpleRubric: {
50
- ...normalizedQuestion.rubrics.simpleRubric,
51
- visible: false
52
- },
53
- multiTraitRubric: {
54
- ...normalizedQuestion.rubrics.multiTraitRubric,
55
- scales: parsedScales
56
- }
57
- }
58
- };
59
- }
60
- }
61
-
62
- export const getScore = () => 0;
63
-
64
- /**
65
- * @param {Object} model - the main model
66
- * @param {*} session
67
- * @param {Object} env
68
- */
69
- export function outcome(model, session, env) {
70
- return new Promise(resolve => resolve({ score: 0, empty: true }));
71
- }
72
-
73
- export const createCorrectResponseSession = (question, env) => {
74
- return new Promise(resolve => {
75
- if (env.mode !== 'evaluate' && env.role === 'instructor') {
76
- resolve({ id: '1' });
77
- } else {
78
- resolve(null);
79
- }
80
- });
81
- };