@pie-element/complex-rubric 3.8.1-next.9 → 3.8.2-next.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.
- package/CHANGELOG.md +11 -0
- package/configure/CHANGELOG.md +11 -0
- package/configure/package.json +2 -2
- package/module/index.html +1 -1
- package/module/manifest.json +1 -1
- package/module/print.html +1 -1
- package/package.json +4 -4
- package/configure/node_modules/@pie-element/rubric/CHANGELOG.json +0 -257
- package/configure/node_modules/@pie-element/rubric/CHANGELOG.md +0 -2683
- package/configure/node_modules/@pie-element/rubric/LICENSE.md +0 -5
- package/configure/node_modules/@pie-element/rubric/README.md +0 -3
- package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +0 -197
- package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.md +0 -2484
- package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js +0 -68
- package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/index.js +0 -197
- package/configure/node_modules/@pie-element/rubric/configure/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/main.js +0 -162
- package/configure/node_modules/@pie-element/rubric/configure/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js +0 -573
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js +0 -24
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js +0 -172
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/package.json +0 -20
- package/configure/node_modules/@pie-element/rubric/configure/src/__tests__/index.test.jsx +0 -178
- package/configure/node_modules/@pie-element/rubric/configure/src/defaults.js +0 -42
- package/configure/node_modules/@pie-element/rubric/configure/src/index.js +0 -129
- package/configure/node_modules/@pie-element/rubric/configure/src/main.jsx +0 -89
- package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/authoring.jsx +0 -449
- package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/index.js +0 -9
- package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/point-menu.jsx +0 -94
- package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.json +0 -17
- package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.md +0 -1510
- package/configure/node_modules/@pie-element/rubric/controller/lib/defaults.js +0 -16
- package/configure/node_modules/@pie-element/rubric/controller/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +0 -59
- package/configure/node_modules/@pie-element/rubric/controller/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/controller/package.json +0 -12
- package/configure/node_modules/@pie-element/rubric/controller/src/__tests__/index.test.js +0 -33
- package/configure/node_modules/@pie-element/rubric/controller/src/defaults.js +0 -8
- package/configure/node_modules/@pie-element/rubric/controller/src/index.js +0 -41
- package/configure/node_modules/@pie-element/rubric/docs/config-schema.json +0 -712
- package/configure/node_modules/@pie-element/rubric/docs/config-schema.json.md +0 -532
- package/configure/node_modules/@pie-element/rubric/docs/demo/config.js +0 -8
- package/configure/node_modules/@pie-element/rubric/docs/demo/generate.js +0 -8
- package/configure/node_modules/@pie-element/rubric/docs/demo/index.html +0 -2
- package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json +0 -391
- package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json.md +0 -281
- package/configure/node_modules/@pie-element/rubric/lib/index.js +0 -94
- package/configure/node_modules/@pie-element/rubric/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/lib/main.js +0 -270
- package/configure/node_modules/@pie-element/rubric/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/lib/print.js +0 -114
- package/configure/node_modules/@pie-element/rubric/lib/print.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/module/configure.js +0 -1
- package/configure/node_modules/@pie-element/rubric/module/controller.js +0 -113
- package/configure/node_modules/@pie-element/rubric/module/demo.js +0 -33
- package/configure/node_modules/@pie-element/rubric/module/element.js +0 -1
- package/configure/node_modules/@pie-element/rubric/module/index.html +0 -21
- package/configure/node_modules/@pie-element/rubric/module/manifest.json +0 -10
- package/configure/node_modules/@pie-element/rubric/module/print-demo.js +0 -71
- package/configure/node_modules/@pie-element/rubric/module/print.html +0 -18
- package/configure/node_modules/@pie-element/rubric/module/print.js +0 -1
- package/configure/node_modules/@pie-element/rubric/package.json +0 -27
- package/configure/node_modules/@pie-element/rubric/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -1815
- package/configure/node_modules/@pie-element/rubric/src/__tests__/rubric-view.test.jsx +0 -49
- package/configure/node_modules/@pie-element/rubric/src/index.js +0 -37
- package/configure/node_modules/@pie-element/rubric/src/main.jsx +0 -219
- package/configure/node_modules/@pie-element/rubric/src/print.js +0 -63
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _default = {
|
|
8
|
-
model: {
|
|
9
|
-
points: ['', '', '', ''],
|
|
10
|
-
sampleAnswers: [null, null, null, null],
|
|
11
|
-
maxPoints: 3,
|
|
12
|
-
excludeZero: false,
|
|
13
|
-
excludeZeroEnabled: true,
|
|
14
|
-
maxPointsEnabled: true
|
|
15
|
-
},
|
|
16
|
-
configuration: {
|
|
17
|
-
baseInputConfiguration: {
|
|
18
|
-
audio: {
|
|
19
|
-
disabled: false
|
|
20
|
-
},
|
|
21
|
-
video: {
|
|
22
|
-
disabled: false
|
|
23
|
-
},
|
|
24
|
-
image: {
|
|
25
|
-
disabled: false
|
|
26
|
-
},
|
|
27
|
-
textAlign: {
|
|
28
|
-
disabled: true
|
|
29
|
-
},
|
|
30
|
-
showParagraphs: {
|
|
31
|
-
disabled: false
|
|
32
|
-
},
|
|
33
|
-
separateParagraphs: {
|
|
34
|
-
disabled: true
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
rubriclessInstruction: {
|
|
38
|
-
inputConfiguration: {
|
|
39
|
-
audio: {
|
|
40
|
-
disabled: false
|
|
41
|
-
},
|
|
42
|
-
video: {
|
|
43
|
-
disabled: false
|
|
44
|
-
},
|
|
45
|
-
image: {
|
|
46
|
-
disabled: false
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
showExcludeZero: {
|
|
51
|
-
settings: true,
|
|
52
|
-
label: 'Ability to exclude zero'
|
|
53
|
-
},
|
|
54
|
-
showMaxPoint: {
|
|
55
|
-
settings: true,
|
|
56
|
-
label: 'Show max points dropdown'
|
|
57
|
-
},
|
|
58
|
-
settingsPanelDisabled: false,
|
|
59
|
-
// width: '500px'
|
|
60
|
-
mathMlOptions: {
|
|
61
|
-
mmlOutput: false,
|
|
62
|
-
mmlEditing: false
|
|
63
|
-
},
|
|
64
|
-
maxMaxPoints: 9
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
exports["default"] = _default;
|
|
68
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","points","sampleAnswers","maxPoints","excludeZero","excludeZeroEnabled","maxPointsEnabled","configuration","baseInputConfiguration","audio","disabled","video","image","textAlign","showParagraphs","separateParagraphs","rubriclessInstruction","inputConfiguration","showExcludeZero","settings","label","showMaxPoint","settingsPanelDisabled","mathMlOptions","mmlOutput","mmlEditing","maxMaxPoints"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC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IAAAA,qBAAqB,EAAE,KAxBV;AAyBb;AACAC,IAAAA,aAAa,EAAE;AACbC,MAAAA,SAAS,EAAE,KADE;AAEbC,MAAAA,UAAU,EAAE;AAFC,KA1BF;AA8BbC,IAAAA,YAAY,EAAE;AA9BD;AATF,C","sourcesContent":["export default {\n model: {\n points: ['', '', '', ''],\n sampleAnswers: [null, null, null, null],\n maxPoints: 3,\n excludeZero: false,\n excludeZeroEnabled: true,\n maxPointsEnabled: true,\n },\n configuration: {\n baseInputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n separateParagraphs: { disabled: true },\n },\n rubriclessInstruction: {\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n showExcludeZero: {\n settings: true,\n label: 'Ability to exclude zero',\n },\n showMaxPoint: {\n settings: true,\n label: 'Show max points dropdown',\n },\n settingsPanelDisabled: false,\n // width: '500px'\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n maxMaxPoints: 9,\n },\n};\n"],"file":"defaults.js"}
|
|
@@ -1,197 +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 _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
25
|
-
|
|
26
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
-
|
|
28
|
-
var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
|
|
29
|
-
|
|
30
|
-
var _react = _interopRequireDefault(require("react"));
|
|
31
|
-
|
|
32
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
33
|
-
|
|
34
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
35
|
-
|
|
36
|
-
var _main = _interopRequireDefault(require("./main"));
|
|
37
|
-
|
|
38
|
-
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
39
|
-
|
|
40
|
-
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); }; }
|
|
41
|
-
|
|
42
|
-
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; } }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
48
|
-
var modelWithDefaults = function modelWithDefaults(m) {
|
|
49
|
-
return _objectSpread(_objectSpread({}, _defaults["default"].model), m);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var configurationWithDefaults = function configurationWithDefaults(c) {
|
|
53
|
-
return _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var RubricElement = /*#__PURE__*/function (_HTMLElement) {
|
|
57
|
-
(0, _inherits2["default"])(RubricElement, _HTMLElement);
|
|
58
|
-
|
|
59
|
-
var _super = _createSuper(RubricElement);
|
|
60
|
-
|
|
61
|
-
function RubricElement() {
|
|
62
|
-
var _this;
|
|
63
|
-
|
|
64
|
-
(0, _classCallCheck2["default"])(this, RubricElement);
|
|
65
|
-
_this = _super.call(this);
|
|
66
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateModelAccordingToReceivedProps", function (nextModel) {
|
|
67
|
-
var currentModel = _objectSpread({}, _this._model);
|
|
68
|
-
|
|
69
|
-
if (!nextModel) {
|
|
70
|
-
return currentModel;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
var validatedModel = _objectSpread({}, nextModel); // excludeZero should be false and disabled when maxPoints is 1
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (validatedModel.maxPoints === 1) {
|
|
77
|
-
validatedModel.excludeZero = false;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
var _ref = validatedModel || {},
|
|
81
|
-
maxPoints = _ref.maxPoints,
|
|
82
|
-
excludeZero = _ref.excludeZero;
|
|
83
|
-
|
|
84
|
-
validatedModel.points = validatedModel.points ? (0, _toConsumableArray2["default"])(validatedModel.points) : [];
|
|
85
|
-
validatedModel.sampleAnswers = validatedModel.sampleAnswers ? (0, _toConsumableArray2["default"])(validatedModel.sampleAnswers) : [];
|
|
86
|
-
var howManyPointsShouldHave = excludeZero ? maxPoints : maxPoints + 1;
|
|
87
|
-
var howManyPointsDoesItHave = validatedModel.points.length;
|
|
88
|
-
var excludeZeroChanged = (currentModel === null || currentModel === void 0 ? void 0 : currentModel.excludeZero) !== (nextModel === null || nextModel === void 0 ? void 0 : nextModel.excludeZero);
|
|
89
|
-
var maxPointsChanged = (currentModel === null || currentModel === void 0 ? void 0 : currentModel.maxPoints) !== (nextModel === null || nextModel === void 0 ? void 0 : nextModel.maxPoints);
|
|
90
|
-
|
|
91
|
-
if (howManyPointsDoesItHave < howManyPointsShouldHave) {
|
|
92
|
-
if (excludeZeroChanged && !excludeZero) {
|
|
93
|
-
validatedModel.points = [''].concat((0, _toConsumableArray2["default"])(validatedModel.points));
|
|
94
|
-
validatedModel.sampleAnswers = [null].concat((0, _toConsumableArray2["default"])(validatedModel.sampleAnswers));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (maxPointsChanged) {
|
|
98
|
-
for (var i = 0; i < howManyPointsShouldHave - howManyPointsDoesItHave; i++) {
|
|
99
|
-
validatedModel.points.push('');
|
|
100
|
-
validatedModel.sampleAnswers.push(null);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
} else if (howManyPointsDoesItHave > howManyPointsShouldHave) {
|
|
104
|
-
if (excludeZeroChanged && excludeZero) {
|
|
105
|
-
validatedModel.points = validatedModel.points.slice(1);
|
|
106
|
-
validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(1);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (maxPointsChanged) {
|
|
110
|
-
validatedModel.points = validatedModel.points.slice(0, howManyPointsShouldHave);
|
|
111
|
-
validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(0, howManyPointsShouldHave);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return validatedModel;
|
|
116
|
-
});
|
|
117
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onConfigurationChanged", function (c) {
|
|
118
|
-
_this._configuration = configurationWithDefaults(c);
|
|
119
|
-
|
|
120
|
-
if (_this._model) {
|
|
121
|
-
_this.onModelChanged(_this._model);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
_this._render();
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
_debug["default"].log('constructor called');
|
|
128
|
-
|
|
129
|
-
_this._model = modelWithDefaults();
|
|
130
|
-
_this._configuration = configurationWithDefaults();
|
|
131
|
-
_this.onModelChanged = _this.onModelChanged.bind((0, _assertThisInitialized2["default"])(_this));
|
|
132
|
-
_this.onConfigurationChanged = _this.onConfigurationChanged.bind((0, _assertThisInitialized2["default"])(_this));
|
|
133
|
-
return _this;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
(0, _createClass2["default"])(RubricElement, [{
|
|
137
|
-
key: "model",
|
|
138
|
-
set: function set(m) {
|
|
139
|
-
this._model = this.updateModelAccordingToReceivedProps(modelWithDefaults(m));
|
|
140
|
-
|
|
141
|
-
this._render();
|
|
142
|
-
}
|
|
143
|
-
}, {
|
|
144
|
-
key: "configuration",
|
|
145
|
-
set: function set(c) {
|
|
146
|
-
this._configuration = configurationWithDefaults(c);
|
|
147
|
-
|
|
148
|
-
this._render();
|
|
149
|
-
}
|
|
150
|
-
}, {
|
|
151
|
-
key: "onModelChanged",
|
|
152
|
-
value: function onModelChanged(m) {
|
|
153
|
-
this._model = this.updateModelAccordingToReceivedProps(m);
|
|
154
|
-
|
|
155
|
-
this._render();
|
|
156
|
-
|
|
157
|
-
this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, false));
|
|
158
|
-
}
|
|
159
|
-
}, {
|
|
160
|
-
key: "insertImage",
|
|
161
|
-
value: function insertImage(handler) {
|
|
162
|
-
this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
|
|
163
|
-
}
|
|
164
|
-
}, {
|
|
165
|
-
key: "onDeleteImage",
|
|
166
|
-
value: function onDeleteImage(src, done) {
|
|
167
|
-
this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
key: "connectedCallback",
|
|
171
|
-
value: function connectedCallback() {
|
|
172
|
-
this._render();
|
|
173
|
-
}
|
|
174
|
-
}, {
|
|
175
|
-
key: "_render",
|
|
176
|
-
value: function _render() {
|
|
177
|
-
if (this._model) {
|
|
178
|
-
var element = /*#__PURE__*/_react["default"].createElement(_main["default"], {
|
|
179
|
-
model: this._model,
|
|
180
|
-
configuration: this._configuration,
|
|
181
|
-
onModelChanged: this.onModelChanged,
|
|
182
|
-
onConfigurationChanged: this.onConfigurationChanged,
|
|
183
|
-
imageSupport: {
|
|
184
|
-
add: this.insertImage.bind(this),
|
|
185
|
-
"delete": this.onDeleteImage.bind(this)
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
_reactDom["default"].render(element, this);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}]);
|
|
193
|
-
return RubricElement;
|
|
194
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
|
|
195
|
-
|
|
196
|
-
exports["default"] = RubricElement;
|
|
197
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["modelWithDefaults","m","defaults","model","configurationWithDefaults","c","configuration","RubricElement","nextModel","currentModel","_model","validatedModel","maxPoints","excludeZero","points","sampleAnswers","howManyPointsShouldHave","howManyPointsDoesItHave","length","excludeZeroChanged","maxPointsChanged","i","push","slice","_configuration","onModelChanged","_render","debug","log","bind","onConfigurationChanged","updateModelAccordingToReceivedProps","dispatchEvent","ModelUpdatedEvent","handler","InsertImageEvent","src","done","DeleteImageEvent","element","React","createElement","Main","imageSupport","add","insertImage","onDeleteImage","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,CAAD;AAAA,yCAAaC,qBAASC,KAAtB,GAAgCF,CAAhC;AAAA,CAA1B;;AAEA,IAAMG,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,CAAD;AAAA,yCAAaH,qBAASI,aAAtB,GAAwCD,CAAxC;AAAA,CAAlC;;IAEqBE,a;;;;;AACnB,2BAAc;AAAA;;AAAA;AACZ;AADY,4HASwB,UAACC,SAAD,EAAe;AACnD,UAAMC,YAAY,qBAAQ,MAAKC,MAAb,CAAlB;;AAEA,UAAI,CAACF,SAAL,EAAgB;AACd,eAAOC,YAAP;AACD;;AAED,UAAME,cAAc,qBAAQH,SAAR,CAApB,CAPmD,CASnD;;;AACA,UAAIG,cAAc,CAACC,SAAf,KAA6B,CAAjC,EAAoC;AAClCD,QAAAA,cAAc,CAACE,WAAf,GAA6B,KAA7B;AACD;;AAED,iBAAmCF,cAAc,IAAI,EAArD;AAAA,UAAQC,SAAR,QAAQA,SAAR;AAAA,UAAmBC,WAAnB,QAAmBA,WAAnB;;AAEAF,MAAAA,cAAc,CAACG,MAAf,GAAwBH,cAAc,CAACG,MAAf,uCAA4BH,cAAc,CAACG,MAA3C,IAAqD,EAA7E;AACAH,MAAAA,cAAc,CAACI,aAAf,GAA+BJ,cAAc,CAACI,aAAf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AACA,WAAKM,aAAL,CAAmB,IAAIC,qCAAJ,CAAsB,KAAKvB,MAA3B,EAAmC,KAAnC,CAAnB;AACD;;;WAYD,qBAAYwB,OAAZ,EAAqB;AACnB,WAAKF,aAAL,CAAmB,IAAIG,oCAAJ,CAAqBD,OAArB,CAAnB;AACD;;;WAED,uBAAcE,GAAd,EAAmBC,IAAnB,EAAyB;AACvB,WAAKL,aAAL,CAAmB,IAAIM,oCAAJ,CAAqBF,GAArB,EAA0BC,IAA1B,CAAnB;AACD;;;WAED,6BAAoB;AAClB,WAAKX,OAAL;AACD;;;WAED,mBAAU;AACR,UAAI,KAAKhB,MAAT,EAAiB;AACf,YAAI6B,OAAO,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACtCvC,UAAAA,KAAK,EAAE,KAAKO,MAD0B;AAEtCJ,UAAAA,aAAa,EAAE,KAAKkB,cAFkB;AAGtCC,UAAAA,cAAc,EAAE,KAAKA,cAHiB;AAItCK,UAAAA,sBAAsB,EAAE,KAAKA,sBAJS;AAKtCa,UAAAA,YAAY,EAAE;AACZC,YAAAA,GAAG,EAAE,KAAKC,WAAL,CAAiBhB,IAAjB,CAAsB,IAAtB,CADO;AAEZ,sBAAQ,KAAKiB,aAAL,CAAmBjB,IAAnB,CAAwB,IAAxB;AAFI;AALwB,SAA1B,CAAd;;AAWAkB,6BAASC,MAAT,CAAgBT,OAAhB,EAAyB,IAAzB;AACD;AACF;;;kDAnHwCU,W","sourcesContent":["import { ModelUpdatedEvent, InsertImageEvent, DeleteImageEvent } from '@pie-framework/pie-configure-events';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\nimport Main from './main';\nimport defaults from './defaults';\n\nconst modelWithDefaults = (m) => ({ ...defaults.model, ...m });\n\nconst configurationWithDefaults = (c) => ({ ...defaults.configuration, ...c });\n\nexport default class RubricElement extends HTMLElement {\n constructor() {\n super();\n debug.log('constructor called');\n this._model = modelWithDefaults();\n this._configuration = configurationWithDefaults();\n this.onModelChanged = this.onModelChanged.bind(this);\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n updateModelAccordingToReceivedProps = (nextModel) => {\n const currentModel = { ...this._model };\n\n if (!nextModel) {\n return currentModel;\n }\n\n const validatedModel = { ...nextModel };\n\n // excludeZero should be false and disabled when maxPoints is 1\n if (validatedModel.maxPoints === 1) {\n validatedModel.excludeZero = false;\n }\n\n const { maxPoints, excludeZero } = validatedModel || {};\n\n validatedModel.points = validatedModel.points ? [...validatedModel.points] : [];\n validatedModel.sampleAnswers = validatedModel.sampleAnswers ? [...validatedModel.sampleAnswers] : [];\n\n const howManyPointsShouldHave = excludeZero ? maxPoints : maxPoints + 1;\n const howManyPointsDoesItHave = validatedModel.points.length;\n\n const excludeZeroChanged = currentModel?.excludeZero !== nextModel?.excludeZero;\n const maxPointsChanged = currentModel?.maxPoints !== nextModel?.maxPoints;\n\n if (howManyPointsDoesItHave < howManyPointsShouldHave) {\n if (excludeZeroChanged && !excludeZero) {\n validatedModel.points = ['', ...validatedModel.points];\n validatedModel.sampleAnswers = [null, ...validatedModel.sampleAnswers];\n }\n\n if (maxPointsChanged) {\n for (let i = 0; i < howManyPointsShouldHave - howManyPointsDoesItHave; i++) {\n validatedModel.points.push('');\n validatedModel.sampleAnswers.push(null);\n }\n }\n } else if (howManyPointsDoesItHave > howManyPointsShouldHave) {\n if (excludeZeroChanged && excludeZero) {\n validatedModel.points = validatedModel.points.slice(1);\n validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(1);\n }\n\n if (maxPointsChanged) {\n validatedModel.points = validatedModel.points.slice(0, howManyPointsShouldHave);\n validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(0, howManyPointsShouldHave);\n }\n }\n\n return validatedModel;\n };\n\n set model(m) {\n this._model = this.updateModelAccordingToReceivedProps(modelWithDefaults(m));\n this._render();\n }\n\n set configuration(c) {\n this._configuration = configurationWithDefaults(c);\n this._render();\n }\n\n onModelChanged(m) {\n this._model = this.updateModelAccordingToReceivedProps(m);\n this._render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n }\n\n onConfigurationChanged = (c) => {\n this._configuration = configurationWithDefaults(c);\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n };\n\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (this._model) {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this),\n },\n });\n\n ReactDOM.render(element, this);\n }\n }\n}\n"],"file":"index.js"}
|
|
@@ -1,162 +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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
|
-
var _index = require("./pie-toolbox-rubric/index");
|
|
29
|
-
|
|
30
|
-
var _styles = require("@material-ui/core/styles");
|
|
31
|
-
|
|
32
|
-
var _configUi = require("@pie-lib/config-ui");
|
|
33
|
-
|
|
34
|
-
var _excluded = ["points", "sampleAnswers"];
|
|
35
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
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); }; }
|
|
41
|
-
|
|
42
|
-
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; } }
|
|
43
|
-
|
|
44
|
-
var Panel = _configUi.settings.Panel,
|
|
45
|
-
toggle = _configUi.settings.toggle;
|
|
46
|
-
|
|
47
|
-
var styles = function styles(theme) {
|
|
48
|
-
return {
|
|
49
|
-
design: {
|
|
50
|
-
fontFamily: 'Cerebri Sans',
|
|
51
|
-
fontSize: theme.typography.fontSize
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var Main = /*#__PURE__*/function (_React$Component) {
|
|
57
|
-
(0, _inherits2["default"])(Main, _React$Component);
|
|
58
|
-
|
|
59
|
-
var _super = _createSuper(Main);
|
|
60
|
-
|
|
61
|
-
function Main() {
|
|
62
|
-
var _this;
|
|
63
|
-
|
|
64
|
-
(0, _classCallCheck2["default"])(this, Main);
|
|
65
|
-
|
|
66
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
67
|
-
args[_key] = arguments[_key];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
71
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "verifyRubriclessModel", function (m, config) {
|
|
72
|
-
var _ref = config || {},
|
|
73
|
-
_ref$rubricless = _ref.rubricless,
|
|
74
|
-
rubricless = _ref$rubricless === void 0 ? false : _ref$rubricless;
|
|
75
|
-
|
|
76
|
-
return rubricless ? function (_ref2) {
|
|
77
|
-
var points = _ref2.points,
|
|
78
|
-
sampleAnswers = _ref2.sampleAnswers,
|
|
79
|
-
rest = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
|
|
80
|
-
return rest;
|
|
81
|
-
}(m) : m;
|
|
82
|
-
});
|
|
83
|
-
return _this;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
(0, _createClass2["default"])(Main, [{
|
|
87
|
-
key: "render",
|
|
88
|
-
value: function render() {
|
|
89
|
-
var _ref3 = this.props || {},
|
|
90
|
-
model = _ref3.model,
|
|
91
|
-
configuration = _ref3.configuration,
|
|
92
|
-
onConfigurationChanged = _ref3.onConfigurationChanged,
|
|
93
|
-
onModelChanged = _ref3.onModelChanged,
|
|
94
|
-
imageSupport = _ref3.imageSupport;
|
|
95
|
-
|
|
96
|
-
var _ref4 = configuration || {},
|
|
97
|
-
_ref4$baseInputConfig = _ref4.baseInputConfiguration,
|
|
98
|
-
baseInputConfiguration = _ref4$baseInputConfig === void 0 ? {} : _ref4$baseInputConfig,
|
|
99
|
-
_ref4$contentDimensio = _ref4.contentDimensions,
|
|
100
|
-
contentDimensions = _ref4$contentDimensio === void 0 ? {} : _ref4$contentDimensio,
|
|
101
|
-
settingsPanelDisabled = _ref4.settingsPanelDisabled,
|
|
102
|
-
_ref4$showExcludeZero = _ref4.showExcludeZero,
|
|
103
|
-
showExcludeZero = _ref4$showExcludeZero === void 0 ? {} : _ref4$showExcludeZero,
|
|
104
|
-
_ref4$showMaxPoint = _ref4.showMaxPoint,
|
|
105
|
-
showMaxPoint = _ref4$showMaxPoint === void 0 ? {} : _ref4$showMaxPoint,
|
|
106
|
-
_ref4$mathMlOptions = _ref4.mathMlOptions,
|
|
107
|
-
mathMlOptions = _ref4$mathMlOptions === void 0 ? {} : _ref4$mathMlOptions,
|
|
108
|
-
_ref4$rubricless = _ref4.rubricless,
|
|
109
|
-
rubricless = _ref4$rubricless === void 0 ? false : _ref4$rubricless,
|
|
110
|
-
rubriclessInstruction = _ref4.rubriclessInstruction,
|
|
111
|
-
width = _ref4.width; // ensure to eliminate points and sampleAnswers in case of rubricless
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
var value = this.verifyRubriclessModel(model, configuration);
|
|
115
|
-
var extraCSSRules = model.extraCSSRules;
|
|
116
|
-
var panelProperties = {
|
|
117
|
-
excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
|
|
118
|
-
maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),
|
|
119
|
-
rubriclessInstructionEnabled: rubricless && rubriclessInstruction.settings && toggle(rubriclessInstruction.label)
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
var getPluginProps = function getPluginProps(props) {
|
|
123
|
-
return Object.assign(_objectSpread({}, baseInputConfiguration), props || {});
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
127
|
-
extraCSSRules: extraCSSRules,
|
|
128
|
-
dimensions: contentDimensions,
|
|
129
|
-
hideSettings: settingsPanelDisabled,
|
|
130
|
-
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
131
|
-
model: model,
|
|
132
|
-
onChangeModel: onModelChanged,
|
|
133
|
-
configuration: configuration,
|
|
134
|
-
onChangeConfiguration: onConfigurationChanged,
|
|
135
|
-
pluginOpts: getPluginProps(rubriclessInstruction === null || rubriclessInstruction === void 0 ? void 0 : rubriclessInstruction.inputConfiguration),
|
|
136
|
-
groups: {
|
|
137
|
-
Properties: panelProperties
|
|
138
|
-
},
|
|
139
|
-
imageSupport: imageSupport
|
|
140
|
-
})
|
|
141
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
142
|
-
style: {
|
|
143
|
-
maxWidth: width
|
|
144
|
-
}
|
|
145
|
-
}, /*#__PURE__*/_react["default"].createElement(_index.Authoring, {
|
|
146
|
-
value: value,
|
|
147
|
-
config: configuration,
|
|
148
|
-
onChange: onModelChanged,
|
|
149
|
-
mathMlOptions: mathMlOptions,
|
|
150
|
-
rubricless: rubricless,
|
|
151
|
-
pluginOpts: baseInputConfiguration,
|
|
152
|
-
imageSupport: imageSupport
|
|
153
|
-
})));
|
|
154
|
-
}
|
|
155
|
-
}]);
|
|
156
|
-
return Main;
|
|
157
|
-
}(_react["default"].Component);
|
|
158
|
-
|
|
159
|
-
var _default = (0, _styles.withStyles)(styles)(Main);
|
|
160
|
-
|
|
161
|
-
exports["default"] = _default;
|
|
162
|
-
//# sourceMappingURL=main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","styles","theme","design","fontFamily","fontSize","typography","Main","m","config","rubricless","points","sampleAnswers","rest","props","model","configuration","onConfigurationChanged","onModelChanged","imageSupport","baseInputConfiguration","contentDimensions","settingsPanelDisabled","showExcludeZero","showMaxPoint","mathMlOptions","rubriclessInstruction","width","value","verifyRubriclessModel","extraCSSRules","panelProperties","excludeZeroEnabled","label","maxPointsEnabled","rubriclessInstructionEnabled","getPluginProps","Object","assign","inputConfiguration","Properties","maxWidth","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAE,cADN;AAENC,MAAAA,QAAQ,EAAEH,KAAK,CAACI,UAAN,CAAiBD;AAFrB;AADiB,GAAZ;AAAA,CAAf;;IAOME,I;;;;;;;;;;;;;;;8GACoB,UAACC,CAAD,EAAIC,MAAJ,EAAe;AACrC,iBAA+BA,MAAM,IAAI,EAAzC;AAAA,iCAAQC,UAAR;AAAA,UAAQA,UAAR,gCAAqB,KAArB;;AACA,aAAOA,UAAU,GAAI;AAAA,YAAGC,MAAH,SAAGA,MAAH;AAAA,YAAWC,aAAX,SAAWA,aAAX;AAAA,YAA6BC,IAA7B;AAAA,eAAwCA,IAAxC;AAAA,OAAD,CAA+CL,CAA/C,CAAH,GAAuDA,CAAxE;AACD,K;;;;;;WAED,kBAAS;AACP,kBAAuF,KAAKM,KAAL,IAAc,EAArG;AAAA,UAAQC,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I,EAJJ,CAAP;AAMD,OAPD;;AASA,0BACE,gCAAC,gBAAD,CAAQ,YAAR;AACE,QAAA,aAAa,EAAEgB,aADjB;AAEE,QAAA,UAAU,EAAET,iBAFd;AAGE,QAAA,YAAY,EAAEC,qBAHhB;AAIE,QAAA,QAAQ,eACN,gCAAC,KAAD;AACE,UAAA,KAAK,EAAEP,KADT;AAEE,UAAA,aAAa,EAAEG,cAFjB;AAGE,UAAA,aAAa,EAAEF,aAHjB;AAIE,UAAA,qBAAqB,EAAEC,sBAJzB;AAKE,UAAA,UAAU,EAAEmB,cAAc,CAACV,qBAAD,aAACA,qBAAD,uBAACA,qBAAqB,CAAEa,kBAAxB,CAL5B;AAME,UAAA,MAAM,EAAE;AACNC,YAAAA,UAAU,EAAET;AADN,WANV;AASE,UAAA,YAAY,EAAEZ;AAThB;AALJ,sBAkBE;AAAK,QAAA,KAAK,EAAE;AAAEsB,UAAAA,QAAQ,EAAEd;AAAZ;AAAZ,sBACE,gCAAC,gBAAD;AACE,QAAA,KAAK,EAAEC,KADT;AAEE,QAAA,MAAM,EAAEZ,aAFV;AAGE,QAAA,QAAQ,EAAEE,cAHZ;AAIE,QAAA,aAAa,EAAEO,aAJjB;AAKE,QAAA,UAAU,EAAEf,UALd;AAME,QAAA,UAAU,EAAEU,sBANd;AAOE,QAAA,YAAY,EAAED;AAPhB,QADF,CAlBF,CADF;AAgCD;;;EAvEgBuB,kBAAMC,S;;eA0EV,wBAAW1C,MAAX,EAAmBM,IAAnB,C","sourcesContent":["import React from 'react';\nimport { Authoring } from './pie-toolbox-rubric/index';\nimport { withStyles } from '@material-ui/core/styles';\nimport { layout, settings } from '@pie-lib/config-ui';\n\nconst { Panel, toggle } = settings;\n\nconst styles = (theme) => ({\n design: {\n fontFamily: 'Cerebri Sans',\n fontSize: theme.typography.fontSize,\n },\n});\n\nclass Main extends React.Component {\n verifyRubriclessModel = (m, config) => {\n const { rubricless = false } = config || {};\n return rubricless ? (({ points, sampleAnswers, ...rest }) => rest)(m) : m;\n };\n\n render() {\n const { model, configuration, onConfigurationChanged, onModelChanged, imageSupport } = this.props || {};\n const {\n baseInputConfiguration = {},\n contentDimensions = {},\n settingsPanelDisabled,\n showExcludeZero = {},\n showMaxPoint = {},\n mathMlOptions = {},\n rubricless = false,\n rubriclessInstruction,\n width,\n } = configuration || {};\n\n // ensure to eliminate points and sampleAnswers in case of rubricless\n const value = this.verifyRubriclessModel(model, configuration);\n const { extraCSSRules } = model;\n\n const panelProperties = {\n excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),\n maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),\n rubriclessInstructionEnabled: rubricless && rubriclessInstruction.settings && toggle(rubriclessInstruction.label),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n pluginOpts={getPluginProps(rubriclessInstruction?.inputConfiguration)}\n groups={{\n Properties: panelProperties,\n }}\n imageSupport={imageSupport}\n />\n }\n >\n <div style={{ maxWidth: width }}>\n <Authoring\n value={value}\n config={configuration}\n onChange={onModelChanged}\n mathMlOptions={mathMlOptions}\n rubricless={rubricless}\n pluginOpts={baseInputConfiguration}\n imageSupport={imageSupport}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
|