@pie-element/multi-trait-rubric 3.8.1 → 3.8.2-next.1
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/configure/package.json +1 -1
- package/controller/package.json +1 -1
- package/package.json +3 -3
- package/configure/lib/common.js +0 -572
- package/configure/lib/common.js.map +0 -1
- package/configure/lib/defaults.js +0 -143
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -170
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -596
- package/configure/lib/main.js.map +0 -1
- package/configure/lib/modals.js +0 -361
- package/configure/lib/modals.js.map +0 -1
- package/configure/lib/scale.js +0 -552
- package/configure/lib/scale.js.map +0 -1
- package/configure/lib/trait.js +0 -370
- package/configure/lib/trait.js.map +0 -1
- package/configure/lib/traitsHeader.js +0 -287
- package/configure/lib/traitsHeader.js.map +0 -1
- package/configure/lib/utils.js +0 -14
- package/configure/lib/utils.js.map +0 -1
- package/controller/lib/defaults.js +0 -94
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -215
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -13
- package/controller/lib/utils.js.map +0 -1
- package/lib/index.js +0 -85
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -161
- package/lib/main.js.map +0 -1
- package/lib/scale.js +0 -330
- package/lib/scale.js.map +0 -1
- package/lib/trait.js +0 -103
- package/lib/trait.js.map +0 -1
|
@@ -1,287 +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.TraitsHeaderTile = 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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var _styles = require("@material-ui/core/styles");
|
|
29
|
-
|
|
30
|
-
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
31
|
-
|
|
32
|
-
var _Menu = _interopRequireDefault(require("@material-ui/core/Menu"));
|
|
33
|
-
|
|
34
|
-
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
35
|
-
|
|
36
|
-
var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));
|
|
37
|
-
|
|
38
|
-
var _renderUi = require("@pie-lib/pie-toolbox/render-ui");
|
|
39
|
-
|
|
40
|
-
var _common = require("./common");
|
|
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 styles = function styles(theme) {
|
|
47
|
-
return {
|
|
48
|
-
label: {
|
|
49
|
-
textAlign: 'center',
|
|
50
|
-
width: '140px',
|
|
51
|
-
border: 'none',
|
|
52
|
-
margin: theme.spacing.unit,
|
|
53
|
-
padding: '10px 0',
|
|
54
|
-
display: 'flex',
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
justifyContent: 'space-around'
|
|
57
|
-
},
|
|
58
|
-
greyHeader: {
|
|
59
|
-
background: _renderUi.color.secondaryBackground(),
|
|
60
|
-
borderRadius: '4px',
|
|
61
|
-
position: 'relative',
|
|
62
|
-
marginBottom: theme.spacing.unit * 2
|
|
63
|
-
},
|
|
64
|
-
primaryBlockGreyHeader: {
|
|
65
|
-
paddingTop: theme.spacing.unit * 1.5
|
|
66
|
-
},
|
|
67
|
-
errorText: {
|
|
68
|
-
fontSize: theme.typography.fontSize - 2,
|
|
69
|
-
color: theme.palette.error.main,
|
|
70
|
-
paddingTop: theme.spacing.unit / 2
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
var TraitsHeaderTile = /*#__PURE__*/function (_React$Component) {
|
|
76
|
-
(0, _inherits2["default"])(TraitsHeaderTile, _React$Component);
|
|
77
|
-
|
|
78
|
-
var _super = _createSuper(TraitsHeaderTile);
|
|
79
|
-
|
|
80
|
-
function TraitsHeaderTile() {
|
|
81
|
-
var _this;
|
|
82
|
-
|
|
83
|
-
(0, _classCallCheck2["default"])(this, TraitsHeaderTile);
|
|
84
|
-
|
|
85
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
86
|
-
args[_key] = arguments[_key];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
90
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
91
|
-
anchorEl: null
|
|
92
|
-
});
|
|
93
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onScorePointLabelChange", function (_ref) {
|
|
94
|
-
var scorePointLabel = _ref.scorePointLabel,
|
|
95
|
-
value = _ref.value;
|
|
96
|
-
var _this$props = _this.props,
|
|
97
|
-
scorePointsLabels = _this$props.scorePointsLabels,
|
|
98
|
-
onScaleChange = _this$props.onScaleChange;
|
|
99
|
-
if (value < 0 || value >= scorePointsLabels.length) return;
|
|
100
|
-
scorePointsLabels[value] = scorePointLabel;
|
|
101
|
-
onScaleChange({
|
|
102
|
-
scorePointsLabels: scorePointsLabels
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClick", function (event) {
|
|
106
|
-
return _this.setState({
|
|
107
|
-
anchorEl: event.currentTarget
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClose", function () {
|
|
111
|
-
return _this.setState({
|
|
112
|
-
anchorEl: null
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "scrollToPosition", function (position) {
|
|
116
|
-
return _this.secondaryBlock.scrollTo({
|
|
117
|
-
left: position
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "openMenu", function () {
|
|
121
|
-
_this.props.showDeleteScaleModal();
|
|
122
|
-
|
|
123
|
-
_this.handleClose();
|
|
124
|
-
});
|
|
125
|
-
return _this;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
(0, _createClass2["default"])(TraitsHeaderTile, [{
|
|
129
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
130
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
131
|
-
if (nextProps.currentPosition !== this.props.currentPosition) {
|
|
132
|
-
this.scrollToPosition(nextProps.currentPosition);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}, {
|
|
136
|
-
key: "render",
|
|
137
|
-
value: function render() {
|
|
138
|
-
var _this2 = this;
|
|
139
|
-
|
|
140
|
-
var _this$props2 = this.props,
|
|
141
|
-
scorePointsValues = _this$props2.scorePointsValues,
|
|
142
|
-
scorePointsLabels = _this$props2.scorePointsLabels,
|
|
143
|
-
traitLabel = _this$props2.traitLabel,
|
|
144
|
-
classes = _this$props2.classes,
|
|
145
|
-
currentPosition = _this$props2.currentPosition,
|
|
146
|
-
showStandards = _this$props2.showStandards,
|
|
147
|
-
onTraitLabelChange = _this$props2.onTraitLabelChange,
|
|
148
|
-
showDescription = _this$props2.showDescription,
|
|
149
|
-
showLevelTagInput = _this$props2.showLevelTagInput,
|
|
150
|
-
maxPoints = _this$props2.maxPoints,
|
|
151
|
-
updateMaxPointsFieldValue = _this$props2.updateMaxPointsFieldValue,
|
|
152
|
-
scaleIndex = _this$props2.scaleIndex,
|
|
153
|
-
showScorePointLabels = _this$props2.showScorePointLabels,
|
|
154
|
-
secondaryBlockWidth = _this$props2.secondaryBlockWidth,
|
|
155
|
-
setSecondaryBlockRef = _this$props2.setSecondaryBlockRef,
|
|
156
|
-
spellCheck = _this$props2.spellCheck,
|
|
157
|
-
uploadSoundSupport = _this$props2.uploadSoundSupport,
|
|
158
|
-
maxPointsEnabled = _this$props2.maxPointsEnabled,
|
|
159
|
-
_this$props2$mathMlOp = _this$props2.mathMlOptions,
|
|
160
|
-
mathMlOptions = _this$props2$mathMlOp === void 0 ? {} : _this$props2$mathMlOp,
|
|
161
|
-
_this$props2$errors = _this$props2.errors,
|
|
162
|
-
errors = _this$props2$errors === void 0 ? {} : _this$props2$errors,
|
|
163
|
-
maxMaxPoints = _this$props2.maxMaxPoints,
|
|
164
|
-
_this$props2$labelPlu = _this$props2.labelPluginProps,
|
|
165
|
-
labelPluginProps = _this$props2$labelPlu === void 0 ? {} : _this$props2$labelPlu;
|
|
166
|
-
var anchorEl = this.state.anchorEl;
|
|
167
|
-
return /*#__PURE__*/_react["default"].createElement(_common.Row, {
|
|
168
|
-
className: classes.greyHeader,
|
|
169
|
-
height: showLevelTagInput ? _common.HeaderHeightLarge : _common.HeaderHeight
|
|
170
|
-
}, /*#__PURE__*/_react["default"].createElement(_common.PrimaryBlock, {
|
|
171
|
-
className: classes.primaryBlockGreyHeader
|
|
172
|
-
}, showLevelTagInput && /*#__PURE__*/_react["default"].createElement(_common.SimpleInput, {
|
|
173
|
-
markup: traitLabel || 'Trait',
|
|
174
|
-
onChange: onTraitLabelChange,
|
|
175
|
-
pluginProps: labelPluginProps,
|
|
176
|
-
spellCheck: spellCheck,
|
|
177
|
-
label: "Level Label",
|
|
178
|
-
uploadSoundSupport: uploadSoundSupport,
|
|
179
|
-
mathMlOptions: mathMlOptions
|
|
180
|
-
}), /*#__PURE__*/_react["default"].createElement(_common.ScaleSettings, null, /*#__PURE__*/_react["default"].createElement("div", null, "Scale ", scaleIndex + 1), maxPointsEnabled && /*#__PURE__*/_react["default"].createElement(_common.MaxPointsPicker, {
|
|
181
|
-
maxPoints: maxPoints,
|
|
182
|
-
maxMaxPoints: maxMaxPoints,
|
|
183
|
-
onChange: updateMaxPointsFieldValue
|
|
184
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
185
|
-
"aria-label": "more",
|
|
186
|
-
"aria-controls": "long-menu",
|
|
187
|
-
"aria-haspopup": "true",
|
|
188
|
-
onClick: this.handleClick
|
|
189
|
-
}, /*#__PURE__*/_react["default"].createElement(_MoreVert["default"], null)), /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
|
|
190
|
-
id: "long-menu",
|
|
191
|
-
anchorEl: anchorEl,
|
|
192
|
-
keepMounted: true,
|
|
193
|
-
open: !!anchorEl,
|
|
194
|
-
onClose: this.handleClose
|
|
195
|
-
}, ['Remove Scale'].map(function (option) {
|
|
196
|
-
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
197
|
-
key: option,
|
|
198
|
-
onClick: _this2.openMenu
|
|
199
|
-
}, option);
|
|
200
|
-
}))))), /*#__PURE__*/_react["default"].createElement(_common.SecondaryBlock, {
|
|
201
|
-
setRef: function setRef(ref) {
|
|
202
|
-
if (ref) {
|
|
203
|
-
_this2.secondaryBlock = ref;
|
|
204
|
-
setSecondaryBlockRef(ref);
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
width: "".concat(secondaryBlockWidth, "px")
|
|
208
|
-
}, showStandards && /*#__PURE__*/_react["default"].createElement(_common.Block, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
209
|
-
className: classes.label
|
|
210
|
-
}, "Standard(s)")), showDescription && /*#__PURE__*/_react["default"].createElement(_common.Block, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
211
|
-
className: classes.label
|
|
212
|
-
}, "Description")), scorePointsValues.map(function (scorePointsValue, index) {
|
|
213
|
-
var adjustedBlockWidth = _common.BlockWidth + 2 * 8; // 8 is padding
|
|
214
|
-
|
|
215
|
-
var remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 128;
|
|
216
|
-
var value = scorePointsValues.length - index - 1;
|
|
217
|
-
var scoreDescriptor;
|
|
218
|
-
var error;
|
|
219
|
-
|
|
220
|
-
try {
|
|
221
|
-
scoreDescriptor = scorePointsLabels[value] || '';
|
|
222
|
-
error = errors[value] || '';
|
|
223
|
-
} catch (e) {
|
|
224
|
-
scoreDescriptor = '';
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return /*#__PURE__*/_react["default"].createElement(_common.Block, {
|
|
228
|
-
key: "secondary-block-part-".concat(index)
|
|
229
|
-
}, /*#__PURE__*/_react["default"].createElement(_common.ScorePoint, {
|
|
230
|
-
scorePointsValue: scorePointsValue,
|
|
231
|
-
error: error,
|
|
232
|
-
scoreDescriptor: scoreDescriptor,
|
|
233
|
-
pluginProps: labelPluginProps,
|
|
234
|
-
showScorePointLabels: showScorePointLabels,
|
|
235
|
-
onChange: function onChange(scorePointLabel) {
|
|
236
|
-
return _this2.onScorePointLabelChange({
|
|
237
|
-
scorePointLabel: scorePointLabel,
|
|
238
|
-
value: value
|
|
239
|
-
});
|
|
240
|
-
},
|
|
241
|
-
alignToRight: remainingSpace < 296 && scorePointsValue < maxPoints // 296 is the space required for the toolbar
|
|
242
|
-
,
|
|
243
|
-
spellCheck: spellCheck,
|
|
244
|
-
uploadSoundSupport: uploadSoundSupport,
|
|
245
|
-
mathMlOptions: mathMlOptions
|
|
246
|
-
}), error && /*#__PURE__*/_react["default"].createElement("div", {
|
|
247
|
-
className: classes.errorText
|
|
248
|
-
}, error));
|
|
249
|
-
})));
|
|
250
|
-
}
|
|
251
|
-
}]);
|
|
252
|
-
return TraitsHeaderTile;
|
|
253
|
-
}(_react["default"].Component);
|
|
254
|
-
|
|
255
|
-
exports.TraitsHeaderTile = TraitsHeaderTile;
|
|
256
|
-
(0, _defineProperty2["default"])(TraitsHeaderTile, "propTypes", {
|
|
257
|
-
maxPointsEnabled: _propTypes["default"].bool,
|
|
258
|
-
spellCheck: _propTypes["default"].bool,
|
|
259
|
-
errors: _propTypes["default"].object
|
|
260
|
-
});
|
|
261
|
-
TraitsHeaderTile.propTypes = {
|
|
262
|
-
classes: _propTypes["default"].object.isRequired,
|
|
263
|
-
onTraitLabelChange: _propTypes["default"].func,
|
|
264
|
-
onScaleChange: _propTypes["default"].func,
|
|
265
|
-
scorePointsValues: _propTypes["default"].arrayOf(_propTypes["default"].number),
|
|
266
|
-
scorePointsLabels: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
267
|
-
traitLabel: _propTypes["default"].string,
|
|
268
|
-
showStandards: _propTypes["default"].bool,
|
|
269
|
-
showLevelTagInput: _propTypes["default"].bool,
|
|
270
|
-
showDescription: _propTypes["default"].bool,
|
|
271
|
-
maxPoints: _propTypes["default"].number,
|
|
272
|
-
updateMaxPointsFieldValue: _propTypes["default"].func,
|
|
273
|
-
scaleIndex: _propTypes["default"].number,
|
|
274
|
-
currentPosition: _propTypes["default"].number,
|
|
275
|
-
secondaryBlockWidth: _propTypes["default"].number,
|
|
276
|
-
showDeleteScaleModal: _propTypes["default"].func,
|
|
277
|
-
showScorePointLabels: _propTypes["default"].bool,
|
|
278
|
-
setSecondaryBlockRef: _propTypes["default"].func,
|
|
279
|
-
uploadSoundSupport: _propTypes["default"].object,
|
|
280
|
-
maxMaxPoints: _propTypes["default"].number,
|
|
281
|
-
labelPluginProps: _propTypes["default"].object
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
var _default = (0, _styles.withStyles)(styles)(TraitsHeaderTile);
|
|
285
|
-
|
|
286
|
-
exports["default"] = _default;
|
|
287
|
-
//# sourceMappingURL=traitsHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/traitsHeader.jsx"],"names":["styles","theme","label","textAlign","width","border","margin","spacing","unit","padding","display","alignItems","justifyContent","greyHeader","background","color","secondaryBackground","borderRadius","position","marginBottom","primaryBlockGreyHeader","paddingTop","errorText","fontSize","typography","palette","error","main","TraitsHeaderTile","anchorEl","scorePointLabel","value","props","scorePointsLabels","onScaleChange","length","event","setState","currentTarget","secondaryBlock","scrollTo","left","showDeleteScaleModal","handleClose","nextProps","currentPosition","scrollToPosition","scorePointsValues","traitLabel","classes","showStandards","onTraitLabelChange","showDescription","showLevelTagInput","maxPoints","updateMaxPointsFieldValue","scaleIndex","showScorePointLabels","secondaryBlockWidth","setSecondaryBlockRef","spellCheck","uploadSoundSupport","maxPointsEnabled","mathMlOptions","errors","maxMaxPoints","labelPluginProps","state","HeaderHeightLarge","HeaderHeight","handleClick","map","option","openMenu","ref","scorePointsValue","index","adjustedBlockWidth","BlockWidth","remainingSpace","scoreDescriptor","e","onScorePointLabelChange","React","Component","PropTypes","bool","object","propTypes","isRequired","func","arrayOf","number","string"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAcA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,SAAS,EAAE,QADN;AAELC,MAAAA,KAAK,EAAE,OAFF;AAGLC,MAAAA,MAAM,EAAE,MAHH;AAILC,MAAAA,MAAM,EAAEL,KAAK,CAACM,OAAN,CAAcC,IAJjB;AAKLC,MAAAA,OAAO,EAAE,QALJ;AAMLC,MAAAA,OAAO,EAAE,MANJ;AAOLC,MAAAA,UAAU,EAAE,QAPP;AAQLC,MAAAA,cAAc,EAAE;AARX,KADkB;AAWzBC,IAAAA,UAAU,EAAE;AACVC,MAAAA,UAAU,EAAEC,gBAAMC,mBAAN,EADF;AAEVC,MAAAA,YAAY,EAAE,KAFJ;AAGVC,MAAAA,QAAQ,EAAE,UAHA;AAIVC,MAAAA,YAAY,EAAElB,KAAK,CAACM,OAAN,CAAcC,IAAd,GAAqB;AAJzB,KAXa;AAiBzBY,IAAAA,sBAAsB,EAAE;AACtBC,MAAAA,UAAU,EAAEpB,KAAK,CAACM,OAAN,CAAcC,IAAd,GAAqB;AADX,KAjBC;AAoBzBc,IAAAA,SAAS,EAAE;AACTC,MAAAA,QAAQ,EAAEtB,KAAK,CAACuB,UAAN,CAAiBD,QAAjB,GAA4B,CAD7B;AAETR,MAAAA,KAAK,EAAEd,KAAK,CAACwB,OAAN,CAAcC,KAAd,CAAoBC,IAFlB;AAGTN,MAAAA,UAAU,EAAEpB,KAAK,CAACM,OAAN,CAAcC,IAAd,GAAqB;AAHxB;AApBc,GAAZ;AAAA,CAAf;;IA2BaoB,gB;;;;;;;;;;;;;;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UE,MAlBH;AAmB3BtB,EAAAA,YAAY,EAAEoB,sBAAUO,MAnBG;AAoB3B1B,EAAAA,gBAAgB,EAAEmB,sBAAUE;AApBD,CAA7B;;eAuBe,wBAAWvF,MAAX,EAAmB4B,gBAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport IconButton from '@material-ui/core/IconButton';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport { color } from '@pie-lib/pie-toolbox/render-ui';\n\nimport {\n Block,\n BlockWidth,\n PrimaryBlock,\n Row,\n SecondaryBlock,\n ScorePoint,\n MaxPointsPicker,\n SimpleInput,\n ScaleSettings,\n HeaderHeight,\n HeaderHeightLarge,\n} from './common';\n\nconst styles = (theme) => ({\n label: {\n textAlign: 'center',\n width: '140px',\n border: 'none',\n margin: theme.spacing.unit,\n padding: '10px 0',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-around',\n },\n greyHeader: {\n background: color.secondaryBackground(),\n borderRadius: '4px',\n position: 'relative',\n marginBottom: theme.spacing.unit * 2,\n },\n primaryBlockGreyHeader: {\n paddingTop: theme.spacing.unit * 1.5,\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit / 2,\n },\n});\n\nexport class TraitsHeaderTile extends React.Component {\n static propTypes = {\n maxPointsEnabled: PropTypes.bool,\n spellCheck: PropTypes.bool,\n errors: PropTypes.object,\n };\n\n state = {\n anchorEl: null,\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.currentPosition !== this.props.currentPosition) {\n this.scrollToPosition(nextProps.currentPosition);\n }\n }\n\n onScorePointLabelChange = ({ scorePointLabel, value }) => {\n const { scorePointsLabels, onScaleChange } = this.props;\n\n if (value < 0 || value >= scorePointsLabels.length) return;\n\n scorePointsLabels[value] = scorePointLabel;\n\n onScaleChange({ scorePointsLabels });\n };\n\n handleClick = (event) => this.setState({ anchorEl: event.currentTarget });\n\n handleClose = () => this.setState({ anchorEl: null });\n\n scrollToPosition = (position) => this.secondaryBlock.scrollTo({ left: position });\n\n openMenu = () => {\n this.props.showDeleteScaleModal();\n this.handleClose();\n };\n\n render() {\n const {\n scorePointsValues,\n scorePointsLabels,\n traitLabel,\n classes,\n currentPosition,\n showStandards,\n onTraitLabelChange,\n showDescription,\n showLevelTagInput,\n maxPoints,\n updateMaxPointsFieldValue,\n scaleIndex,\n showScorePointLabels,\n secondaryBlockWidth,\n setSecondaryBlockRef,\n spellCheck,\n uploadSoundSupport,\n maxPointsEnabled,\n mathMlOptions = {},\n errors = {},\n maxMaxPoints,\n labelPluginProps = {},\n } = this.props;\n const { anchorEl } = this.state;\n\n return (\n <Row className={classes.greyHeader} height={showLevelTagInput ? HeaderHeightLarge : HeaderHeight}>\n <PrimaryBlock className={classes.primaryBlockGreyHeader}>\n {showLevelTagInput && (\n <SimpleInput\n markup={traitLabel || 'Trait'}\n onChange={onTraitLabelChange}\n pluginProps={labelPluginProps}\n spellCheck={spellCheck}\n label=\"Level Label\"\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n />\n )}\n\n <ScaleSettings>\n <div>Scale {scaleIndex + 1}</div>\n\n {maxPointsEnabled && (\n <MaxPointsPicker maxPoints={maxPoints} maxMaxPoints={maxMaxPoints} onChange={updateMaxPointsFieldValue} />\n )}\n\n <div>\n <IconButton aria-label=\"more\" aria-controls=\"long-menu\" aria-haspopup=\"true\" onClick={this.handleClick}>\n <MoreVertIcon />\n </IconButton>\n <Menu id=\"long-menu\" anchorEl={anchorEl} keepMounted open={!!anchorEl} onClose={this.handleClose}>\n {['Remove Scale'].map((option) => (\n <MenuItem key={option} onClick={this.openMenu}>\n {option}\n </MenuItem>\n ))}\n </Menu>\n </div>\n </ScaleSettings>\n </PrimaryBlock>\n\n <SecondaryBlock\n setRef={(ref) => {\n if (ref) {\n this.secondaryBlock = ref;\n setSecondaryBlockRef(ref);\n }\n }}\n width={`${secondaryBlockWidth}px`}\n >\n {showStandards && (\n <Block>\n <div className={classes.label}>Standard(s)</div>\n </Block>\n )}\n\n {showDescription && (\n <Block>\n <div className={classes.label}>Description</div>\n </Block>\n )}\n\n {scorePointsValues.map((scorePointsValue, index) => {\n const adjustedBlockWidth = BlockWidth + 2 * 8; // 8 is padding\n const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 128;\n const value = scorePointsValues.length - index - 1;\n let scoreDescriptor;\n let error;\n\n try {\n scoreDescriptor = scorePointsLabels[value] || '';\n error = errors[value] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <Block key={`secondary-block-part-${index}`}>\n <ScorePoint\n scorePointsValue={scorePointsValue}\n error={error}\n scoreDescriptor={scoreDescriptor}\n pluginProps={labelPluginProps}\n showScorePointLabels={showScorePointLabels}\n onChange={(scorePointLabel) => this.onScorePointLabelChange({ scorePointLabel, value })}\n alignToRight={remainingSpace < 296 && scorePointsValue < maxPoints} // 296 is the space required for the toolbar\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n />\n {error && <div className={classes.errorText}>{error}</div>}\n </Block>\n );\n })}\n </SecondaryBlock>\n </Row>\n );\n }\n}\n\nTraitsHeaderTile.propTypes = {\n classes: PropTypes.object.isRequired,\n onTraitLabelChange: PropTypes.func,\n onScaleChange: PropTypes.func,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n showStandards: PropTypes.bool,\n showLevelTagInput: PropTypes.bool,\n showDescription: PropTypes.bool,\n maxPoints: PropTypes.number,\n updateMaxPointsFieldValue: PropTypes.func,\n scaleIndex: PropTypes.number,\n currentPosition: PropTypes.number,\n secondaryBlockWidth: PropTypes.number,\n showDeleteScaleModal: PropTypes.func,\n showScorePointLabels: PropTypes.bool,\n setSecondaryBlockRef: PropTypes.func,\n uploadSoundSupport: PropTypes.object,\n maxMaxPoints: PropTypes.number,\n labelPluginProps: PropTypes.object,\n};\n\nexport default withStyles(styles)(TraitsHeaderTile);\n"],"file":"traitsHeader.js"}
|
package/configure/lib/utils.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.filteredDefaultPlugins = void 0;
|
|
7
|
-
|
|
8
|
-
var _editableHtml = require("@pie-lib/pie-toolbox/editable-html");
|
|
9
|
-
|
|
10
|
-
var filteredDefaultPlugins = (_editableHtml.DEFAULT_PLUGINS || []).filter(function (p) {
|
|
11
|
-
return p !== 'table' && p !== 'bulleted-list' && p !== 'numbered-list';
|
|
12
|
-
});
|
|
13
|
-
exports.filteredDefaultPlugins = filteredDefaultPlugins;
|
|
14
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils.js"],"names":["filteredDefaultPlugins","DEFAULT_PLUGINS","filter","p"],"mappings":";;;;;;;AAAA;;AAEO,IAAMA,sBAAsB,GAAG,CAACC,iCAAmB,EAApB,EAAwBC,MAAxB,CACpC,UAACC,CAAD;AAAA,SAAOA,CAAC,KAAK,OAAN,IAAiBA,CAAC,KAAK,eAAvB,IAA0CA,CAAC,KAAK,eAAvD;AAAA,CADoC,CAA/B","sourcesContent":["import { DEFAULT_PLUGINS } from '@pie-lib/pie-toolbox/editable-html';\n\nexport const filteredDefaultPlugins = (DEFAULT_PLUGINS || []).filter(\n (p) => p !== 'table' && p !== 'bulleted-list' && p !== 'numbered-list',\n);\n"],"file":"utils.js"}
|
|
@@ -1,94 +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
|
-
visibleToStudent: true,
|
|
10
|
-
halfScoring: false,
|
|
11
|
-
pointLabels: true,
|
|
12
|
-
description: false,
|
|
13
|
-
standards: false,
|
|
14
|
-
scales: [],
|
|
15
|
-
excludeZero: false,
|
|
16
|
-
maxPointsEnabled: true,
|
|
17
|
-
addScaleEnabled: true
|
|
18
|
-
},
|
|
19
|
-
configuration: {
|
|
20
|
-
excludeZeroDialogBoxContent: {
|
|
21
|
-
title: 'Exclude 0 (Zero) from Score Point Values.',
|
|
22
|
-
text: "<div>\n You are about to exclude 0 from score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the left\n </li>\n <li>\n remove 0 column with its Label and Description\n </li>\n </ul>\n </div>"
|
|
23
|
-
},
|
|
24
|
-
includeZeroDialogBoxContent: {
|
|
25
|
-
title: 'Include 0 (Zero) in Score Point Values.',
|
|
26
|
-
text: "<div>\n You are about to include 0 in score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the right\n </li>\n <li>\n add 0 column with empty Label and Descriptions\n </li>\n </ul>\n </div>"
|
|
27
|
-
},
|
|
28
|
-
deleteScaleDialogBoxContent: {
|
|
29
|
-
title: 'Delete Scale',
|
|
30
|
-
text: 'Are you sure you want to delete this scale?'
|
|
31
|
-
},
|
|
32
|
-
maxPointsDialogBoxContent: {
|
|
33
|
-
title: 'Decreasing Max Points.',
|
|
34
|
-
text: " You are about to decrease max score point value.\n <br/>\n All the Labels and Descriptions for scores above Max Point will be deleted."
|
|
35
|
-
},
|
|
36
|
-
settingsPanelDisabled: false,
|
|
37
|
-
spellCheck: {
|
|
38
|
-
label: 'Spellcheck',
|
|
39
|
-
settings: false,
|
|
40
|
-
enabled: true
|
|
41
|
-
},
|
|
42
|
-
showExcludeZero: {
|
|
43
|
-
settings: true,
|
|
44
|
-
label: 'Exclude Zero'
|
|
45
|
-
},
|
|
46
|
-
showScorePointLabels: {
|
|
47
|
-
settings: true,
|
|
48
|
-
label: 'Show Score Point Labels'
|
|
49
|
-
},
|
|
50
|
-
showDescription: {
|
|
51
|
-
settings: true,
|
|
52
|
-
label: 'Show Description'
|
|
53
|
-
},
|
|
54
|
-
showVisibleToStudent: {
|
|
55
|
-
settings: true,
|
|
56
|
-
label: 'Visible to Student'
|
|
57
|
-
},
|
|
58
|
-
showHalfScoring: {
|
|
59
|
-
settings: true,
|
|
60
|
-
label: 'Half Scoring'
|
|
61
|
-
},
|
|
62
|
-
width: '900px',
|
|
63
|
-
// these should not be set to true (should not be used) for now
|
|
64
|
-
showStandards: {
|
|
65
|
-
settings: false,
|
|
66
|
-
label: 'Show Standards'
|
|
67
|
-
},
|
|
68
|
-
showLevelTagInput: {
|
|
69
|
-
settings: false,
|
|
70
|
-
label: 'Show Level Tag Input',
|
|
71
|
-
enabled: false
|
|
72
|
-
},
|
|
73
|
-
dragAndDrop: {
|
|
74
|
-
settings: true,
|
|
75
|
-
label: 'Enable Drag and Drop',
|
|
76
|
-
enabled: false
|
|
77
|
-
},
|
|
78
|
-
showMaxPoint: {
|
|
79
|
-
settings: true,
|
|
80
|
-
label: 'Show Max Points Dropdown'
|
|
81
|
-
},
|
|
82
|
-
addScale: {
|
|
83
|
-
settings: true,
|
|
84
|
-
label: 'Add Scale Available'
|
|
85
|
-
},
|
|
86
|
-
minNoOfTraits: 1,
|
|
87
|
-
maxNoOfTraits: 10,
|
|
88
|
-
minNoOfScales: 2,
|
|
89
|
-
maxNoOfScales: 10,
|
|
90
|
-
defaultTraitLabel: 'Trait'
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
exports["default"] = _default;
|
|
94
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","visibleToStudent","halfScoring","pointLabels","description","standards","scales","excludeZero","maxPointsEnabled","addScaleEnabled","configuration","excludeZeroDialogBoxContent","title","text","includeZeroDialogBoxContent","deleteScaleDialogBoxContent","maxPointsDialogBoxContent","settingsPanelDisabled","spellCheck","label","settings","enabled","showExcludeZero","showScorePointLabels","showDescription","showVisibleToStudent","showHalfScoring","width","showStandards","showLevelTagInput","dragAndDrop","showMaxPoint","addScale","minNoOfTraits","maxNoOfTraits","minNoOfScales","maxNoOfScales","defaultTraitLabel"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,gBAAgB,EAAE,IADb;AAELC,IAAAA,WAAW,EAAE,KAFR;AAGLC,IAAAA,WAAW,EAAE,IAHR;AAILC,IAAAA,WAAW,EAAE,KAJR;AAKLC,IAAAA,SAAS,EAAE,KALN;AAMLC,IAAAA,MAAM,EAAE,EANH;AAOLC,IAAAA,WAAW,EAAE,KAPR;AAQLC,IAAAA,gBAAgB,EAAE,IARb;AASLC,IAAAA,eAAe,EAAE;AATZ,GADM;AAYbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,2BAA2B,EAAE;AAC3BC,MAAAA,KAAK,EAAE,2CADoB;AAE3BC,MAAAA,IAAI;AAFuB,KADhB;AAmBbC,IAAAA,2BAA2B,EAAE;AAC3BF,MAAAA,KAAK,EAAE,yCADoB;AAE3BC,MAAAA,IAAI;AAFuB,KAnBhB;AAqCbE,IAAAA,2BAA2B,EAAE;AAC3BH,MAAAA,KAAK,EAAE,cADoB;AAE3BC,MAAAA,IAAI,EAAE;AAFqB,KArChB;AAyCbG,IAAAA,yBAAyB,EAAE;AACzBJ,MAAAA,KAAK,EAAE,wBADkB;AAEzBC,MAAAA,IAAI;AAFqB,KAzCd;AA+CbI,IAAAA,qBAAqB,EAAE,KA/CV;AAgDbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAE,KAFA;AAGVC,MAAAA,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a,EAAE,CAnGF;AAoGbC,IAAAA,aAAa,EAAE,EApGF;AAqGbC,IAAAA,iBAAiB,EAAE;AArGN;AAZF,C","sourcesContent":["export default {\n model: {\n visibleToStudent: true,\n halfScoring: false,\n pointLabels: true,\n description: false,\n standards: false,\n scales: [],\n excludeZero: false,\n maxPointsEnabled: true,\n addScaleEnabled: true,\n },\n configuration: {\n excludeZeroDialogBoxContent: {\n title: 'Exclude 0 (Zero) from Score Point Values.',\n text: `<div>\n You are about to exclude 0 from score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the left\n </li>\n <li>\n remove 0 column with its Label and Description\n </li>\n </ul>\n </div>`,\n },\n includeZeroDialogBoxContent: {\n title: 'Include 0 (Zero) in Score Point Values.',\n text: `<div>\n You are about to include 0 in score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the right\n </li>\n <li>\n add 0 column with empty Label and Descriptions\n </li>\n </ul>\n </div>`,\n },\n deleteScaleDialogBoxContent: {\n title: 'Delete Scale',\n text: 'Are you sure you want to delete this scale?',\n },\n maxPointsDialogBoxContent: {\n title: 'Decreasing Max Points.',\n text: ` You are about to decrease max score point value.\n <br/>\n All the Labels and Descriptions for scores above Max Point will be deleted.`,\n },\n settingsPanelDisabled: false,\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n showExcludeZero: {\n settings: true,\n label: 'Exclude Zero',\n },\n showScorePointLabels: {\n settings: true,\n label: 'Show Score Point Labels',\n },\n showDescription: {\n settings: true,\n label: 'Show Description',\n },\n showVisibleToStudent: {\n settings: true,\n label: 'Visible to Student',\n },\n showHalfScoring: {\n settings: true,\n label: 'Half Scoring',\n },\n width: '900px',\n // these should not be set to true (should not be used) for now\n showStandards: {\n settings: false,\n label: 'Show Standards',\n },\n showLevelTagInput: {\n settings: false,\n label: 'Show Level Tag Input',\n enabled: false,\n },\n dragAndDrop: {\n settings: true,\n label: 'Enable Drag and Drop',\n enabled: false,\n },\n showMaxPoint: {\n settings: true,\n label: 'Show Max Points Dropdown',\n },\n addScale: {\n settings: true,\n label: 'Add Scale Available',\n },\n minNoOfTraits: 1,\n maxNoOfTraits: 10,\n minNoOfScales: 2,\n maxNoOfScales: 10,\n defaultTraitLabel: 'Trait',\n },\n};\n"],"file":"defaults.js"}
|
package/controller/lib/index.js
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createCorrectResponseSession = void 0;
|
|
9
|
-
exports.createDefaultModel = createDefaultModel;
|
|
10
|
-
exports.getScore = void 0;
|
|
11
|
-
exports.model = model;
|
|
12
|
-
exports.normalize = void 0;
|
|
13
|
-
exports.outcome = outcome;
|
|
14
|
-
exports.validate = void 0;
|
|
15
|
-
|
|
16
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
17
|
-
|
|
18
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
-
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
|
-
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
23
|
-
|
|
24
|
-
var _utils = require("./utils");
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
|
-
function createDefaultModel() {
|
|
31
|
-
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
32
|
-
return new Promise(function (resolve) {
|
|
33
|
-
return resolve(_objectSpread(_objectSpread({}, _defaults["default"]), model));
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var normalize = function normalize(question) {
|
|
38
|
-
return _objectSpread(_objectSpread({}, _defaults["default"]), question);
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {*} question
|
|
43
|
-
* @param {*} session
|
|
44
|
-
* @param {*} env
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
exports.normalize = normalize;
|
|
49
|
-
|
|
50
|
-
function model(_x, _x2, _x3) {
|
|
51
|
-
return _model.apply(this, arguments);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _model() {
|
|
55
|
-
_model = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(question, session, env) {
|
|
56
|
-
var normalizedQuestion, _ref, scales, excludeZero, parsedScales;
|
|
57
|
-
|
|
58
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
59
|
-
while (1) {
|
|
60
|
-
switch (_context.prev = _context.next) {
|
|
61
|
-
case 0:
|
|
62
|
-
normalizedQuestion = normalize(question);
|
|
63
|
-
|
|
64
|
-
if (!env.role || env.role === 'student') {
|
|
65
|
-
normalizedQuestion.visible = normalizedQuestion.visibleToStudent;
|
|
66
|
-
} else {
|
|
67
|
-
normalizedQuestion.visible = true;
|
|
68
|
-
} // todo update pie-ui instead of parsing this here:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
_ref = normalizedQuestion || {}, scales = _ref.scales, excludeZero = _ref.excludeZero;
|
|
72
|
-
parsedScales = (scales || []).map(function (scale) {
|
|
73
|
-
return _objectSpread(_objectSpread({}, scale), {}, {
|
|
74
|
-
excludeZero: excludeZero
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
return _context.abrupt("return", _objectSpread(_objectSpread({}, normalizedQuestion), {}, {
|
|
78
|
-
scales: parsedScales
|
|
79
|
-
}));
|
|
80
|
-
|
|
81
|
-
case 5:
|
|
82
|
-
case "end":
|
|
83
|
-
return _context.stop();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}, _callee);
|
|
87
|
-
}));
|
|
88
|
-
return _model.apply(this, arguments);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var getScore = function getScore() {
|
|
92
|
-
return 0;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* @param {Object} model - the main model
|
|
96
|
-
* @param {*} session
|
|
97
|
-
* @param {Object} env
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
exports.getScore = getScore;
|
|
102
|
-
|
|
103
|
-
function outcome() {
|
|
104
|
-
return new Promise(function (resolve) {
|
|
105
|
-
return resolve({
|
|
106
|
-
score: 0,
|
|
107
|
-
empty: true
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
var createCorrectResponseSession = function createCorrectResponseSession(question, env) {
|
|
113
|
-
return new Promise(function (resolve) {
|
|
114
|
-
if (env.mode !== 'evaluate' && env.role === 'instructor') {
|
|
115
|
-
resolve({
|
|
116
|
-
id: '1'
|
|
117
|
-
});
|
|
118
|
-
} else {
|
|
119
|
-
resolve(null);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}; // IMPORTANT! If you make any changes to this function, please make sure you also update complex-rubric/controller/validateMultiTraitRubric function!“.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
exports.createCorrectResponseSession = createCorrectResponseSession;
|
|
126
|
-
|
|
127
|
-
var validate = function validate(model, config) {
|
|
128
|
-
var scales = model.scales,
|
|
129
|
-
_model$description = model.description,
|
|
130
|
-
description = _model$description === void 0 ? false : _model$description,
|
|
131
|
-
_model$pointLabels = model.pointLabels,
|
|
132
|
-
pointLabels = _model$pointLabels === void 0 ? false : _model$pointLabels;
|
|
133
|
-
var errors = {};
|
|
134
|
-
var traitsErrors = {};
|
|
135
|
-
var scorePointsErrors = {};
|
|
136
|
-
(scales || []).forEach(function (scale, scaleIndex) {
|
|
137
|
-
var _scale$traits = scale.traits,
|
|
138
|
-
traits = _scale$traits === void 0 ? [] : _scale$traits;
|
|
139
|
-
var _scale$scorePointsLab = scale.scorePointsLabels,
|
|
140
|
-
scorePointsLabels = _scale$scorePointsLab === void 0 ? [] : _scale$scorePointsLab;
|
|
141
|
-
var scaleErrors = {};
|
|
142
|
-
var scorePointsLabelsErrors = {};
|
|
143
|
-
|
|
144
|
-
if (pointLabels) {
|
|
145
|
-
scorePointsLabels.forEach(function (scorePointLabel, scoreIndex) {
|
|
146
|
-
if (!scorePointLabel || scorePointLabel === '<div></div>') {
|
|
147
|
-
scorePointsLabelsErrors[scoreIndex] = 'Points labels should not be empty.';
|
|
148
|
-
} else {
|
|
149
|
-
var identicalScorePointLabel = scorePointsLabels.slice(scoreIndex + 1).some(function (s) {
|
|
150
|
-
return (0, _utils.markupToText)(s) === (0, _utils.markupToText)(scorePointLabel);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
if (identicalScorePointLabel) {
|
|
154
|
-
scorePointsLabelsErrors[scoreIndex] = 'Points labels should be unique.';
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (Object.keys(scorePointsLabelsErrors).length > 0) {
|
|
161
|
-
scorePointsErrors[scaleIndex] = scorePointsLabelsErrors;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
traits.forEach(function (trait, traitIndex) {
|
|
165
|
-
if (!trait.name || trait.name === '<div></div>') {
|
|
166
|
-
scaleErrors[traitIndex] = {
|
|
167
|
-
name: 'Trait names should not be empty.'
|
|
168
|
-
};
|
|
169
|
-
} else {
|
|
170
|
-
var identicalTraitName = traits.slice(traitIndex + 1).some(function (t) {
|
|
171
|
-
return (0, _utils.markupToText)(t.name) === (0, _utils.markupToText)(trait.name);
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
if (identicalTraitName) {
|
|
175
|
-
scaleErrors[traitIndex] = {
|
|
176
|
-
name: 'Trait names should be unique.'
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (description && (!trait.description || trait.description === '<div></div>')) {
|
|
182
|
-
scaleErrors[traitIndex] = _objectSpread(_objectSpread({}, scaleErrors[traitIndex]), {}, {
|
|
183
|
-
description: 'Trait description should not be empty'
|
|
184
|
-
});
|
|
185
|
-
} else {
|
|
186
|
-
var identicalTraitDescr = traits.slice(traitIndex + 1).some(function (t) {
|
|
187
|
-
return (0, _utils.markupToText)(t.description) === (0, _utils.markupToText)(trait.description);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
if (description && identicalTraitDescr) {
|
|
191
|
-
scaleErrors[traitIndex] = _objectSpread(_objectSpread({}, scaleErrors[traitIndex]), {}, {
|
|
192
|
-
description: 'Trait descriptions should be unique.'
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
if (Object.keys(scaleErrors).length > 0) {
|
|
199
|
-
traitsErrors[scaleIndex] = scaleErrors;
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
if (Object.keys(traitsErrors).length > 0) {
|
|
204
|
-
errors.traitsErrors = traitsErrors;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (Object.keys(scorePointsErrors).length > 0) {
|
|
208
|
-
errors.scorePointsErrors = scorePointsErrors;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return errors;
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
exports.validate = validate;
|
|
215
|
-
//# sourceMappingURL=index.js.map
|