@pie-element/complex-rubric 2.10.1-next.11 → 2.10.1-next.12

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 (115) hide show
  1. package/configure/package.json +2 -2
  2. package/controller/package.json +1 -1
  3. package/module/configure.js +233613 -0
  4. package/module/controller.js +379 -0
  5. package/module/demo.js +221 -0
  6. package/module/element.js +231245 -0
  7. package/module/index.html +21 -0
  8. package/module/manifest.json +14 -0
  9. package/module/print-demo.js +259 -0
  10. package/module/print.html +18 -0
  11. package/module/print.js +231217 -0
  12. package/package.json +4 -4
  13. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.json +0 -1
  14. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.md +0 -1383
  15. package/configure/node_modules/@pie-element/multi-trait-rubric/LICENSE.md +0 -5
  16. package/configure/node_modules/@pie-element/multi-trait-rubric/README.md +0 -55
  17. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.json +0 -1
  18. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.md +0 -1270
  19. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js +0 -584
  20. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js.map +0 -1
  21. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js +0 -143
  22. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js.map +0 -1
  23. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js +0 -204
  24. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js.map +0 -1
  25. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js +0 -602
  26. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js.map +0 -1
  27. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js +0 -361
  28. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js.map +0 -1
  29. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js +0 -556
  30. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js.map +0 -1
  31. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js +0 -380
  32. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js.map +0 -1
  33. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js +0 -296
  34. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js.map +0 -1
  35. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js +0 -14
  36. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js.map +0 -1
  37. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/package.json +0 -18
  38. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.json +0 -1
  39. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.md +0 -544
  40. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js +0 -94
  41. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js.map +0 -1
  42. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js +0 -215
  43. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js.map +0 -1
  44. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js +0 -13
  45. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js.map +0 -1
  46. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/package.json +0 -15
  47. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json +0 -803
  48. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json.md +0 -602
  49. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/config.js +0 -8
  50. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/generate.js +0 -180
  51. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/index.html +0 -1
  52. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/session.js +0 -6
  53. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json +0 -531
  54. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json.md +0 -374
  55. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js +0 -85
  56. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js.map +0 -1
  57. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js +0 -161
  58. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js.map +0 -1
  59. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js +0 -330
  60. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js.map +0 -1
  61. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js +0 -103
  62. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js.map +0 -1
  63. package/configure/node_modules/@pie-element/multi-trait-rubric/package.json +0 -24
  64. package/configure/node_modules/@pie-element/rubric/CHANGELOG.json +0 -257
  65. package/configure/node_modules/@pie-element/rubric/CHANGELOG.md +0 -1640
  66. package/configure/node_modules/@pie-element/rubric/LICENSE.md +0 -5
  67. package/configure/node_modules/@pie-element/rubric/README.md +0 -3
  68. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +0 -197
  69. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.md +0 -1471
  70. package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js +0 -59
  71. package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js.map +0 -1
  72. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js +0 -194
  73. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js.map +0 -1
  74. package/configure/node_modules/@pie-element/rubric/configure/lib/main.js +0 -160
  75. package/configure/node_modules/@pie-element/rubric/configure/lib/main.js.map +0 -1
  76. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js +0 -555
  77. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js.map +0 -1
  78. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js +0 -24
  79. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js.map +0 -1
  80. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js +0 -172
  81. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js.map +0 -1
  82. package/configure/node_modules/@pie-element/rubric/configure/package.json +0 -17
  83. package/configure/node_modules/@pie-element/rubric/configure/src/__tests__/index.test.jsx +0 -173
  84. package/configure/node_modules/@pie-element/rubric/configure/src/defaults.js +0 -39
  85. package/configure/node_modules/@pie-element/rubric/configure/src/index.js +0 -127
  86. package/configure/node_modules/@pie-element/rubric/configure/src/main.jsx +0 -87
  87. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/authoring.jsx +0 -427
  88. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/index.js +0 -9
  89. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/point-menu.jsx +0 -94
  90. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.json +0 -17
  91. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.md +0 -536
  92. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +0 -51
  93. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js.map +0 -1
  94. package/configure/node_modules/@pie-element/rubric/controller/package.json +0 -13
  95. package/configure/node_modules/@pie-element/rubric/controller/src/__tests__/index.test.js +0 -31
  96. package/configure/node_modules/@pie-element/rubric/controller/src/index.js +0 -42
  97. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json +0 -382
  98. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json.md +0 -292
  99. package/configure/node_modules/@pie-element/rubric/docs/demo/config.js +0 -8
  100. package/configure/node_modules/@pie-element/rubric/docs/demo/generate.js +0 -8
  101. package/configure/node_modules/@pie-element/rubric/docs/demo/index.html +0 -2
  102. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json +0 -226
  103. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json.md +0 -161
  104. package/configure/node_modules/@pie-element/rubric/lib/index.js +0 -88
  105. package/configure/node_modules/@pie-element/rubric/lib/index.js.map +0 -1
  106. package/configure/node_modules/@pie-element/rubric/lib/main.js +0 -187
  107. package/configure/node_modules/@pie-element/rubric/lib/main.js.map +0 -1
  108. package/configure/node_modules/@pie-element/rubric/lib/print.js +0 -114
  109. package/configure/node_modules/@pie-element/rubric/lib/print.js.map +0 -1
  110. package/configure/node_modules/@pie-element/rubric/package.json +0 -26
  111. package/configure/node_modules/@pie-element/rubric/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -23003
  112. package/configure/node_modules/@pie-element/rubric/src/__tests__/rubric-view.test.jsx +0 -50
  113. package/configure/node_modules/@pie-element/rubric/src/index.js +0 -34
  114. package/configure/node_modules/@pie-element/rubric/src/main.jsx +0 -136
  115. package/configure/node_modules/@pie-element/rubric/src/print.js +0 -63
