@pie-element/complex-rubric 3.7.8-next.74 → 3.7.8-next.80
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/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/CHANGELOG.md +402 -676
- package/configure/node_modules/@pie-element/multi-trait-rubric/README.md +55 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/configure/CHANGELOG.md +366 -574
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js +584 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js +152 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/configure/lib/index.js +89 -63
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js +546 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js +361 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js +556 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js +380 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js +296 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js +118 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/package.json +18 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/controller/CHANGELOG.md +172 -165
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/controller/lib/defaults.js +8 -5
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js +215 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js +13 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/package.json +15 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json +1628 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json.md +1202 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/docs/demo/config.js +2 -2
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/generate.js +117 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/index.html +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/session.js +6 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json +861 -0
- package/configure/node_modules/@pie-element/{rubric/docs/config-schema.json.md → multi-trait-rubric/docs/pie-schema.json.md} +284 -202
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/lib/index.js +27 -30
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js +164 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js +330 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js +103 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js.map +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/package.json +10 -12
- package/configure/package.json +5 -5
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/manifest.json +4 -4
- package/module/print.js +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/README.md +0 -3
- package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +0 -197
- 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.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 -17
- package/configure/node_modules/@pie-element/rubric/configure/src/__tests__/index.test.jsx +0 -167
- 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/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 -13
- 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/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.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 -42661
- 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 -7980
- package/configure/node_modules/@pie-element/rubric/module/index.html +0 -21
- package/configure/node_modules/@pie-element/rubric/module/manifest.json +0 -14
- 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 -7993
- 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 -196
- package/configure/node_modules/@pie-element/rubric/src/print.js +0 -63
- /package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/LICENSE.md +0 -0
package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/authoring.jsx
DELETED
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { withStyles } from '@material-ui/core/styles';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import OutlinedInput from '@material-ui/core/OutlinedInput';
|
|
6
|
-
import InputLabel from '@material-ui/core/InputLabel';
|
|
7
|
-
import Select from '@material-ui/core/Select';
|
|
8
|
-
import FormControl from '@material-ui/core/FormControl';
|
|
9
|
-
import MenuItem from '@material-ui/core/MenuItem';
|
|
10
|
-
import times from 'lodash/times';
|
|
11
|
-
import Checkbox from '@material-ui/core/Checkbox';
|
|
12
|
-
import FormGroup from '@material-ui/core/FormGroup';
|
|
13
|
-
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
14
|
-
import grey from '@material-ui/core/colors/grey';
|
|
15
|
-
import Typography from '@material-ui/core/Typography';
|
|
16
|
-
import DragIndicator from '@material-ui/icons/DragIndicator';
|
|
17
|
-
import EditableHtml from '@pie-lib/pie-toolbox/editable-html';
|
|
18
|
-
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
19
|
-
import debug from 'debug';
|
|
20
|
-
import PointMenu from './point-menu';
|
|
21
|
-
|
|
22
|
-
import range from 'lodash/range';
|
|
23
|
-
import { InputContainer } from '@pie-lib/pie-toolbox/config-ui';
|
|
24
|
-
import { color } from '@pie-lib/pie-toolbox/render-ui';
|
|
25
|
-
|
|
26
|
-
const log = debug('pie-lib:rubric:authoring');
|
|
27
|
-
|
|
28
|
-
const reorder = (list, startIndex, endIndex) => {
|
|
29
|
-
const result = Array.from(list);
|
|
30
|
-
const [removed] = result.splice(startIndex, 1);
|
|
31
|
-
|
|
32
|
-
result.splice(endIndex, 0, removed);
|
|
33
|
-
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const RubricType = PropTypes.shape({
|
|
38
|
-
excludeZero: PropTypes.bool,
|
|
39
|
-
points: PropTypes.arrayOf(PropTypes.string),
|
|
40
|
-
sampleAnswers: PropTypes.arrayOf(PropTypes.string),
|
|
41
|
-
maxPoints: PropTypes.number,
|
|
42
|
-
rubriclessInstruction: PropTypes.string,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const MaxPoints = withStyles((theme) => ({
|
|
46
|
-
formControl: {
|
|
47
|
-
minWidth: '120px',
|
|
48
|
-
margin: theme.spacing.unit,
|
|
49
|
-
},
|
|
50
|
-
}))((props) => {
|
|
51
|
-
const { value, onChange, max, classes } = props;
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<FormControl className={classes.formControl} variant="outlined">
|
|
55
|
-
<InputLabel width={100} htmlFor="...">
|
|
56
|
-
Max Points
|
|
57
|
-
</InputLabel>
|
|
58
|
-
<Select value={value} onChange={(e) => onChange(e.target.value)} input={<OutlinedInput labelWidth={80} />}>
|
|
59
|
-
{range(1, max + 1).map((v) => (
|
|
60
|
-
<MenuItem key={`${v}`} value={v}>
|
|
61
|
-
{v}
|
|
62
|
-
</MenuItem>
|
|
63
|
-
))}
|
|
64
|
-
</Select>
|
|
65
|
-
</FormControl>
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// if the value is null or 'null', the Sample Answer input field for that point will not be dispalyed
|
|
70
|
-
// if the value is '', the Sample Answer input field will be empty
|
|
71
|
-
const checkSampleAnswer = (sampleAnswer) => sampleAnswer === null || sampleAnswer === 'null';
|
|
72
|
-
|
|
73
|
-
export const PointConfig = withStyles((theme) => ({
|
|
74
|
-
pointConfig: {},
|
|
75
|
-
row: {
|
|
76
|
-
display: 'flex',
|
|
77
|
-
width: '100%',
|
|
78
|
-
position: 'relative',
|
|
79
|
-
},
|
|
80
|
-
editor: {
|
|
81
|
-
width: '100%',
|
|
82
|
-
backgroundColor: `${theme.palette.common.white} !important`,
|
|
83
|
-
},
|
|
84
|
-
dragIndicator: {
|
|
85
|
-
paddingTop: theme.spacing.unit,
|
|
86
|
-
color: grey[500],
|
|
87
|
-
},
|
|
88
|
-
pointsLabel: {
|
|
89
|
-
color: grey[500],
|
|
90
|
-
paddingBottom: theme.spacing.unit,
|
|
91
|
-
textTransform: 'uppercase',
|
|
92
|
-
},
|
|
93
|
-
sampleAnswersEditor: {
|
|
94
|
-
paddingLeft: theme.spacing.unit * 3,
|
|
95
|
-
},
|
|
96
|
-
pointMenu: {
|
|
97
|
-
position: 'absolute',
|
|
98
|
-
right: 0,
|
|
99
|
-
},
|
|
100
|
-
errorText: {
|
|
101
|
-
fontSize: theme.typography.fontSize - 2,
|
|
102
|
-
color: theme.palette.error.main,
|
|
103
|
-
paddingLeft: theme.spacing.unit * 3,
|
|
104
|
-
paddingTop: theme.spacing.unit,
|
|
105
|
-
},
|
|
106
|
-
}))((props) => {
|
|
107
|
-
const {
|
|
108
|
-
points,
|
|
109
|
-
content,
|
|
110
|
-
classes,
|
|
111
|
-
sampleAnswer,
|
|
112
|
-
mathMlOptions = {},
|
|
113
|
-
error,
|
|
114
|
-
pluginOpts = {},
|
|
115
|
-
excludeZero,
|
|
116
|
-
imageSupport = {},
|
|
117
|
-
} = props;
|
|
118
|
-
const pointsCount = excludeZero ? points + 1 : points;
|
|
119
|
-
const pointsLabel = `${pointsCount} ${pointsCount === 1 ? 'pt' : 'pts'}`;
|
|
120
|
-
const showSampleAnswer = checkSampleAnswer(sampleAnswer);
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<div className={classes.pointConfig}>
|
|
124
|
-
<Typography variant="overline" className={classes.pointsLabel}>
|
|
125
|
-
{pointsLabel}
|
|
126
|
-
</Typography>
|
|
127
|
-
|
|
128
|
-
<div className={classes.row}>
|
|
129
|
-
<DragIndicator className={classes.dragIndicator} />
|
|
130
|
-
<EditableHtml
|
|
131
|
-
className={classes.editor}
|
|
132
|
-
error={error}
|
|
133
|
-
pluginProps={pluginOpts}
|
|
134
|
-
markup={content}
|
|
135
|
-
onChange={props.onChange}
|
|
136
|
-
mathMlOptions={mathMlOptions}
|
|
137
|
-
imageSupport={imageSupport}
|
|
138
|
-
languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
|
|
139
|
-
/>
|
|
140
|
-
<PointMenu
|
|
141
|
-
classes={{
|
|
142
|
-
icon: classes.pointMenu,
|
|
143
|
-
}}
|
|
144
|
-
showSampleAnswer={showSampleAnswer}
|
|
145
|
-
onChange={props.onMenuChange}
|
|
146
|
-
/>
|
|
147
|
-
</div>
|
|
148
|
-
{error && <div className={classes.errorText}>{error}</div>}
|
|
149
|
-
{!showSampleAnswer && (
|
|
150
|
-
<div className={classes.sampleAnswersEditor}>
|
|
151
|
-
<Typography variant="overline" className={classes.dragIndicator}>
|
|
152
|
-
Sample Response
|
|
153
|
-
</Typography>
|
|
154
|
-
<EditableHtml
|
|
155
|
-
className={classes.editor}
|
|
156
|
-
markup={sampleAnswer}
|
|
157
|
-
pluginProps={pluginOpts}
|
|
158
|
-
onChange={props.onSampleChange}
|
|
159
|
-
mathMlOptions={mathMlOptions}
|
|
160
|
-
imageSupport={imageSupport}
|
|
161
|
-
languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
|
|
162
|
-
/>
|
|
163
|
-
</div>
|
|
164
|
-
)}
|
|
165
|
-
</div>
|
|
166
|
-
);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
export class RawAuthoring extends React.Component {
|
|
170
|
-
static propTypes = {
|
|
171
|
-
classes: PropTypes.object.isRequired,
|
|
172
|
-
className: PropTypes.string,
|
|
173
|
-
value: RubricType,
|
|
174
|
-
config: PropTypes.object,
|
|
175
|
-
pluginOpts: PropTypes.object,
|
|
176
|
-
rubricless: PropTypes.bool,
|
|
177
|
-
onChange: PropTypes.func,
|
|
178
|
-
imageSupport: PropTypes.shape({
|
|
179
|
-
add: PropTypes.func.isRequired,
|
|
180
|
-
delete: PropTypes.func.isRequired,
|
|
181
|
-
}),
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
static defaultProps = {};
|
|
185
|
-
|
|
186
|
-
dragEnd = (result) => {
|
|
187
|
-
if (!result.destination) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const { value, onChange } = this.props;
|
|
192
|
-
|
|
193
|
-
const points = reorder(value.points, result.source.index, result.destination.index);
|
|
194
|
-
const sampleAnswers = reorder(value.sampleAnswers, result.source.index, result.destination.index);
|
|
195
|
-
|
|
196
|
-
onChange({ ...value, points, sampleAnswers });
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
changeRubriclessInstruction = (input) => {
|
|
200
|
-
const { value, onChange } = this.props;
|
|
201
|
-
onChange({ ...value, rubriclessInstruction: input });
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
changeMaxPoints = (maxPoints) => {
|
|
205
|
-
const { value, onChange } = this.props;
|
|
206
|
-
// excludeZero should be false and disabled when maxPoints is 1
|
|
207
|
-
const excludeZero = maxPoints === 1 ? false : value.excludeZero;
|
|
208
|
-
|
|
209
|
-
onChange({ ...value, maxPoints, excludeZero });
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
changeContent = (index, content, type) => {
|
|
213
|
-
// type could be 'points' or 'sampleAnswers'
|
|
214
|
-
log(`changeModel[${type}]:`, index, content);
|
|
215
|
-
|
|
216
|
-
if (type !== 'points' && type !== 'sampleAnswers') {
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
const { value, onChange } = this.props;
|
|
221
|
-
const items = value[type] && Array.from(value[type]);
|
|
222
|
-
|
|
223
|
-
items.splice(index, 1, content);
|
|
224
|
-
log(`changeModel[${type}]:`, items);
|
|
225
|
-
|
|
226
|
-
onChange({ ...value, [type]: items });
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
excludeZeros = () => {
|
|
230
|
-
const { value, onChange } = this.props;
|
|
231
|
-
|
|
232
|
-
onChange({ ...value, excludeZero: !value.excludeZero });
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
onPointMenuChange = (index, clickedItem) => {
|
|
236
|
-
if (clickedItem === 'sample') {
|
|
237
|
-
const { value } = this.props;
|
|
238
|
-
const sampleAnswers = Array.from(value.sampleAnswers || []);
|
|
239
|
-
|
|
240
|
-
if (checkSampleAnswer(sampleAnswers[index])) {
|
|
241
|
-
// an empty string will display an empty Sample Answer input field
|
|
242
|
-
this.changeContent(index, '', 'sampleAnswers');
|
|
243
|
-
} else {
|
|
244
|
-
// when the content is null or 'null', the Sample Answer input field will not be displayed
|
|
245
|
-
this.changeContent(index, null, 'sampleAnswers');
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
render() {
|
|
251
|
-
const {
|
|
252
|
-
classes,
|
|
253
|
-
className,
|
|
254
|
-
value,
|
|
255
|
-
mathMlOptions = {},
|
|
256
|
-
config = {},
|
|
257
|
-
rubricless = false,
|
|
258
|
-
pluginOpts = {},
|
|
259
|
-
imageSupport = {},
|
|
260
|
-
} = this.props;
|
|
261
|
-
let {
|
|
262
|
-
excludeZeroEnabled = true,
|
|
263
|
-
maxPointsEnabled = true,
|
|
264
|
-
errors = {},
|
|
265
|
-
rubriclessInstructionEnabled = false,
|
|
266
|
-
maxPoints = 10,
|
|
267
|
-
} = value || {};
|
|
268
|
-
// rubric will contain a max value for maxPoints
|
|
269
|
-
const { rubriclessInstruction = {}, maxMaxPoints = 10 } = config || {};
|
|
270
|
-
const { pointsDescriptorsErrors } = errors || {};
|
|
271
|
-
if (value && Number.isFinite(value.maxPoints)) {
|
|
272
|
-
// eslint-disable-next-line no-console
|
|
273
|
-
console.warn('maxPoints is deprecated - remove from model');
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// for rubric value is computed based on points
|
|
277
|
-
const maxPointsValue = maxPoints;
|
|
278
|
-
|
|
279
|
-
return (
|
|
280
|
-
<div className={classNames(classes.class, className)}>
|
|
281
|
-
<Typography variant="h5" className={classes.rubricTitle}>
|
|
282
|
-
Rubric
|
|
283
|
-
</Typography>
|
|
284
|
-
<FormGroup row>
|
|
285
|
-
{maxPointsEnabled && (
|
|
286
|
-
<MaxPoints
|
|
287
|
-
max={maxMaxPoints < 100 ? maxMaxPoints : 100}
|
|
288
|
-
value={maxPointsValue}
|
|
289
|
-
onChange={this.changeMaxPoints}
|
|
290
|
-
pluginOpts={pluginOpts}
|
|
291
|
-
imageSupport={imageSupport}
|
|
292
|
-
/>
|
|
293
|
-
)}
|
|
294
|
-
{excludeZeroEnabled && (
|
|
295
|
-
<FormControlLabel
|
|
296
|
-
label="Exclude zeros"
|
|
297
|
-
control={
|
|
298
|
-
<Checkbox
|
|
299
|
-
className={classes.customColor}
|
|
300
|
-
checked={value.excludeZero}
|
|
301
|
-
onChange={this.excludeZeros}
|
|
302
|
-
disabled={maxPointsValue === 1}
|
|
303
|
-
/>
|
|
304
|
-
}
|
|
305
|
-
/>
|
|
306
|
-
)}
|
|
307
|
-
</FormGroup>
|
|
308
|
-
|
|
309
|
-
{rubriclessInstructionEnabled && rubricless && (
|
|
310
|
-
<InputContainer label={rubriclessInstruction.label} className={classes.inputContainer}>
|
|
311
|
-
<EditableHtml
|
|
312
|
-
className={classes.input}
|
|
313
|
-
markup={value.rubriclessInstruction || ''}
|
|
314
|
-
onChange={this.changeRubriclessInstruction}
|
|
315
|
-
pluginProps={pluginOpts}
|
|
316
|
-
nonEmpty={false}
|
|
317
|
-
disableUnderline
|
|
318
|
-
languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
|
|
319
|
-
mathMlOptions={mathMlOptions}
|
|
320
|
-
imageSupport={imageSupport}
|
|
321
|
-
/>
|
|
322
|
-
</InputContainer>
|
|
323
|
-
)}
|
|
324
|
-
|
|
325
|
-
<div className={rubricless ? classes.rubricless : classes.container}>
|
|
326
|
-
<DragDropContext onDragEnd={this.dragEnd}>
|
|
327
|
-
<Droppable droppableId="droppable">
|
|
328
|
-
{(provided) => (
|
|
329
|
-
<div {...provided.droppableProps} ref={provided.innerRef}>
|
|
330
|
-
{value.points.map((p, index) => {
|
|
331
|
-
return (
|
|
332
|
-
<Draggable key={`${p.points}-${index}`} index={index} draggableId={index.toString()}>
|
|
333
|
-
{(provided) => (
|
|
334
|
-
<div
|
|
335
|
-
className={classes.configHolder}
|
|
336
|
-
ref={provided.innerRef}
|
|
337
|
-
{...provided.draggableProps}
|
|
338
|
-
{...provided.dragHandleProps}
|
|
339
|
-
>
|
|
340
|
-
<PointConfig
|
|
341
|
-
points={value.points.length - 1 - index}
|
|
342
|
-
content={p}
|
|
343
|
-
error={
|
|
344
|
-
pointsDescriptorsErrors && pointsDescriptorsErrors[value.points.length - 1 - index]
|
|
345
|
-
}
|
|
346
|
-
sampleAnswer={value.sampleAnswers && value.sampleAnswers[index]}
|
|
347
|
-
onChange={(content) => this.changeContent(index, content, 'points')}
|
|
348
|
-
onSampleChange={(content) => this.changeContent(index, content, 'sampleAnswers')}
|
|
349
|
-
onMenuChange={(clickedItem) => this.onPointMenuChange(index, clickedItem)}
|
|
350
|
-
mathMlOptions={mathMlOptions}
|
|
351
|
-
pluginOpts={pluginOpts}
|
|
352
|
-
imageSupport={imageSupport}
|
|
353
|
-
excludeZero={value.excludeZero}
|
|
354
|
-
/>
|
|
355
|
-
</div>
|
|
356
|
-
)}
|
|
357
|
-
</Draggable>
|
|
358
|
-
);
|
|
359
|
-
})}
|
|
360
|
-
{provided.placeholder}
|
|
361
|
-
</div>
|
|
362
|
-
)}
|
|
363
|
-
</Droppable>
|
|
364
|
-
</DragDropContext>
|
|
365
|
-
</div>
|
|
366
|
-
</div>
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
const styles = (theme) => ({
|
|
372
|
-
container: {
|
|
373
|
-
backgroundColor: grey[200],
|
|
374
|
-
borderWidth: 1,
|
|
375
|
-
borderStyle: 'solid',
|
|
376
|
-
borderColor: grey[300],
|
|
377
|
-
padding: theme.spacing.unit * 2,
|
|
378
|
-
margin: theme.spacing.unit,
|
|
379
|
-
},
|
|
380
|
-
inputContainer: {
|
|
381
|
-
width: '100%',
|
|
382
|
-
paddingTop: theme.spacing.unit * 2,
|
|
383
|
-
marginBottom: theme.spacing.unit * 2,
|
|
384
|
-
},
|
|
385
|
-
rubricless: {
|
|
386
|
-
display: 'none',
|
|
387
|
-
},
|
|
388
|
-
configHolder: {
|
|
389
|
-
paddingTop: theme.spacing.unit,
|
|
390
|
-
paddingBottom: theme.spacing.unit,
|
|
391
|
-
},
|
|
392
|
-
rubricTitle: {
|
|
393
|
-
paddingLeft: theme.spacing.unit,
|
|
394
|
-
margin: theme.spacing.unit,
|
|
395
|
-
},
|
|
396
|
-
customColor: {
|
|
397
|
-
color: `${color.tertiary()} !important`,
|
|
398
|
-
},
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
const StyledRawAuthoring = withStyles(styles)(RawAuthoring);
|
|
402
|
-
|
|
403
|
-
const Reverse = (props) => {
|
|
404
|
-
const { rubricless = false, config = {}, pluginOpts = {}, imageSupport = {} } = props || {};
|
|
405
|
-
const points = Array.from(props.value.points || []).reverse();
|
|
406
|
-
let sampleAnswers = Array.from(props.value.sampleAnswers || []).reverse();
|
|
407
|
-
|
|
408
|
-
if (points.length > sampleAnswers.length) {
|
|
409
|
-
sampleAnswers = times(points.length - sampleAnswers.length)
|
|
410
|
-
.map(() => null)
|
|
411
|
-
.concat(sampleAnswers);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
const value = { ...props.value, points, sampleAnswers };
|
|
415
|
-
|
|
416
|
-
const onChange = (value) => {
|
|
417
|
-
props.onChange({
|
|
418
|
-
...value,
|
|
419
|
-
points: Array.from(value.points || []).reverse(),
|
|
420
|
-
sampleAnswers: Array.from(value.sampleAnswers || []).reverse(),
|
|
421
|
-
});
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
return (
|
|
425
|
-
<StyledRawAuthoring
|
|
426
|
-
value={value}
|
|
427
|
-
config={config}
|
|
428
|
-
onChange={onChange}
|
|
429
|
-
rubricless={rubricless}
|
|
430
|
-
pluginOpts={pluginOpts}
|
|
431
|
-
imageSupport={imageSupport}
|
|
432
|
-
/>
|
|
433
|
-
);
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
Reverse.propTypes = {
|
|
437
|
-
value: RubricType,
|
|
438
|
-
config: PropTypes.object,
|
|
439
|
-
pluginOpts: PropTypes.object,
|
|
440
|
-
rubricless: PropTypes.bool,
|
|
441
|
-
getIndex: PropTypes.func,
|
|
442
|
-
onChange: PropTypes.func,
|
|
443
|
-
imageSupport: PropTypes.shape({
|
|
444
|
-
add: PropTypes.func.isRequired,
|
|
445
|
-
delete: PropTypes.func.isRequired,
|
|
446
|
-
}),
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
export default Reverse;
|
package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/point-menu.jsx
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import Menu from '@material-ui/core/Menu';
|
|
2
|
-
import MenuItem from '@material-ui/core/MenuItem';
|
|
3
|
-
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
|
4
|
-
import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
|
|
5
|
-
import IconButton from '@material-ui/core/IconButton';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
export class IconMenu extends React.Component {
|
|
10
|
-
static propTypes = {
|
|
11
|
-
opts: PropTypes.object,
|
|
12
|
-
onClick: PropTypes.func.isRequired,
|
|
13
|
-
classes: PropTypes.object.isRequired,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
constructor(props) {
|
|
17
|
-
super(props);
|
|
18
|
-
this.state = {
|
|
19
|
-
anchorEl: undefined,
|
|
20
|
-
open: false,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
handleClick = (event) => this.setState({ open: true, anchorEl: event.currentTarget });
|
|
25
|
-
|
|
26
|
-
handleRequestClose = () => this.setState({ open: false });
|
|
27
|
-
|
|
28
|
-
render() {
|
|
29
|
-
const { opts, onClick, classes } = this.props;
|
|
30
|
-
const { open, anchorEl } = this.state;
|
|
31
|
-
const keys = Object.keys(opts) || [];
|
|
32
|
-
|
|
33
|
-
const handleMenuClick = (key) => () => {
|
|
34
|
-
onClick(key);
|
|
35
|
-
this.handleRequestClose();
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const iconColor = open ? 'inherit' : 'disabled';
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div>
|
|
42
|
-
<div onClick={this.handleClick}>
|
|
43
|
-
<IconButton className={classes.icon}>
|
|
44
|
-
{open ? <MoreVertIcon color={iconColor} /> : <MoreHorizIcon color={iconColor} />}
|
|
45
|
-
</IconButton>
|
|
46
|
-
</div>
|
|
47
|
-
<Menu
|
|
48
|
-
id="point-menu"
|
|
49
|
-
anchorEl={anchorEl}
|
|
50
|
-
open={open}
|
|
51
|
-
onClose={this.handleRequestClose}
|
|
52
|
-
style={{ transform: 'translate(-15px, -15px)' }}
|
|
53
|
-
transformOrigin={{
|
|
54
|
-
vertical: 'center',
|
|
55
|
-
horizontal: 'right',
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
{keys.map((k, index) => (
|
|
59
|
-
<MenuItem key={index} onClick={handleMenuClick(k)}>
|
|
60
|
-
{opts[k]}
|
|
61
|
-
</MenuItem>
|
|
62
|
-
))}
|
|
63
|
-
</Menu>
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default class PointMenu extends React.Component {
|
|
70
|
-
static propTypes = {
|
|
71
|
-
onChange: PropTypes.func.isRequired,
|
|
72
|
-
classes: PropTypes.object.isRequired,
|
|
73
|
-
showSampleAnswer: PropTypes.bool.isRequired,
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
static defaultProps = {
|
|
77
|
-
classes: {},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
render() {
|
|
81
|
-
const { onChange, classes, showSampleAnswer } = this.props;
|
|
82
|
-
const sampleText = showSampleAnswer ? 'Provide Sample Response' : 'Remove Sample Response';
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<IconMenu
|
|
86
|
-
onClick={(key) => onChange(key)}
|
|
87
|
-
opts={{
|
|
88
|
-
sample: sampleText,
|
|
89
|
-
}}
|
|
90
|
-
classes={classes}
|
|
91
|
-
/>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"type": "fix",
|
|
4
|
-
"scope": null,
|
|
5
|
-
"subject": "bump all packages to avoid tag conflict",
|
|
6
|
-
"merge": null,
|
|
7
|
-
"header": "fix: bump all packages to avoid tag conflict",
|
|
8
|
-
"body": null,
|
|
9
|
-
"footer": null,
|
|
10
|
-
"notes": [],
|
|
11
|
-
"hash": "d9ec9a8689f0a391594b5e2f4ea958c6dc9f6d7b",
|
|
12
|
-
"gitTags": " (develop)",
|
|
13
|
-
"committerDate": "2020-04-10 20:01:37 +0100",
|
|
14
|
-
"isTagged": true,
|
|
15
|
-
"tag": "@pie-element/rubric-controller@1.1.1"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["points","sampleAnswers","maxPoints","maxPointsEnabled","excludeZero","excludeZeroEnabled"],"mappings":";;;;;;eAAe;AACbA,EAAAA,MAAM,EAAE,CAAC,EAAD,EAAK,EAAL,EAAS,EAAT,EAAa,EAAb,CADK;AAEbC,EAAAA,aAAa,EAAE,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAFF;AAGbC,EAAAA,SAAS,EAAE,CAHE;AAIbC,EAAAA,gBAAgB,EAAE,IAJL;AAKbC,EAAAA,WAAW,EAAE,KALA;AAMbC,EAAAA,kBAAkB,EAAE;AANP,C","sourcesContent":["export default {\n points: ['', '', '', ''],\n sampleAnswers: [null, null, null, null],\n maxPoints: 3,\n maxPointsEnabled: true,\n excludeZero: false,\n excludeZeroEnabled: true,\n};\n"],"file":"defaults.js"}
|
|
@@ -1,59 +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.model = model;
|
|
9
|
-
exports.validate = validate;
|
|
10
|
-
|
|
11
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
|
-
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
14
|
-
|
|
15
|
-
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; }
|
|
16
|
-
|
|
17
|
-
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; }
|
|
18
|
-
|
|
19
|
-
var normalize = function normalize(model) {
|
|
20
|
-
return _objectSpread(_objectSpread({}, _defaults["default"]), model);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
function model(model, session, env) {
|
|
24
|
-
return new Promise(function (resolve) {
|
|
25
|
-
var modelResult = normalize(model || {});
|
|
26
|
-
resolve(env && env.role && env.role === 'instructor' ? modelResult : {});
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function markupToText(s) {
|
|
31
|
-
return (s || '').replace(/(<([^>]+)>)/gi, '');
|
|
32
|
-
} // IMPORTANT! If you make any changes to this function, please make sure you also update complex-rubric/controller/validateSimpleRubric function!“.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
function validate(model) {
|
|
36
|
-
var points = model.points;
|
|
37
|
-
var errors = {};
|
|
38
|
-
var pointsDescriptorsErrors = {};
|
|
39
|
-
(points || []).forEach(function (point, index) {
|
|
40
|
-
if (!point || point === '<div></div>') {
|
|
41
|
-
pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';
|
|
42
|
-
} else {
|
|
43
|
-
var identicalPointDescr = points.slice(index + 1).some(function (p) {
|
|
44
|
-
return markupToText(p) === markupToText(point);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
if (identicalPointDescr) {
|
|
48
|
-
pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
if (Object.keys(pointsDescriptorsErrors).length > 0) {
|
|
54
|
-
errors.pointsDescriptorsErrors = pointsDescriptorsErrors;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return errors;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["normalize","model","defaults","session","env","Promise","resolve","modelResult","role","markupToText","s","replace","validate","points","errors","pointsDescriptorsErrors","forEach","point","index","identicalPointDescr","slice","some","p","Object","keys","length"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAEA,IAAMA,SAAS,GAAG,SAAZA,SAAY,CAACC,KAAD;AAAA,yCAAiBC,oBAAjB,GAA8BD,KAA9B;AAAA,CAAlB;;AAEO,SAASA,KAAT,CAAeA,KAAf,EAAsBE,OAAtB,EAA+BC,GAA/B,EAAoC;AACzC,SAAO,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAa;AAC9B,QAAMC,WAAW,GAAGP,SAAS,CAACC,KAAK,IAAI,EAAV,CAA7B;AAEAK,IAAAA,OAAO,CAACF,GAAG,IAAIA,GAAG,CAACI,IAAX,IAAmBJ,GAAG,CAACI,IAAJ,KAAa,YAAhC,GAA+CD,WAA/C,GAA6D,EAA9D,CAAP;AACD,GAJM,CAAP;AAKD;;AAED,SAASE,YAAT,CAAsBC,CAAtB,EAAyB;AACvB,SAAO,CAACA,CAAC,IAAI,EAAN,EAAUC,OAAV,CAAkB,eAAlB,EAAmC,EAAnC,CAAP;AACD,C,CAED;;;AACO,SAASC,QAAT,CAAkBX,KAAlB,EAAyB;AAC9B,MAAQY,MAAR,GAAmBZ,KAAnB,CAAQY,MAAR;AACA,MAAMC,MAAM,GAAG,EAAf;AACA,MAAMC,uBAAuB,GAAG,EAAhC;AAEA,GAACF,MAAM,IAAI,EAAX,EAAeG,OAAf,CAAuB,UAACC,KAAD,EAAQC,KAAR,EAAkB;AAEvC,QAAI,CAACD,KAAD,IAAUA,KAAK,KAAK,aAAxB,EAAuC;AACrCF,MAAAA,uBAAuB,CAACG,KAAD,CAAvB,GAAiC,qCAAjC;AACD,KAFD,MAEO;AACL,UAAMC,mBAAmB,GAAGN,MAAM,CAACO,KAAP,CAAaF,KAAK,GAAG,CAArB,EAAwBG,IAAxB,CAA6B,UAACC,CAAD;AAAA,eAAOb,YAAY,CAACa,CAAD,CAAZ,KAAoBb,YAAY,CAACQ,KAAD,CAAvC;AAAA,OAA7B,CAA5B;;AAEA,UAAIE,mBAAJ,EAAyB;AACvBJ,QAAAA,uBAAuB,CAACG,KAAD,CAAvB,GAAiC,sCAAjC;AACD;AACF;AACF,GAXD;;AAaA,MAAIK,MAAM,CAACC,IAAP,CAAYT,uBAAZ,EAAqCU,MAArC,GAA8C,CAAlD,EAAqD;AACnDX,IAAAA,MAAM,CAACC,uBAAP,GAAiCA,uBAAjC;AACD;;AAED,SAAOD,MAAP;AACD","sourcesContent":["import defaults from './defaults';\n\nconst normalize = (model) => ({ ...defaults, ...model });\n\nexport function model(model, session, env) {\n return new Promise((resolve) => {\n const modelResult = normalize(model || {});\n\n resolve(env && env.role && env.role === 'instructor' ? modelResult : {});\n });\n}\n\nfunction markupToText(s) {\n return (s || '').replace(/(<([^>]+)>)/gi, '');\n}\n\n// IMPORTANT! If you make any changes to this function, please make sure you also update complex-rubric/controller/validateSimpleRubric function!“.\nexport function validate(model) {\n const { points } = model;\n const errors = {};\n const pointsDescriptorsErrors = {};\n\n (points || []).forEach((point, index) => {\n\n if (!point || point === '<div></div>') {\n pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';\n } else {\n const identicalPointDescr = points.slice(index + 1).some((p) => markupToText(p) === markupToText(point));\n\n if (identicalPointDescr) {\n pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';\n }\n }\n });\n\n if (Object.keys(pointsDescriptorsErrors).length > 0) {\n errors.pointsDescriptorsErrors = pointsDescriptorsErrors;\n }\n\n return errors;\n}\n"],"file":"index.js"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pie-element/rubric-controller",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "3.2.9",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "./node_modules/.bin/jest"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@pie-lib/pie-toolbox": "2.25.2",
|
|
11
|
-
"lodash": "^4.17.15"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { model } from '../index';
|
|
2
|
-
|
|
3
|
-
describe('rubric model', () => {
|
|
4
|
-
let state = {
|
|
5
|
-
points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
|
|
6
|
-
sampleAnswers: [null, 'just right', 'not left', null],
|
|
7
|
-
maxPoints: 4,
|
|
8
|
-
maxPointsEnabled: true,
|
|
9
|
-
excludeZero: false,
|
|
10
|
-
excludeZeroEnabled: true,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let session = {};
|
|
14
|
-
let env, result;
|
|
15
|
-
|
|
16
|
-
it('returns no model for gather', async () => {
|
|
17
|
-
env = { mode: 'gather' };
|
|
18
|
-
result = await model(state, session, env);
|
|
19
|
-
expect(result).toEqual({});
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('returns no model for student role', async () => {
|
|
23
|
-
env = { mode: 'gather', role: 'student' };
|
|
24
|
-
result = await model(state, session, env);
|
|
25
|
-
expect(result).toEqual({});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('returns model for instructor role', async () => {
|
|
29
|
-
env = { mode: 'gather', role: 'instructor' };
|
|
30
|
-
result = await model(state, session, env);
|
|
31
|
-
expect(result).toEqual(state);
|
|
32
|
-
});
|
|
33
|
-
});
|