@pie-element/complex-rubric 2.4.2-next.21 → 2.4.2-next.22
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/controller/package.json +1 -1
- package/package.json +4 -4
- package/configure/lib/defaults.js +0 -140
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -241
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -221
- package/configure/lib/main.js.map +0 -1
- package/controller/lib/defaults.js +0 -134
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -307
- 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 -232
- package/lib/index.js.map +0 -1
- package/lib/print.js +0 -201
- package/lib/print.js.map +0 -1
- package/module/configure.js +0 -233166
- package/module/controller.js +0 -379
- package/module/demo.js +0 -221
- package/module/element.js +0 -230974
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -259
- package/module/print.html +0 -18
- package/module/print.js +0 -230946
package/configure/lib/main.js
DELETED
|
@@ -1,221 +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.Main = 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 _rubric = require("@pie-lib/pie-toolbox/rubric");
|
|
29
|
-
|
|
30
|
-
var _configUi = require("@pie-lib/pie-toolbox/config-ui");
|
|
31
|
-
|
|
32
|
-
var _Radio = _interopRequireDefault(require("@material-ui/core/Radio"));
|
|
33
|
-
|
|
34
|
-
var _RadioGroup = _interopRequireDefault(require("@material-ui/core/RadioGroup"));
|
|
35
|
-
|
|
36
|
-
var _FormControlLabel = _interopRequireDefault(require("@material-ui/core/FormControlLabel"));
|
|
37
|
-
|
|
38
|
-
var _styles = require("@material-ui/core/styles");
|
|
39
|
-
|
|
40
|
-
var _rubricLabels;
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
|
-
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); }; }
|
|
47
|
-
|
|
48
|
-
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; } }
|
|
49
|
-
|
|
50
|
-
var styles = {
|
|
51
|
-
root: {
|
|
52
|
-
width: 'fit-content',
|
|
53
|
-
paddingRight: '24px',
|
|
54
|
-
boxSizing: 'border-box',
|
|
55
|
-
'&:hover': {
|
|
56
|
-
background: 'var(--pie-secondary-background, rgba(241,241,241,1))'
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var rubricLabels = (_rubricLabels = {}, (0, _defineProperty2["default"])(_rubricLabels, _rubric.RUBRIC_TYPES.MULTI_TRAIT_RUBRIC, 'Multi Trait Rubric'), (0, _defineProperty2["default"])(_rubricLabels, _rubric.RUBRIC_TYPES.SIMPLE_RUBRIC, 'Simple Rubric'), (0, _defineProperty2["default"])(_rubricLabels, _rubric.RUBRIC_TYPES.RUBRICLESS, 'Rubricless'), _rubricLabels);
|
|
61
|
-
|
|
62
|
-
var Main = /*#__PURE__*/function (_React$Component) {
|
|
63
|
-
(0, _inherits2["default"])(Main, _React$Component);
|
|
64
|
-
|
|
65
|
-
var _super = _createSuper(Main);
|
|
66
|
-
|
|
67
|
-
function Main() {
|
|
68
|
-
var _this;
|
|
69
|
-
|
|
70
|
-
(0, _classCallCheck2["default"])(this, Main);
|
|
71
|
-
|
|
72
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
|
-
args[_key] = arguments[_key];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
77
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onModelChanged", function (model) {
|
|
78
|
-
var onModelChanged = _this.props.onModelChanged;
|
|
79
|
-
return onModelChanged(model);
|
|
80
|
-
});
|
|
81
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChangeRubricType", function (e) {
|
|
82
|
-
var model = _this.props.model;
|
|
83
|
-
var rubricType = e.target.value;
|
|
84
|
-
|
|
85
|
-
_this.onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
86
|
-
rubricType: rubricType
|
|
87
|
-
}));
|
|
88
|
-
});
|
|
89
|
-
return _this;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
(0, _createClass2["default"])(Main, [{
|
|
93
|
-
key: "render",
|
|
94
|
-
value: function render() {
|
|
95
|
-
var _this2 = this;
|
|
96
|
-
|
|
97
|
-
var _this$props = this.props,
|
|
98
|
-
model = _this$props.model,
|
|
99
|
-
configuration = _this$props.configuration,
|
|
100
|
-
canUpdateModel = _this$props.canUpdateModel,
|
|
101
|
-
classes = _this$props.classes;
|
|
102
|
-
|
|
103
|
-
var _ref = model || {},
|
|
104
|
-
_ref$rubrics = _ref.rubrics,
|
|
105
|
-
rubrics = _ref$rubrics === void 0 ? {} : _ref$rubrics;
|
|
106
|
-
|
|
107
|
-
var rubricType = model.rubricType;
|
|
108
|
-
var _configuration$conten = configuration.contentDimensions,
|
|
109
|
-
contentDimensions = _configuration$conten === void 0 ? {} : _configuration$conten,
|
|
110
|
-
_configuration$rubric = configuration.rubricOptions,
|
|
111
|
-
rubricOptions = _configuration$rubric === void 0 ? [] : _configuration$rubric,
|
|
112
|
-
multiTraitRubric = configuration.multiTraitRubric,
|
|
113
|
-
simpleRubric = configuration.simpleRubric,
|
|
114
|
-
rubricless = configuration.rubricless,
|
|
115
|
-
width = configuration.width;
|
|
116
|
-
var rubricTag = '';
|
|
117
|
-
|
|
118
|
-
if (!rubricType) {
|
|
119
|
-
rubricType = _rubric.RUBRIC_TYPES.SIMPLE_RUBRIC;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
var isRubricTypeAvailable = rubricOptions.indexOf(rubricType) > -1;
|
|
123
|
-
|
|
124
|
-
if (canUpdateModel) {
|
|
125
|
-
switch (rubricType) {
|
|
126
|
-
case _rubric.RUBRIC_TYPES.SIMPLE_RUBRIC:
|
|
127
|
-
default:
|
|
128
|
-
rubricTag = /*#__PURE__*/_react["default"].createElement("rubric-configure", {
|
|
129
|
-
id: "simpleRubric",
|
|
130
|
-
key: "simple-rubric",
|
|
131
|
-
ref: function ref(_ref2) {
|
|
132
|
-
if (_ref2) {
|
|
133
|
-
_this2.simpleRubric = _ref2;
|
|
134
|
-
_this2.simpleRubric.model = _objectSpread(_objectSpread({}, rubrics.simpleRubric), {}, {
|
|
135
|
-
errors: model.errors || {}
|
|
136
|
-
});
|
|
137
|
-
_this2.simpleRubric.configuration = _objectSpread(_objectSpread({}, simpleRubric), {}, {
|
|
138
|
-
width: width
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
break;
|
|
144
|
-
|
|
145
|
-
case _rubric.RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:
|
|
146
|
-
rubricTag = /*#__PURE__*/_react["default"].createElement("multi-trait-rubric-configure", {
|
|
147
|
-
id: "multiTraitRubric",
|
|
148
|
-
key: "multi-trait-rubric",
|
|
149
|
-
ref: function ref(_ref3) {
|
|
150
|
-
if (_ref3) {
|
|
151
|
-
_this2.multiTraitRubric = _ref3;
|
|
152
|
-
_this2.multiTraitRubric.model = _objectSpread(_objectSpread({}, rubrics.multiTraitRubric), {}, {
|
|
153
|
-
errors: model.errors || {}
|
|
154
|
-
});
|
|
155
|
-
_this2.multiTraitRubric.configuration = _objectSpread(_objectSpread({}, multiTraitRubric), {}, {
|
|
156
|
-
width: width || multiTraitRubric.width
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
break;
|
|
162
|
-
|
|
163
|
-
case _rubric.RUBRIC_TYPES.RUBRICLESS:
|
|
164
|
-
rubricTag = /*#__PURE__*/_react["default"].createElement("rubric-configure", {
|
|
165
|
-
id: "rubricless",
|
|
166
|
-
key: "rubricless",
|
|
167
|
-
ref: function ref(_ref4) {
|
|
168
|
-
if (_ref4) {
|
|
169
|
-
_this2.rubricless = _ref4;
|
|
170
|
-
_this2.rubricless.model = rubrics.rubricless;
|
|
171
|
-
_this2.rubricless.configuration = _objectSpread(_objectSpread({}, rubricless), {}, {
|
|
172
|
-
width: width
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
182
|
-
dimensions: contentDimensions,
|
|
183
|
-
hideSettings: true,
|
|
184
|
-
settings: null
|
|
185
|
-
}, /*#__PURE__*/_react["default"].createElement(_RadioGroup["default"], {
|
|
186
|
-
"aria-label": "rubric-type",
|
|
187
|
-
name: "rubricType",
|
|
188
|
-
value: model.rubricType,
|
|
189
|
-
onChange: this.onChangeRubricType
|
|
190
|
-
}, rubricOptions.length > 1 && rubricOptions.map(function (availableRubric, i) {
|
|
191
|
-
return /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
192
|
-
key: i,
|
|
193
|
-
value: availableRubric,
|
|
194
|
-
control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], {
|
|
195
|
-
checked: rubricType === availableRubric
|
|
196
|
-
}),
|
|
197
|
-
label: rubricLabels[availableRubric],
|
|
198
|
-
classes: {
|
|
199
|
-
root: classes.root
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
})), isRubricTypeAvailable && rubricTag);
|
|
203
|
-
}
|
|
204
|
-
}]);
|
|
205
|
-
return Main;
|
|
206
|
-
}(_react["default"].Component);
|
|
207
|
-
|
|
208
|
-
exports.Main = Main;
|
|
209
|
-
(0, _defineProperty2["default"])(Main, "propTypes", {
|
|
210
|
-
classes: _propTypes["default"].object,
|
|
211
|
-
canUpdateModel: _propTypes["default"].bool,
|
|
212
|
-
configuration: _propTypes["default"].object,
|
|
213
|
-
model: _propTypes["default"].object,
|
|
214
|
-
onModelChanged: _propTypes["default"].func,
|
|
215
|
-
onConfigurationChanged: _propTypes["default"].func
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
var _default = (0, _styles.withStyles)(styles)(Main);
|
|
219
|
-
|
|
220
|
-
exports["default"] = _default;
|
|
221
|
-
//# sourceMappingURL=main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["styles","root","width","paddingRight","boxSizing","background","rubricLabels","RUBRIC_TYPES","MULTI_TRAIT_RUBRIC","SIMPLE_RUBRIC","RUBRICLESS","Main","model","onModelChanged","props","e","rubricType","target","value","configuration","canUpdateModel","classes","rubrics","contentDimensions","rubricOptions","multiTraitRubric","simpleRubric","rubricless","rubricTag","isRubricTypeAvailable","indexOf","ref","errors","onChangeRubricType","length","map","availableRubric","i","React","Component","PropTypes","object","bool","func","onConfigurationChanged"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG;AACbC,EAAAA,IAAI,EAAE;AACJC,IAAAA,KAAK,EAAE,aADH;AAEJC,IAAAA,YAAY,EAAE,MAFV;AAGJC,IAAAA,SAAS,EAAE,YAHP;AAIJ,eAAW;AACTC,MAAAA,UAAU,EAAE;AADH;AAJP;AADO,CAAf;AAUA,IA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AwBD;;;EApHuBU,kBAAMC,S;;;iCAAnB5B,I,eACQ;AACjBU,EAAAA,OAAO,EAAEmB,sBAAUC,MADF;AAEjBrB,EAAAA,cAAc,EAAEoB,sBAAUE,IAFT;AAGjBvB,EAAAA,aAAa,EAAEqB,sBAAUC,MAHR;AAIjB7B,EAAAA,KAAK,EAAE4B,sBAAUC,MAJA;AAKjB5B,EAAAA,cAAc,EAAE2B,sBAAUG,IALT;AAMjBC,EAAAA,sBAAsB,EAAEJ,sBAAUG;AANjB,C;;eAsHN,wBAAW3C,MAAX,EAAmBW,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { RUBRIC_TYPES } from '@pie-lib/pie-toolbox/rubric';\nimport { layout } from '@pie-lib/pie-toolbox/config-ui';\nimport Radio from '@material-ui/core/Radio';\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport { withStyles } from '@material-ui/core/styles';\n\nconst styles = {\n root: {\n width: 'fit-content',\n paddingRight: '24px',\n boxSizing: 'border-box',\n '&:hover': {\n background: 'var(--pie-secondary-background, rgba(241,241,241,1))'\n }\n }\n};\nconst rubricLabels = {\n [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: 'Multi Trait Rubric',\n [RUBRIC_TYPES.SIMPLE_RUBRIC]: 'Simple Rubric',\n [RUBRIC_TYPES.RUBRICLESS]: 'Rubricless',\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n canUpdateModel: PropTypes.bool,\n configuration: PropTypes.object,\n model: PropTypes.object,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n };\n\n onModelChanged = (model) => {\n const { onModelChanged } = this.props;\n\n return onModelChanged(model);\n };\n\n onChangeRubricType = (e) => {\n const { model } = this.props;\n\n const rubricType = e.target.value;\n this.onModelChanged({ ...model, rubricType });\n };\n\n render() {\n const { model, configuration, canUpdateModel, classes } = this.props;\n\n const { rubrics = {} } = model || {};\n let { rubricType } = model;\n const { contentDimensions = {}, rubricOptions = [], multiTraitRubric, simpleRubric, rubricless, width } = configuration;\n let rubricTag = '';\n\n if (!rubricType) {\n rubricType = RUBRIC_TYPES.SIMPLE_RUBRIC;\n }\n\n const isRubricTypeAvailable = rubricOptions.indexOf(rubricType) > -1;\n\n if (canUpdateModel) {\n switch (rubricType) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n rubricTag = (\n <rubric-configure\n id=\"simpleRubric\"\n key=\"simple-rubric\"\n ref={(ref) => {\n if (ref) {\n this.simpleRubric = ref;\n this.simpleRubric.model = {...rubrics.simpleRubric, errors: model.errors || {}};\n this.simpleRubric.configuration = { ...simpleRubric, width };\n }\n }}\n />\n );\n break;\n\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n rubricTag = (\n <multi-trait-rubric-configure\n id=\"multiTraitRubric\"\n key=\"multi-trait-rubric\"\n ref={(ref) => {\n if (ref) {\n this.multiTraitRubric = ref;\n\n this.multiTraitRubric.model = {...rubrics.multiTraitRubric, errors: model.errors || {} };\n this.multiTraitRubric.configuration = { ...multiTraitRubric, width: width || multiTraitRubric.width };\n }\n }}\n />\n );\n break;\n\n case RUBRIC_TYPES.RUBRICLESS:\n rubricTag = (\n <rubric-configure\n id=\"rubricless\"\n key=\"rubricless\"\n ref={(ref) => {\n if (ref) {\n this.rubricless = ref;\n\n this.rubricless.model = rubrics.rubricless;\n this.rubricless.configuration = { ...rubricless, width };\n }\n }}\n />\n );\n break;\n }\n }\n\n return (\n <layout.ConfigLayout dimensions={contentDimensions} hideSettings={true} settings={null}>\n <RadioGroup\n aria-label=\"rubric-type\"\n name=\"rubricType\"\n value={model.rubricType}\n onChange={this.onChangeRubricType}\n >\n {\n rubricOptions.length > 1 && rubricOptions.map((availableRubric, i)=>\n <FormControlLabel\n key={i}\n value={availableRubric}\n control={<Radio checked={rubricType === availableRubric} />}\n label={rubricLabels[availableRubric]}\n classes={{ root: classes.root }}\n />\n )\n }\n </RadioGroup>\n\n {isRubricTypeAvailable && rubricTag}\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var multiTraitDefaultModel = {
|
|
8
|
-
visibleToStudent: true,
|
|
9
|
-
halfScoring: false,
|
|
10
|
-
pointLabels: true,
|
|
11
|
-
description: false,
|
|
12
|
-
standards: false,
|
|
13
|
-
scales: [],
|
|
14
|
-
excludeZero: false
|
|
15
|
-
};
|
|
16
|
-
var rubricDefaultModel = {
|
|
17
|
-
points: ['', '', '', ''],
|
|
18
|
-
sampleAnswers: [null, null, null, null],
|
|
19
|
-
maxPoints: 4,
|
|
20
|
-
excludeZero: false
|
|
21
|
-
};
|
|
22
|
-
var rubriclessDefaultModel = {
|
|
23
|
-
maxPoints: 100,
|
|
24
|
-
excludeZero: false,
|
|
25
|
-
rubriclessInstructionEnabled: true
|
|
26
|
-
};
|
|
27
|
-
var multiTraitDefaultConfiguration = {
|
|
28
|
-
settingsPanelDisabled: false,
|
|
29
|
-
excludeZeroDialogBoxContent: {
|
|
30
|
-
title: 'Exclude 0 (Zero) from Score Point Values.',
|
|
31
|
-
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>"
|
|
32
|
-
},
|
|
33
|
-
includeZeroDialogBoxContent: {
|
|
34
|
-
title: 'Include 0 (Zero) in Score Point Values.',
|
|
35
|
-
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>"
|
|
36
|
-
},
|
|
37
|
-
deleteScaleDialogBoxContent: {
|
|
38
|
-
title: 'Delete Scale',
|
|
39
|
-
text: 'Are you sure you want to delete this scale?'
|
|
40
|
-
},
|
|
41
|
-
maxPointsDialogBoxContent: {
|
|
42
|
-
title: 'Decreasing Max Points.',
|
|
43
|
-
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."
|
|
44
|
-
},
|
|
45
|
-
spellCheck: {
|
|
46
|
-
label: 'Spellcheck',
|
|
47
|
-
settings: false,
|
|
48
|
-
enabled: true
|
|
49
|
-
},
|
|
50
|
-
showExcludeZero: {
|
|
51
|
-
settings: true,
|
|
52
|
-
label: 'Exclude Zero'
|
|
53
|
-
},
|
|
54
|
-
showScorePointLabels: {
|
|
55
|
-
settings: true,
|
|
56
|
-
label: 'Show Score Point Labels'
|
|
57
|
-
},
|
|
58
|
-
showDescription: {
|
|
59
|
-
settings: true,
|
|
60
|
-
label: 'Show Description'
|
|
61
|
-
},
|
|
62
|
-
showVisibleToStudent: {
|
|
63
|
-
settings: true,
|
|
64
|
-
label: 'Visible to Student'
|
|
65
|
-
},
|
|
66
|
-
showHalfScoring: {
|
|
67
|
-
settings: true,
|
|
68
|
-
label: 'Half Scoring'
|
|
69
|
-
},
|
|
70
|
-
width: '900px',
|
|
71
|
-
// these should not be set to true (should not be used) for now
|
|
72
|
-
showStandards: {
|
|
73
|
-
settings: false,
|
|
74
|
-
label: 'Show Standards'
|
|
75
|
-
},
|
|
76
|
-
showLevelTagInput: {
|
|
77
|
-
settings: false,
|
|
78
|
-
label: 'Show Level Tag Input',
|
|
79
|
-
enabled: false
|
|
80
|
-
},
|
|
81
|
-
dragAndDrop: {
|
|
82
|
-
settings: true,
|
|
83
|
-
label: 'Enable Drag and Drop',
|
|
84
|
-
enabled: false
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
var rubricDefaultConfiguration = {
|
|
88
|
-
showExcludeZero: {
|
|
89
|
-
settings: true,
|
|
90
|
-
label: 'Ability to exclude zero'
|
|
91
|
-
},
|
|
92
|
-
showMaxPoint: {
|
|
93
|
-
settings: true,
|
|
94
|
-
label: 'Show max points dropdown'
|
|
95
|
-
},
|
|
96
|
-
settingsPanelDisabled: false
|
|
97
|
-
};
|
|
98
|
-
var rubriclessDefaultConfiguration = {
|
|
99
|
-
showExcludeZero: {
|
|
100
|
-
settings: true,
|
|
101
|
-
label: 'Ability to exclude zero'
|
|
102
|
-
},
|
|
103
|
-
showMaxPoint: {
|
|
104
|
-
settings: true,
|
|
105
|
-
label: 'Show max points dropdown'
|
|
106
|
-
},
|
|
107
|
-
settingsPanelDisabled: false,
|
|
108
|
-
// shows us if it simple rubric or rubricless(simple rubric with less structure)
|
|
109
|
-
rubricless: true,
|
|
110
|
-
// scoring instruction for rubricless
|
|
111
|
-
rubriclessInstruction: {
|
|
112
|
-
settings: true,
|
|
113
|
-
label: 'Instruction'
|
|
114
|
-
},
|
|
115
|
-
maxMaxPoints: 100
|
|
116
|
-
};
|
|
117
|
-
var _default = {
|
|
118
|
-
model: {
|
|
119
|
-
rubricOptions: ['simpleRubric', 'multiTraitRubric'],
|
|
120
|
-
rubricType: 'simpleRubric',
|
|
121
|
-
rubrics: {
|
|
122
|
-
simpleRubric: rubricDefaultModel,
|
|
123
|
-
multiTraitRubric: multiTraitDefaultModel,
|
|
124
|
-
rubricless: rubriclessDefaultModel
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
configuration: {
|
|
128
|
-
multiTraitRubric: multiTraitDefaultConfiguration,
|
|
129
|
-
simpleRubric: rubricDefaultConfiguration,
|
|
130
|
-
rubricless: rubriclessDefaultConfiguration
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
exports["default"] = _default;
|
|
134
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["multiTraitDefaultModel","visibleToStudent","halfScoring","pointLabels","description","standards","scales","excludeZero","rubricDefaultModel","points","sampleAnswers","maxPoints","rubriclessDefaultModel","rubriclessInstructionEnabled","multiTraitDefaultConfiguration","settingsPanelDisabled","excludeZeroDialogBoxContent","title","text","includeZeroDialogBoxContent","deleteScaleDialogBoxContent","maxPointsDialogBoxContent","spellCheck","label","settings","enabled","showExcludeZero","showScorePointLabels","showDescription","showVisibleToStudent","showHalfScoring","width","showStandards","showLevelTagInput","dragAndDrop","rubricDefaultConfiguration","showMaxPoint","rubriclessDefaultConfiguration","rubricless","rubriclessInstruction","maxMaxPoints","model","rubricOptions","rubricType","rubrics","simpleRubric","multiTraitRubric","configuration"],"mappings":";;;;;;AAAA,IAAMA,sBAAsB,GAAG;AAC7BC,EAAAA,gBAAgB,EAAE,IADW;AAE7BC,EAAAA,WAAW,EAAE,KAFgB;AAG7BC,EAAAA,WAAW,EAAE,IAHgB;AAI7BC,EAAAA,WAAW,EAAE,KAJgB;AAK7BC,EAAAA,SAAS,EAAE,KALkB;AAM7BC,EAAAA,MAAM,EAAE,EANqB;AAO7BC,EAAAA,WAAW,EAAE;AAPgB,CAA/B;AAUA,IAAMC,kBAAkB,GAAG;AACzBC,EAAAA,MAAM,EAAE,CAAC,EAAD,EAAK,EAAL,EAAS,EAAT,EAAa,EAAb,CADiB;AAEzBC,EAAAA,aAAa,EAAE,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAFU;AAGzBC,EAAAA,SAAS,EAAE,CAHc;AAIzBJ,EAAAA,WAAW,EAAE;AAJY,CAA3B;AAOA,IAAMK,sBAAsB,GAAG;AAC7BD,EAAAA,SAAS,EAAE,GADkB;AAE7BJ,EAAAA,WAAW,EAAE,KAFgB;AAG7BM,EAAAA,4BAA4B,EAAE;AAHD,CAA/B;AAMA,IAAMC,8BAA8B,GAAG;AACrCC,EAAAA,qBAAqB,EAAE,KADc;AAErCC,E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,GADM;AAMbmC,EAAAA,aAAa,EAAE;AACbD,IAAAA,gBAAgB,EAAEhC,8BADL;AAEb+B,IAAAA,YAAY,EAAEV,0BAFD;AAGbG,IAAAA,UAAU,EAAED;AAHC;AANF,C","sourcesContent":["const multiTraitDefaultModel = {\n visibleToStudent: true,\n halfScoring: false,\n pointLabels: true,\n description: false,\n standards: false,\n scales: [],\n excludeZero: false,\n};\n\nconst rubricDefaultModel = {\n points: ['', '', '', ''],\n sampleAnswers: [null, null, null, null],\n maxPoints: 4,\n excludeZero: false,\n};\n\nconst rubriclessDefaultModel = {\n maxPoints: 100,\n excludeZero: false,\n rubriclessInstructionEnabled: true,\n};\n\nconst multiTraitDefaultConfiguration = {\n settingsPanelDisabled: false,\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 spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n showExcludeZero: {\n settings: true,\n label: 'Exclude Zero',\n },\n showScorePointLabels: {\n settings: true,\n label: 'Show Score Point Labels',\n },\n showDescription: {\n settings: true,\n label: 'Show Description',\n },\n showVisibleToStudent: {\n settings: true,\n label: 'Visible to Student',\n },\n showHalfScoring: {\n settings: true,\n label: 'Half Scoring',\n },\n width: '900px',\n // these should not be set to true (should not be used) for now\n showStandards: {\n settings: false,\n label: 'Show Standards',\n },\n showLevelTagInput: {\n settings: false,\n label: 'Show Level Tag Input',\n enabled: false,\n },\n dragAndDrop: {\n settings: true,\n label: 'Enable Drag and Drop',\n enabled: false,\n },\n};\n\nconst rubricDefaultConfiguration = {\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};\n\nconst rubriclessDefaultConfiguration = {\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 // shows us if it simple rubric or rubricless(simple rubric with less structure)\n rubricless: true,\n // scoring instruction for rubricless\n rubriclessInstruction: {\n settings: true,\n label: 'Instruction',\n },\n maxMaxPoints: 100,\n};\n\nexport default {\n model: {\n rubricOptions: ['simpleRubric', 'multiTraitRubric'],\n rubricType: 'simpleRubric',\n rubrics: { simpleRubric: rubricDefaultModel, multiTraitRubric: multiTraitDefaultModel, rubricless: rubriclessDefaultModel },\n },\n configuration: {\n multiTraitRubric: multiTraitDefaultConfiguration,\n simpleRubric: rubricDefaultConfiguration,\n rubricless: rubriclessDefaultConfiguration,\n },\n};\n"],"file":"defaults.js"}
|