@@ -1,226 +0,0 @@
1
- {
2
- "description": "Model for the RubricPie Interaction",
3
- "additionalProperties": false,
4
- "type": "object",
5
- "properties": {
6
- "points": {
7
- "description": "Indicates the score points labels. Starting from 0 to max",
8
- "type": "array",
9
- "items": {
10
- "description": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.",
11
- "type": "object",
12
- "additionalProperties": false,
13
- "patternProperties": {
14
- "^[0-9]+$": {
15
- "type": "string"
16
- }
17
- }
18
- },
19
- "title": "points"
20
- },
21
- "sampleAnswers": {
22
- "description": "Indicates the sample answers labels. Starting from 0 to max",
23
- "type": "array",
24
- "items": {
25
- "description": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.",
26
- "type": "object",
27
- "additionalProperties": false,
28
- "patternProperties": {
29
- "^[0-9]+$": {
30
- "type": "string"
31
- }
32
- }
33
- },
34
- "title": "sampleAnswers"
35
- },
36
- "maxPoints": {
37
- "description": "Indicates the max limit for scoring points",
38
- "type": "number",
39
- "title": "maxPoints"
40
- },
41
- "excludeZeros": {
42
- "description": "Indicates if point 0 should be shown",
43
- "type": "boolean",
44
- "title": "excludeZeros"
45
- },
46
- "id": {
47
- "description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.",
48
- "type": "string",
49
- "title": "id"
50
- },
51
- "element": {
52
- "description": "The html Element tag name",
53
- "type": "string",
54
- "title": "element"
55
- }
56
- },
57
- "required": [
58
- "element",
59
- "id"
60
- ],
61
- "definitions": {
62
- "EditableHtmlConfigureProp": {
63
- "title": "EditableHtmlConfigureProp",
64
- "type": "object",
65
- "properties": {
66
- "math": {
67
- "title": "EditableHtmlButtonConfigure",
68
- "type": "object",
69
- "properties": {
70
- "disabled": {
71
- "description": "Indicates if the plugin is disabled or not",
72
- "type": "boolean",
73
- "title": "disabled"
74
- }
75
- }
76
- },
77
- "audio": {
78
- "title": "EditableHtmlButtonConfigure",
79
- "type": "object",
80
- "properties": {
81
- "disabled": {
82
- "description": "Indicates if the plugin is disabled or not",
83
- "type": "boolean",
84
- "title": "disabled"
85
- }
86
- }
87
- },
88
- "video": {
89
- "title": "EditableHtmlButtonConfigure",
90
- "type": "object",
91
- "properties": {
92
- "disabled": {
93
- "description": "Indicates if the plugin is disabled or not",
94
- "type": "boolean",
95
- "title": "disabled"
96
- }
97
- }
98
- },
99
- "image": {
100
- "title": "EditableHtmlButtonConfigure",
101
- "type": "object",
102
- "properties": {
103
- "disabled": {
104
- "description": "Indicates if the plugin is disabled or not",
105
- "type": "boolean",
106
- "title": "disabled"
107
- }
108
- }
109
- },
110
- "customPlugins": {
111
- "description": "An array of objects that determine custom plugins.\nA custom plugin is an object which determines how the button will look like (icon) and the event name that will be triggered when button gets pressed (event).\nExample can be found at https://github.com/pie-framework/pie-lib/blob/develop/packages/demo/pages/editable-html.js#L425.",
112
- "type": "array",
113
- "items": {
114
- "title": "CustomPlugin",
115
- "type": "object",
116
- "properties": {
117
- "event": {
118
- "description": "The name of the custom event. It needs to be valid (only letters, numbers and \"_\" can be used).\nPIE will emit the event prefixed with \"PIE-\".\nEg: event = 'client_custom_event_A' => the emitted event will be \"PIE-client_custom_event_A\"",
119
- "type": "string",
120
- "title": "event"
121
- },
122
- "iconAlt": {
123
- "description": "The alt for the custom button icon",
124
- "type": "string",
125
- "title": "iconAlt"
126
- },
127
- "iconType": {
128
- "description": "The icon type.\nCurrently, only \"SVG\" is supported.",
129
- "type": "string",
130
- "title": "iconType"
131
- },
132
- "icon": {
133
- "description": "The icon string. Currently, only \"SVG\" is supported, so it needs to be a valid svg.",
134
- "type": "string",
135
- "title": "icon"
136
- }
137
- },
138
- "required": [
139
- "event",
140
- "icon",
141
- "iconAlt",
142
- "iconType"
143
- ]
144
- },
145
- "title": "customPlugins"
146
- }
147
- }
148
- },
149
- "EditableHtmlButtonConfigure": {
150
- "title": "EditableHtmlButtonConfigure",
151
- "type": "object",
152
- "properties": {
153
- "disabled": {
154
- "description": "Indicates if the plugin is disabled or not",
155
- "type": "boolean",
156
- "title": "disabled"
157
- }
158
- }
159
- },
160
- "CustomPlugin": {
161
- "title": "CustomPlugin",
162
- "type": "object",
163
- "properties": {
164
- "event": {
165
- "description": "The name of the custom event. It needs to be valid (only letters, numbers and \"_\" can be used).\nPIE will emit the event prefixed with \"PIE-\".\nEg: event = 'client_custom_event_A' => the emitted event will be \"PIE-client_custom_event_A\"",
166
- "type": "string",
167
- "title": "event"
168
- },
169
- "iconAlt": {
170
- "description": "The alt for the custom button icon",
171
- "type": "string",
172
- "title": "iconAlt"
173
- },
174
- "iconType": {
175
- "description": "The icon type.\nCurrently, only \"SVG\" is supported.",
176
- "type": "string",
177
- "title": "iconType"
178
- },
179
- "icon": {
180
- "description": "The icon string. Currently, only \"SVG\" is supported, so it needs to be a valid svg.",
181
- "type": "string",
182
- "title": "icon"
183
- }
184
- },
185
- "required": [
186
- "event",
187
- "icon",
188
- "iconAlt",
189
- "iconType"
190
- ]
191
- },
192
- "ConfigureProp": {
193
- "title": "ConfigureProp",
194
- "type": "object",
195
- "properties": {
196
- "settings": {
197
- "description": "Indicates if the item has to be displayed in the Settings Panel",
198
- "type": "boolean",
199
- "title": "settings"
200
- },
201
- "label": {
202
- "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
203
- "type": "string",
204
- "title": "label"
205
- }
206
- }
207
- },
208
- "ConfigureMathMLProp": {
209
- "title": "ConfigureMathMLProp",
210
- "type": "object",
211
- "properties": {
212
- "mmlOutput": {
213
- "description": "Indicates if model should have mathML output instead of latex",
214
- "type": "number",
215
- "title": "mmlOutput"
216
- },
217
- "mmlEditing": {
218
- "description": "Indicates if mathML that's already in model should be editable",
219
- "type": "number",
220
- "title": "mmlEditing"
221
- }
222
- }
223
- }
224
- },
225
- "$schema": "http://json-schema.org/draft-07/schema#"
226
- }
@@ -1,161 +0,0 @@
1
- Model for the RubricPie Interaction
2
-
3
- The schema defines the following properties:
4
-
5
- # `points` (array)
6
-
7
- Indicates the score points labels. Starting from 0 to max
8
-
9
- The object is an array with all elements of the type `object`.
10
-
11
- The array object has the following properties:
12
-
13
- # `sampleAnswers` (array)
14
-
15
- Indicates the sample answers labels. Starting from 0 to max
16
-
17
- The object is an array with all elements of the type `object`.
18
-
19
- The array object has the following properties:
20
-
21
- # `maxPoints` (number)
22
-
23
- Indicates the max limit for scoring points
24
-
25
- # `excludeZeros` (boolean)
26
-
27
- Indicates if point 0 should be shown
28
-
29
- # `id` (string, required)
30
-
31
- Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
32
-
33
- # `element` (string, required)
34
-
35
- The html Element tag name
36
-
37
- ---
38
-
39
- # Sub Schemas
40
-
41
- The schema defines the following additional types:
42
-
43
- ## `EditableHtmlConfigureProp` (object)
44
-
45
- Properties of the `EditableHtmlConfigureProp` object:
46
-
47
- ### `math` (object)
48
-
49
- Properties of the `math` object:
50
-
51
- #### `disabled` (boolean)
52
-
53
- Indicates if the plugin is disabled or not
54
-
55
- ### `audio` (object)
56
-
57
- Properties of the `audio` object:
58
-
59
- #### `disabled` (boolean)
60
-
61
- Indicates if the plugin is disabled or not
62
-
63
- ### `video` (object)
64
-
65
- Properties of the `video` object:
66
-
67
- #### `disabled` (boolean)
68
-
69
- Indicates if the plugin is disabled or not
70
-
71
- ### `image` (object)
72
-
73
- Properties of the `image` object:
74
-
75
- #### `disabled` (boolean)
76
-
77
- Indicates if the plugin is disabled or not
78
-
79
- ### `customPlugins` (array)
80
-
81
- An array of objects that determine custom plugins.
82
- A custom plugin is an object which determines how the button will look like (icon) and the event name that will be triggered when button gets pressed (event).
83
- Example can be found at https://github.com/pie-framework/pie-lib/blob/develop/packages/demo/pages/editable-html.js#L425.
84
-
85
- The object is an array with all elements of the type `object`.
86
-
87
- The array object has the following properties:
88
-
89
- #### `event` (string, required)
90
-
91
- The name of the custom event. It needs to be valid (only letters, numbers and "_" can be used).
92
- PIE will emit the event prefixed with "PIE-".
93
- Eg: event = 'client_custom_event_A' => the emitted event will be "PIE-client_custom_event_A"
94
-
95
- #### `iconAlt` (string, required)
96
-
97
- The alt for the custom button icon
98
-
99
- #### `iconType` (string, required)
100
-
101
- The icon type.
102
- Currently, only "SVG" is supported.
103
-
104
- #### `icon` (string, required)
105
-
106
- The icon string. Currently, only "SVG" is supported, so it needs to be a valid svg.
107
-
108
- ## `EditableHtmlButtonConfigure` (object)
109
-
110
- Properties of the `EditableHtmlButtonConfigure` object:
111
-
112
- ### `disabled` (boolean)
113
-
114
- Indicates if the plugin is disabled or not
115
-
116
- ## `CustomPlugin` (object)
117
-
118
- Properties of the `CustomPlugin` object:
119
-
120
- ### `event` (string, required)
121
-
122
- The name of the custom event. It needs to be valid (only letters, numbers and "_" can be used).
123
- PIE will emit the event prefixed with "PIE-".
124
- Eg: event = 'client_custom_event_A' => the emitted event will be "PIE-client_custom_event_A"
125
-
126
- ### `iconAlt` (string, required)
127
-
128
- The alt for the custom button icon
129
-
130
- ### `iconType` (string, required)
131
-
132
- The icon type.
133
- Currently, only "SVG" is supported.
134
-
135
- ### `icon` (string, required)
136
-
137
- The icon string. Currently, only "SVG" is supported, so it needs to be a valid svg.
138
-
139
- ## `ConfigureProp` (object)
140
-
141
- Properties of the `ConfigureProp` object:
142
-
143
- ### `settings` (boolean)
144
-
145
- Indicates if the item has to be displayed in the Settings Panel
146
-
147
- ### `label` (string)
148
-
149
- Indicates the label for the item that has to be displayed in the Settings Panel
150
-
151
- ## `ConfigureMathMLProp` (object)
152
-
153
- Properties of the `ConfigureMathMLProp` object:
154
-
155
- ### `mmlOutput` (number)
156
-
157
- Indicates if model should have mathML output instead of latex
158
-
159
- ### `mmlEditing` (number)
160
-
161
- Indicates if mathML that's already in model should be editable
@@ -1,88 +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["default"] = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
23
-
24
- var _main = _interopRequireDefault(require("./main"));
25
-
26
- var _react = _interopRequireDefault(require("react"));
27
-
28
- var _reactDom = _interopRequireDefault(require("react-dom"));
29
-
30
- var _debug = _interopRequireDefault(require("debug"));
31
-
32
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
33
-
34
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
35
-
36
- var RubricRender = /*#__PURE__*/function (_HTMLElement) {
37
- (0, _inherits2["default"])(RubricRender, _HTMLElement);
38
-
39
- var _super = _createSuper(RubricRender);
40
-
41
- function RubricRender() {
42
- var _this;
43
-
44
- (0, _classCallCheck2["default"])(this, RubricRender);
45
- _this = _super.call(this);
46
-
47
- _debug["default"].log('constructor called');
48
-
49
- _this.onModelChanged = _this.onModelChanged.bind((0, _assertThisInitialized2["default"])(_this));
50
- return _this;
51
- }
52
-
53
- (0, _createClass2["default"])(RubricRender, [{
54
- key: "model",
55
- set: function set(s) {
56
- this._model = s;
57
-
58
- this._render();
59
- }
60
- }, {
61
- key: "onModelChanged",
62
- value: function onModelChanged(m) {
63
- this._model = m;
64
-
65
- this._render();
66
- }
67
- }, {
68
- key: "connectedCallback",
69
- value: function connectedCallback() {
70
- this._render();
71
- }
72
- }, {
73
- key: "_render",
74
- value: function _render() {
75
- if (this._model) {
76
- var el = /*#__PURE__*/_react["default"].createElement(_main["default"], {
77
- value: this._model
78
- });
79
-
80
- _reactDom["default"].render(el, this);
81
- }
82
- }
83
- }]);
84
- return RubricRender;
85
- }( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
86
-
87
- exports["default"] = RubricRender;
88
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["RubricRender","debug","log","onModelChanged","bind","s","_model","_render","m","el","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;IAEqBA,Y;;;;;AACnB,0BAAc;AAAA;;AAAA;AACZ;;AACAC,sBAAMC,GAAN,CAAU,oBAAV;;AACA,UAAKC,cAAL,GAAsB,MAAKA,cAAL,CAAoBC,IAApB,gDAAtB;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;;AACA,WAAKE,OAAL;AACD;;;WAED,wBAAeC,CAAf,EAAkB;AAChB,WAAKF,MAAL,GAAcE,CAAd;;AACA,WAAKD,OAAL;AACD;;;WAED,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;WAED,mBAAU;AACR,UAAI,KAAKD,MAAT,EAAiB;AACf,YAAMG,EAAE,gBAAG,gCAAC,gBAAD;AAAQ,UAAA,KAAK,EAAE,KAAKH;AAApB,UAAX;;AAEAI,6BAASC,MAAT,CAAgBF,EAAhB,EAAoB,IAApB;AACD;AACF;;;kDA3BuCG,W","sourcesContent":["import Rubric from './main';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\nexport default class RubricRender extends HTMLElement {\n constructor() {\n super();\n debug.log('constructor called');\n this.onModelChanged = this.onModelChanged.bind(this);\n }\n\n set model(s) {\n this._model = s;\n this._render();\n }\n\n onModelChanged(m) {\n this._model = m;\n this._render();\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (this._model) {\n const el = <Rubric value={this._model} />;\n\n ReactDOM.render(el, this);\n }\n }\n}\n"],"file":"index.js"}
@@ -1,187 +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["default"] = exports.RubricType = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
- var _react = _interopRequireDefault(require("react"));
25
-
26
- var _styles = require("@material-ui/core/styles");
27
-
28
- var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
29
-
30
- var _List = _interopRequireDefault(require("@material-ui/core/List"));
31
-
32
- var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
33
-
34
- var _Link = _interopRequireDefault(require("@material-ui/core/Link"));
35
-
36
- var _Collapse = _interopRequireDefault(require("@material-ui/core/Collapse"));
37
-
38
- var _renderUi = require("@pie-lib/pie-toolbox/render-ui");
39
-
40
- var _propTypes = _interopRequireDefault(require("prop-types"));
41
-
42
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
43
-
44
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
45
-
46
- var RubricType = _propTypes["default"].shape({
47
- excludeZero: _propTypes["default"].bool,
48
- points: _propTypes["default"].arrayOf(_propTypes["default"].string),
49
- sampleAnswers: _propTypes["default"].arrayOf(_propTypes["default"].string),
50
- animationsDisabled: _propTypes["default"].bool
51
- });
52
-
53
- exports.RubricType = RubricType;
54
-
55
- var Rubric = /*#__PURE__*/function (_React$Component) {
56
- (0, _inherits2["default"])(Rubric, _React$Component);
57
-
58
- var _super = _createSuper(Rubric);
59
-
60
- function Rubric(props) {
61
- var _this;
62
-
63
- (0, _classCallCheck2["default"])(this, Rubric);
64
- _this = _super.call(this, props);
65
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "dudUrl", 'javascript:;');
66
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "shouldRenderPoint", function (index, value) {
67
- if (!value.excludeZero) {
68
- return true;
69
- } else {
70
- return index !== 0;
71
- }
72
- });
73
- _this.state = {
74
- rubricOpen: false,
75
- linkPrefix: 'Show'
76
- };
77
- _this.toggleRubric = _this.toggleRubric.bind((0, _assertThisInitialized2["default"])(_this));
78
- return _this;
79
- }
80
-
81
- (0, _createClass2["default"])(Rubric, [{
82
- key: "toggleRubric",
83
- value: function toggleRubric() {
84
- this.setState({
85
- rubricOpen: !this.state.rubricOpen
86
- });
87
- this.setState({
88
- linkPrefix: this.state.rubricOpen ? 'Show' : 'Hide'
89
- });
90
- }
91
- }, {
92
- key: "render",
93
- value: function render() {
94
- var _this$props = this.props,
95
- value = _this$props.value,
96
- classes = _this$props.classes;
97
- var animationsDisabled = this.props.animationsDisabled;
98
- animationsDisabled = animationsDisabled || value.animationsDisabled;
99
-
100
- if (value && value.points) {
101
- var points = value.points,
102
- sampleAnswers = value.sampleAnswers;
103
-
104
- var rubricList = /*#__PURE__*/_react["default"].createElement(_List["default"], {
105
- component: "nav"
106
- }, points.slice(0).reverse().map(function (desc, index) {
107
- index = points.length - index - 1;
108
- var pointsLabel = value.excludeZero ? index + 1 : index;
109
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
110
- key: index
111
- }, /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
112
- key: "P".concat(index)
113
- }, /*#__PURE__*/_react["default"].createElement(_ListItemText["default"], {
114
- className: classes.rubricCol,
115
- primary: /*#__PURE__*/_react["default"].createElement("div", {
116
- className: classes.text
117
- }, pointsLabel === 1 ? "".concat(pointsLabel, " PT") : "".concat(pointsLabel, " PTS"))
118
- }), /*#__PURE__*/_react["default"].createElement(_ListItemText["default"], {
119
- primary: /*#__PURE__*/_react["default"].createElement("div", {
120
- className: classes.text,
121
- dangerouslySetInnerHTML: {
122
- __html: desc
123
- }
124
- })
125
- })), sampleAnswers && sampleAnswers[index] && /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
126
- key: "S".concat(index)
127
- }, /*#__PURE__*/_react["default"].createElement(_ListItemText["default"], {
128
- className: classes.rubricCol,
129
- style: {
130
- marginLeft: '20px'
131
- },
132
- primary: /*#__PURE__*/_react["default"].createElement("div", {
133
- className: classes.text
134
- }, "Sample Answer")
135
- }), /*#__PURE__*/_react["default"].createElement(_ListItemText["default"], {
136
- primary: /*#__PURE__*/_react["default"].createElement("div", {
137
- className: classes.text,
138
- dangerouslySetInnerHTML: {
139
- __html: sampleAnswers[index]
140
- }
141
- })
142
- })));
143
- }));
144
-
145
- return /*#__PURE__*/_react["default"].createElement("div", {
146
- className: classes.root
147
- }, !animationsDisabled ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
148
- href: this.dudUrl,
149
- onClick: this.toggleRubric
150
- }, this.state.linkPrefix, " Rubric"), /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
151
- "in": this.state.rubricOpen,
152
- timeout: "auto"
153
- }, rubricList)) : rubricList);
154
- } else {
155
- return null;
156
- }
157
- }
158
- }]);
159
- return Rubric;
160
- }(_react["default"].Component);
161
-
162
- (0, _defineProperty2["default"])(Rubric, "propTypes", {
163
- classes: _propTypes["default"].object.isRequired,
164
- animationsDisabled: _propTypes["default"].bool,
165
- value: RubricType
166
- });
167
-
168
- var styles = function styles() {
169
- return {
170
- root: {
171
- color: _renderUi.color.text(),
172
- backgroundColor: _renderUi.color.background()
173
- },
174
- rubricCol: {
175
- flex: '0 1 auto',
176
- minWidth: 'fit-content'
177
- },
178
- text: {
179
- color: _renderUi.color.text()
180
- }
181
- };
182
- };
183
-
184
- var _default = (0, _styles.withStyles)(styles)(Rubric);
185
-
186
- exports["default"] = _default;
187
- //# sourceMappingURL=main.js.map