@pie-element/complex-rubric 2.0.2-next.13 → 2.0.2-next.15

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 (96) 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 +978 -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 +869 -0
  7. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js +502 -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 +98 -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 +553 -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 +552 -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 +371 -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 +270 -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 +210 -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 +161 -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 +1248 -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 +1088 -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 +192 -0
  70. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +14 -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 +6 -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/controller/package.json +1 -1
  96. package/package.json +4 -4
@@ -0,0 +1,201 @@
1
+ Model for the MultiTraitRubric Interaction
2
+
3
+ The schema defines the following properties:
4
+
5
+ # `halfScoring` (boolean)
6
+
7
+ Indicates if half scoring is enabled
8
+
9
+ # `pointLabels` (boolean)
10
+
11
+ Indicates if point labels should be shown
12
+
13
+ # `visibleToStudent` (boolean)
14
+
15
+ Indicates if should be visible to student
16
+
17
+ # `description` (boolean)
18
+
19
+ Indicates if description should be shown
20
+
21
+ # `standards` (boolean)
22
+
23
+ Indicates if standards should be shown
24
+
25
+ # `excludeZero` (boolean)
26
+
27
+ Indicates if scoring should start at 0 or 1
28
+
29
+ # `spellCheckEnabled` (boolean, required)
30
+
31
+ Indicates if spellcheck is enabled for the author. Default value is true
32
+
33
+ # `scales` (array, required)
34
+
35
+ scales
36
+
37
+ The object is an array with all elements of the type `object`.
38
+
39
+ The array object has the following properties:
40
+
41
+ ## `maxPoints` (number, required)
42
+
43
+ Indicates max limit for scoring points
44
+
45
+ ## `scorePointsLabels` (array, required)
46
+
47
+ Score labels. Starting from 0 to max.
48
+
49
+ The object is an array with all elements of the type `string`.
50
+
51
+ ## `traitLabel` (string, required)
52
+
53
+ Trait label
54
+
55
+ ## `traits` (array, required)
56
+
57
+ Traits
58
+
59
+ The object is an array with all elements of the type `object`.
60
+
61
+ The array object has the following properties:
62
+
63
+ ### `name` (string, required)
64
+
65
+ Trait name
66
+
67
+ ### `standards` (array, required)
68
+
69
+ Trait standards
70
+
71
+ The object is an array with all elements of the type `string`.
72
+
73
+ ### `description` (string, required)
74
+
75
+ Trait description
76
+
77
+ ### `scorePointsDescriptors` (array, required)
78
+
79
+ Score point descriptors. Starting from 0 to max.
80
+
81
+ The object is an array with all elements of the type `string`.
82
+
83
+ # `id` (string, required)
84
+
85
+ Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
86
+
87
+ # `element` (string, required)
88
+
89
+ The html Element tag name
90
+
91
+ ---
92
+
93
+ # Sub Schemas
94
+
95
+ The schema defines the following additional types:
96
+
97
+ ## `DialogContent` (object)
98
+
99
+ Properties of the `DialogContent` object:
100
+
101
+ ### `title` (string)
102
+
103
+ Dialog box title
104
+
105
+ ### `text` (string)
106
+
107
+ Dialog box text
108
+
109
+ ## `ConfigureProp` (object)
110
+
111
+ Properties of the `ConfigureProp` object:
112
+
113
+ ### `settings` (boolean)
114
+
115
+ Indicates if the item has to be displayed in the Settings Panel
116
+
117
+ ### `label` (string)
118
+
119
+ Indicates the label for the item that has to be displayed in the Settings Panel
120
+
121
+ ## `ConfigureMathMLProp` (object)
122
+
123
+ Properties of the `ConfigureMathMLProp` object:
124
+
125
+ ### `mmlOutput` (number)
126
+
127
+ Indicates if model should have mathML output instead of latex
128
+
129
+ ### `mmlEditing` (number)
130
+
131
+ Indicates if mathML that's already in model should be editable
132
+
133
+ ## `Scale` (object)
134
+
135
+ Properties of the `Scale` object:
136
+
137
+ ### `maxPoints` (number, required)
138
+
139
+ Indicates max limit for scoring points
140
+
141
+ ### `scorePointsLabels` (array, required)
142
+
143
+ Score labels. Starting from 0 to max.
144
+
145
+ The object is an array with all elements of the type `string`.
146
+
147
+ ### `traitLabel` (string, required)
148
+
149
+ Trait label
150
+
151
+ ### `traits` (array, required)
152
+
153
+ Traits
154
+
155
+ The object is an array with all elements of the type `object`.
156
+
157
+ The array object has the following properties:
158
+
159
+ #### `name` (string, required)
160
+
161
+ Trait name
162
+
163
+ #### `standards` (array, required)
164
+
165
+ Trait standards
166
+
167
+ The object is an array with all elements of the type `string`.
168
+
169
+ #### `description` (string, required)
170
+
171
+ Trait description
172
+
173
+ #### `scorePointsDescriptors` (array, required)
174
+
175
+ Score point descriptors. Starting from 0 to max.
176
+
177
+ The object is an array with all elements of the type `string`.
178
+
179
+ ## `Trait` (object)
180
+
181
+ Properties of the `Trait` object:
182
+
183
+ ### `name` (string, required)
184
+
185
+ Trait name
186
+
187
+ ### `standards` (array, required)
188
+
189
+ Trait standards
190
+
191
+ The object is an array with all elements of the type `string`.
192
+
193
+ ### `description` (string, required)
194
+
195
+ Trait description
196
+
197
+ ### `scorePointsDescriptors` (array, required)
198
+
199
+ Score point descriptors. Starting from 0 to max.
200
+
201
+ The object is an array with all elements of the type `string`.
@@ -0,0 +1,85 @@
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 _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
+
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
+
18
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
+
20
+ var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
21
+
22
+ var _react = _interopRequireDefault(require("react"));
23
+
24
+ var _reactDom = _interopRequireDefault(require("react-dom"));
25
+
26
+ var _piePlayerEvents = require("@pie-framework/pie-player-events");
27
+
28
+ var _main = _interopRequireDefault(require("./main"));
29
+
30
+ 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); }; }
31
+
32
+ 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; } }
33
+
34
+ var MultiTraitRubric = /*#__PURE__*/function (_HTMLElement) {
35
+ (0, _inherits2["default"])(MultiTraitRubric, _HTMLElement);
36
+
37
+ var _super = _createSuper(MultiTraitRubric);
38
+
39
+ function MultiTraitRubric() {
40
+ var _this;
41
+
42
+ (0, _classCallCheck2["default"])(this, MultiTraitRubric);
43
+ _this = _super.call(this);
44
+ _this._model = {};
45
+ _this._session = null;
46
+ return _this;
47
+ }
48
+
49
+ (0, _createClass2["default"])(MultiTraitRubric, [{
50
+ key: "model",
51
+ set: function set(s) {
52
+ this._model = s;
53
+ this.dispatchEvent(new _piePlayerEvents.ModelSetEvent(this.tagName.toLowerCase(), this._session, !!this._model));
54
+
55
+ this._render();
56
+ }
57
+ }, {
58
+ key: "session",
59
+ get: function get() {
60
+ return this._session;
61
+ },
62
+ set: function set(s) {
63
+ this._session = s;
64
+ }
65
+ }, {
66
+ key: "connectedCallback",
67
+ value: function connectedCallback() {
68
+ this._render();
69
+ }
70
+ }, {
71
+ key: "_render",
72
+ value: function _render() {
73
+ var el = /*#__PURE__*/_react["default"].createElement(_main["default"], {
74
+ model: this._model,
75
+ session: this._session
76
+ });
77
+
78
+ _reactDom["default"].render(el, this);
79
+ }
80
+ }]);
81
+ return MultiTraitRubric;
82
+ }( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
83
+
84
+ exports["default"] = MultiTraitRubric;
85
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.js"],"names":["MultiTraitRubric","_model","_session","s","dispatchEvent","ModelSetEvent","tagName","toLowerCase","_render","el","React","createElement","Main","model","session","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;IAEqBA,gB;;;;;AACnB,8BAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAc,EAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKF,MAAL,GAAcE,CAAd;AACA,WAAKC,aAAL,CAAmB,IAAIC,8BAAJ,CAAkB,KAAKC,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAAKL,QAAnD,EAA6D,CAAC,CAAC,KAAKD,MAApE,CAAnB;;AAEA,WAAKO,OAAL;AACD;;;SAMD,eAAc;AACZ,aAAO,KAAKN,QAAZ;AACD,K;SAND,aAAYC,CAAZ,EAAe;AACb,WAAKD,QAAL,GAAgBC,CAAhB;AACD;;;WAMD,6BAAoB;AAClB,WAAKK,OAAL;AACD;;;WAED,mBAAU;AACR,UAAMC,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AAAEC,QAAAA,KAAK,EAAE,KAAKZ,MAAd;AAAsBa,QAAAA,OAAO,EAAE,KAAKZ;AAApC,OAA1B,CAAX;;AAEAa,2BAASC,MAAT,CAAgBP,EAAhB,EAAoB,IAApB;AACD;;;kDA9B2CQ,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ModelSetEvent } from '@pie-framework/pie-player-events';\nimport Main from './main';\n\nexport default class MultiTraitRubric extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._session = null;\n }\n\n set model(s) {\n this._model = s;\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), this._session, !!this._model));\n\n this._render();\n }\n\n set session(s) {\n this._session = s;\n }\n\n get session() {\n return this._session;\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n const el = React.createElement(Main, { model: this._model, session: this._session });\n\n ReactDOM.render(el, this);\n }\n}\n"],"file":"index.js"}
@@ -0,0 +1,161 @@
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 _react = _interopRequireDefault(require("react"));
23
+
24
+ var _propTypes = _interopRequireDefault(require("prop-types"));
25
+
26
+ var _scale = _interopRequireDefault(require("./scale"));
27
+
28
+ var _Link = _interopRequireDefault(require("@material-ui/core/Link"));
29
+
30
+ var _Collapse = _interopRequireDefault(require("@material-ui/core/Collapse"));
31
+
32
+ var _renderUi = require("@pie-lib/pie-toolbox/render-ui");
33
+
34
+ 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); }; }
35
+
36
+ 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; } }
37
+
38
+ var Main = /*#__PURE__*/function (_React$Component) {
39
+ (0, _inherits2["default"])(Main, _React$Component);
40
+
41
+ var _super = _createSuper(Main);
42
+
43
+ function Main(props) {
44
+ var _this;
45
+
46
+ (0, _classCallCheck2["default"])(this, Main);
47
+ _this = _super.call(this, props);
48
+ _this.state = {
49
+ rubricOpen: false,
50
+ linkPrefix: 'Show'
51
+ };
52
+ _this.toggleRubric = _this.toggleRubric.bind((0, _assertThisInitialized2["default"])(_this));
53
+ return _this;
54
+ }
55
+
56
+ (0, _createClass2["default"])(Main, [{
57
+ key: "toggleRubric",
58
+ value: function toggleRubric() {
59
+ this.setState({
60
+ rubricOpen: !this.state.rubricOpen
61
+ });
62
+ this.setState({
63
+ linkPrefix: this.state.rubricOpen ? 'Show' : 'Hide'
64
+ });
65
+ }
66
+ }, {
67
+ key: "render",
68
+ value: function render() {
69
+ var model = this.props.model;
70
+ var animationsDisabled = this.props.animationsDisabled;
71
+
72
+ var _ref = model || {},
73
+ halfScoring = _ref.halfScoring,
74
+ scales = _ref.scales,
75
+ visible = _ref.visible,
76
+ pointLabels = _ref.pointLabels,
77
+ description = _ref.description,
78
+ standards = _ref.standards,
79
+ arrowsDisabled = _ref.arrowsDisabled;
80
+
81
+ animationsDisabled = animationsDisabled || model.animationsDisabled;
82
+
83
+ if (!scales || !visible) {
84
+ return null;
85
+ }
86
+
87
+ var rubricItem = /*#__PURE__*/_react["default"].createElement("div", {
88
+ style: {
89
+ fontFamily: 'Cerebri Sans',
90
+ color: _renderUi.color.text(),
91
+ backgroundColor: _renderUi.color.background()
92
+ }
93
+ }, halfScoring ? /*#__PURE__*/_react["default"].createElement("div", {
94
+ style: {
95
+ marginBottom: '16px'
96
+ }
97
+ }, "* Half-point or in-between scores are permitted under this rubric.") : null, scales.map(function (scale, scaleIndex) {
98
+ return /*#__PURE__*/_react["default"].createElement(_scale["default"], {
99
+ key: "scale_".concat(scaleIndex),
100
+ scale: scale,
101
+ scaleIndex: scaleIndex,
102
+ showPointsLabels: pointLabels,
103
+ showDescription: description,
104
+ showStandards: standards,
105
+ arrowsDisabled: arrowsDisabled
106
+ });
107
+ }));
108
+
109
+ if (animationsDisabled) {
110
+ return rubricItem;
111
+ }
112
+
113
+ return /*#__PURE__*/_react["default"].createElement("div", {
114
+ style: {
115
+ color: _renderUi.color.text(),
116
+ backgroundColor: _renderUi.color.background()
117
+ }
118
+ }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
119
+ style: {
120
+ backgroundColor: _renderUi.color.background()
121
+ },
122
+ href: this.dudUrl,
123
+ onClick: this.toggleRubric
124
+ }, this.state.linkPrefix, " Rubric"), /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
125
+ style: {
126
+ marginTop: '16px'
127
+ },
128
+ "in": this.state.rubricOpen,
129
+ timeout: "auto"
130
+ }, rubricItem));
131
+ }
132
+ }]);
133
+ return Main;
134
+ }(_react["default"].Component);
135
+
136
+ Main.propTypes = {
137
+ model: _propTypes["default"].shape({
138
+ halfScoring: _propTypes["default"].bool,
139
+ scales: _propTypes["default"].arrayOf(_propTypes["default"].shape({
140
+ excludeZero: _propTypes["default"].bool,
141
+ maxPoints: _propTypes["default"].number,
142
+ scorePointsLabels: _propTypes["default"].arrayOf(_propTypes["default"].string),
143
+ traitLabel: _propTypes["default"].string,
144
+ traits: _propTypes["default"].arrayOf(_propTypes["default"].shape({
145
+ name: _propTypes["default"].string,
146
+ description: _propTypes["default"].string,
147
+ scorePointsDescriptors: _propTypes["default"].arrayOf(_propTypes["default"].string),
148
+ standards: _propTypes["default"].arrayOf(_propTypes["default"].string)
149
+ }))
150
+ })),
151
+ visible: _propTypes["default"].bool,
152
+ pointLabels: _propTypes["default"].bool,
153
+ description: _propTypes["default"].bool,
154
+ standards: _propTypes["default"].bool,
155
+ animationsDisabled: _propTypes["default"].bool
156
+ }),
157
+ animationsDisabled: _propTypes["default"].bool
158
+ };
159
+ var _default = Main;
160
+ exports["default"] = _default;
161
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/main.jsx"],"names":["Main","props","state","rubricOpen","linkPrefix","toggleRubric","bind","setState","model","animationsDisabled","halfScoring","scales","visible","pointLabels","description","standards","arrowsDisabled","rubricItem","fontFamily","color","text","backgroundColor","background","marginBottom","map","scale","scaleIndex","dudUrl","marginTop","React","Component","propTypes","PropTypes","shape","bool","arrayOf","excludeZero","maxPoints","number","scorePointsLabels","string","traitLabel","traits","name","scorePointsDescriptors"],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,sBAAUE,IADF;AAErBvB,IAAAA,MAAM,EAAEqB,sBAAUG,OAAV,CACNH,sBAAUC,KAAV,CAAgB;AACdG,MAAAA,WAAW,EAAEJ,sBAAUE,IADT;AAEdG,MAAAA,SAAS,EAAEL,sBAAUM,MAFP;AAGdC,MAAAA,iBAAiB,EAAEP,sBAAUG,OAAV,CAAkBH,sBAAUQ,MAA5B,CAHL;AAIdC,MAAAA,UAAU,EAAET,sBAAUQ,MAJR;AAKdE,MAAAA,MAAM,EAAEV,sBAAUG,OAAV,CACNH,sBAAUC,KAAV,CAAgB;AACdU,QAAAA,IAAI,EAAEX,sBAAUQ,MADF;AAEd1B,QAAAA,WAAW,EAAEkB,sBAAUQ,MAFT;AAGdI,QAAAA,sBAAsB,EAAEZ,sBAAUG,OAAV,CAAkBH,sBAAUQ,MAA5B,CAHV;AAIdzB,QAAAA,SAAS,EAAEiB,sBAAUG,OAAV,CAAkBH,sBAAUQ,MAA5B;AAJG,OAAhB,CADM;AALM,KAAhB,CADM,CAFa;AAkBrB5B,IAAAA,OAAO,EAAEoB,sBAAUE,IAlBE;AAmBrBrB,IAAAA,WAAW,EAAEmB,sBAAUE,IAnBF;AAoBrBpB,IAAAA,WAAW,EAAEkB,sBAAUE,IApBF;AAqBrBnB,IAAAA,SAAS,EAAEiB,sBAAUE,IArBA;AAsBrBzB,IAAAA,kBAAkB,EAAEuB,sBAAUE;AAtBT,GAAhB,CADQ;AAyBfzB,EAAAA,kBAAkB,EAAEuB,sBAAUE;AAzBf,CAAjB;eA4BelC,I","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Scale from './scale';\nimport Link from '@material-ui/core/Link';\nimport Collapse from '@material-ui/core/Collapse';\nimport { color } from '@pie-lib/pie-toolbox/render-ui';\n\nclass Main extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n rubricOpen: false,\n linkPrefix: 'Show',\n };\n this.toggleRubric = this.toggleRubric.bind(this);\n }\n\n toggleRubric() {\n this.setState({ rubricOpen: !this.state.rubricOpen });\n this.setState({ linkPrefix: this.state.rubricOpen ? 'Show' : 'Hide' });\n }\n\n render() {\n const { model } = this.props;\n let { animationsDisabled } = this.props;\n const { halfScoring, scales, visible, pointLabels, description, standards, arrowsDisabled } = model || {};\n animationsDisabled = animationsDisabled || model.animationsDisabled;\n\n if (!scales || !visible) {\n return null;\n }\n\n const rubricItem = (\n <div style={{ fontFamily: 'Cerebri Sans', color: color.text(), backgroundColor: color.background() }}>\n {halfScoring ? (\n <div style={{ marginBottom: '16px' }}>* Half-point or in-between scores are permitted under this rubric.</div>\n ) : null}\n\n {scales.map((scale, scaleIndex) => (\n <Scale\n key={`scale_${scaleIndex}`}\n scale={scale}\n scaleIndex={scaleIndex}\n showPointsLabels={pointLabels}\n showDescription={description}\n showStandards={standards}\n arrowsDisabled={arrowsDisabled}\n />\n ))}\n </div>\n );\n\n if (animationsDisabled) {\n return rubricItem;\n }\n\n return (\n <div style={{ color: color.text(), backgroundColor: color.background() }}>\n <Link style={{ backgroundColor: color.background() }} href={this.dudUrl} onClick={this.toggleRubric}>\n {this.state.linkPrefix} Rubric\n </Link>\n <Collapse style={{ marginTop: '16px' }} in={this.state.rubricOpen} timeout=\"auto\">\n {rubricItem}\n </Collapse>\n </div>\n );\n }\n}\n\nMain.propTypes = {\n model: PropTypes.shape({\n halfScoring: PropTypes.bool,\n scales: PropTypes.arrayOf(\n PropTypes.shape({\n excludeZero: PropTypes.bool,\n maxPoints: PropTypes.number,\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n traits: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n description: PropTypes.string,\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n standards: PropTypes.arrayOf(PropTypes.string),\n }),\n ),\n }),\n ),\n visible: PropTypes.bool,\n pointLabels: PropTypes.bool,\n description: PropTypes.bool,\n standards: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n }),\n animationsDisabled: PropTypes.bool,\n};\n\nexport default Main;\n"],"file":"main.js"}