@khanacademy/perseus 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/es/index.css +9 -245
- package/dist/es/index.js +138 -584
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +9 -245
- package/dist/index.js +135 -581
- package/dist/index.js.map +1 -1
- package/package.json +36 -36
- package/src/__stories__/hints-renderer.stories.jsx +9 -1
- package/src/__testdata__/graphie_testdata.js +53 -0
- package/src/__tests__/__snapshots__/perseus-markdown_test.jsx.snap +0 -9
- package/src/__tests__/__snapshots__/renderer_test.jsx.snap +0 -9
- package/src/components/__stories__/graphie.stories.jsx +5 -1
- package/src/hint-renderer.jsx +11 -14
- package/src/perseus-api.jsx +0 -23
- package/src/perseus-markdown.jsx +0 -25
- package/src/styles/constants.js +0 -21
- package/src/styles/global-constants.js +0 -6
- package/src/styles/khan-exercise.css +9 -1
- package/src/styles/perseus-renderer.less +0 -259
- package/src/styles/variables.less +0 -11
- package/src/styles/variables.shared.less +0 -10
- package/src/types.js +0 -16
- package/src/widgets/__stories__/input-number.stories.jsx +0 -14
- package/src/widgets/__stories__/radio.stories.jsx +0 -3
- package/src/widgets/__tests__/__snapshots__/definition_test.js.snap +18 -28
- package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +0 -9
- package/src/widgets/__tests__/__snapshots__/image_test.jsx.snap +0 -18
- package/src/widgets/__tests__/__snapshots__/numeric-input_test.jsx.snap +2 -440
- package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +66 -3726
- package/src/widgets/__tests__/numeric-input_test.jsx +54 -118
- package/src/widgets/__tests__/radio/choice-icon_test.jsx +25 -75
- package/src/widgets/__tests__/radio_test.jsx +362 -394
- package/src/widgets/definition.jsx +27 -14
- package/src/widgets/input-number.jsx +2 -60
- package/src/widgets/numeric-input.jsx +17 -89
- package/src/widgets/radio/__stories__/base-radio.stories.jsx +1 -3
- package/src/widgets/radio/__stories__/choice-icon.stories.jsx +23 -105
- package/src/widgets/radio/__stories__/option-status.stories.jsx +0 -8
- package/src/widgets/radio/base-radio.jsx +13 -96
- package/src/widgets/radio/choice-icon/choice-icon.jsx +177 -50
- package/src/widgets/radio/choice-icon/cross-out-line.jsx +9 -13
- package/src/widgets/radio/choice-icon/shared-styles.js +2 -3
- package/src/widgets/radio/choice.jsx +5 -59
- package/src/widgets/radio/option-status.jsx +2 -14
- package/src/components/__stories__/possible-answers.stories.jsx +0 -22
- package/src/components/possible-answers.jsx +0 -36
- package/src/styles/widgets/definition.less +0 -86
- package/src/widgets/radio/__stories__/sat-styles.stories.jsx +0 -191
- package/src/widgets/radio/choice-icon/library-choice-icon.jsx +0 -225
- package/src/widgets/radio/choice-icon/sat-choice-icon.jsx +0 -120
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import Clickable from "@khanacademy/wonder-blocks-clickable";
|
|
4
4
|
import Color from "@khanacademy/wonder-blocks-color";
|
|
5
5
|
import {Popover, PopoverContentCore} from "@khanacademy/wonder-blocks-popover";
|
|
6
6
|
import * as React from "react";
|
|
@@ -25,8 +25,13 @@ type DefinitionProps = {|
|
|
|
25
25
|
widgets: PerseusRenderer["widgets"],
|
|
26
26
|
|};
|
|
27
27
|
|
|
28
|
+
type DefaultProps = {|
|
|
29
|
+
togglePrompt: string,
|
|
30
|
+
definition: string,
|
|
31
|
+
|};
|
|
32
|
+
|
|
28
33
|
class Definition extends React.Component<DefinitionProps> {
|
|
29
|
-
static defaultProps:
|
|
34
|
+
static defaultProps: DefaultProps = {
|
|
30
35
|
togglePrompt: "define me",
|
|
31
36
|
definition: "definition goes here",
|
|
32
37
|
};
|
|
@@ -70,18 +75,26 @@ class Definition extends React.Component<DefinitionProps> {
|
|
|
70
75
|
onClose={() => setActiveDefinitionId(null)}
|
|
71
76
|
placement="top"
|
|
72
77
|
>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
<Clickable
|
|
79
|
+
onClick={() => {
|
|
80
|
+
this.props.trackInteraction();
|
|
81
|
+
setActiveDefinitionId(this.props.widgetId);
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
{({hovered, focused, pressed}) => (
|
|
85
|
+
<span
|
|
86
|
+
style={{
|
|
87
|
+
color: Color.blue,
|
|
88
|
+
borderBottom:
|
|
89
|
+
hovered || focused || pressed
|
|
90
|
+
? `2px solid ${Color.blue}`
|
|
91
|
+
: "none",
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{this.props.togglePrompt}
|
|
95
|
+
</span>
|
|
96
|
+
)}
|
|
97
|
+
</Clickable>
|
|
85
98
|
</Popover>
|
|
86
99
|
)}
|
|
87
100
|
</DefinitionConsumer>
|
|
@@ -9,17 +9,8 @@ import * as React from "react";
|
|
|
9
9
|
import _ from "underscore";
|
|
10
10
|
|
|
11
11
|
import InputWithExamples from "../components/input-with-examples.jsx";
|
|
12
|
-
import PossibleAnswers from "../components/possible-answers.jsx";
|
|
13
12
|
import SimpleKeypadInput from "../components/simple-keypad-input.jsx";
|
|
14
13
|
import {ApiOptions} from "../perseus-api.jsx";
|
|
15
|
-
import {
|
|
16
|
-
satCorrectBackgroundColor,
|
|
17
|
-
satCorrectBorderColor,
|
|
18
|
-
satCorrectColor,
|
|
19
|
-
satIncorrectBackgroundColor,
|
|
20
|
-
satIncorrectBorderColor,
|
|
21
|
-
satIncorrectColor,
|
|
22
|
-
} from "../styles/constants.js";
|
|
23
14
|
import TexWrangler from "../tex-wrangler.js";
|
|
24
15
|
import KhanAnswerTypes from "../util/answer-types.js";
|
|
25
16
|
|
|
@@ -174,27 +165,8 @@ class InputNumber extends React.Component<Props> {
|
|
|
174
165
|
}
|
|
175
166
|
// HACK(johnsullivan): Create a function with shared logic between
|
|
176
167
|
// this and NumericInput.
|
|
168
|
+
// TODO(jeremy): Deprecate this widget and prefer numeric-input.
|
|
177
169
|
const rubric = this.props.reviewModeRubric;
|
|
178
|
-
let correct = null;
|
|
179
|
-
let answerBlurb = null;
|
|
180
|
-
|
|
181
|
-
// SAT is deprecated and not testable
|
|
182
|
-
/* c8 ignore if */
|
|
183
|
-
if (this.props.apiOptions.satStyling && rubric) {
|
|
184
|
-
const score = this.simpleValidate(rubric);
|
|
185
|
-
correct = score.type === "points" && score.earned === score.total;
|
|
186
|
-
|
|
187
|
-
if (!correct) {
|
|
188
|
-
// TODO(johnsullivan): Make this a little more
|
|
189
|
-
// human-friendly.
|
|
190
|
-
let answerString = String(rubric.value);
|
|
191
|
-
if (rubric.inexact && rubric.maxError) {
|
|
192
|
-
answerString += " \u00B1 " + rubric.maxError;
|
|
193
|
-
}
|
|
194
|
-
const answerStrings = [answerString];
|
|
195
|
-
answerBlurb = <PossibleAnswers answers={answerStrings} />;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
170
|
|
|
199
171
|
// Note: This is _very_ similar to what `numeric-input.jsx` does. If
|
|
200
172
|
// you modify this, double-check if you also need to modify that
|
|
@@ -204,20 +176,12 @@ class InputNumber extends React.Component<Props> {
|
|
|
204
176
|
this.props.size === "small" ? styles.small : null,
|
|
205
177
|
this.props.rightAlign ? styles.rightAlign : styles.leftAlign,
|
|
206
178
|
];
|
|
207
|
-
// Correct
|
|
208
|
-
if (rubric && correct === true && this.props.currentValue) {
|
|
209
|
-
inputStyles.push(styles.answerStateCorrect);
|
|
210
|
-
}
|
|
211
|
-
// Incorrect
|
|
212
|
-
if (rubric && correct === false && this.props.currentValue) {
|
|
213
|
-
inputStyles.push(styles.answerStateIncorrect);
|
|
214
|
-
}
|
|
215
179
|
// Unanswered
|
|
216
180
|
if (rubric && !this.props.currentValue) {
|
|
217
181
|
inputStyles.push(styles.answerStateUnanswered);
|
|
218
182
|
}
|
|
219
183
|
|
|
220
|
-
|
|
184
|
+
return (
|
|
221
185
|
<InputWithExamples
|
|
222
186
|
// eslint-disable-next-line react/no-string-refs
|
|
223
187
|
ref="input"
|
|
@@ -234,18 +198,6 @@ class InputNumber extends React.Component<Props> {
|
|
|
234
198
|
linterContext={this.props.linterContext}
|
|
235
199
|
/>
|
|
236
200
|
);
|
|
237
|
-
|
|
238
|
-
// SAT is deprecated, answer blurb is an SAT feature
|
|
239
|
-
/* c8 ignore if */
|
|
240
|
-
if (answerBlurb) {
|
|
241
|
-
return (
|
|
242
|
-
<span className="perseus-input-with-answer-blurb">
|
|
243
|
-
{input}
|
|
244
|
-
{answerBlurb}
|
|
245
|
-
</span>
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
return input;
|
|
249
201
|
}
|
|
250
202
|
|
|
251
203
|
handleChange: (string, () => void) => void = (newValue, cb) => {
|
|
@@ -431,16 +383,6 @@ const styles = StyleSheet.create({
|
|
|
431
383
|
paddingLeft: 0,
|
|
432
384
|
paddingRight: Spacing.xxxSmall_4,
|
|
433
385
|
},
|
|
434
|
-
answerStateCorrect: {
|
|
435
|
-
color: satCorrectColor,
|
|
436
|
-
backgroundColor: satCorrectBackgroundColor,
|
|
437
|
-
border: `solid 1px ${satCorrectBorderColor}`,
|
|
438
|
-
},
|
|
439
|
-
answerStateIncorrect: {
|
|
440
|
-
color: satIncorrectColor,
|
|
441
|
-
backgroundColor: satIncorrectBackgroundColor,
|
|
442
|
-
border: `solid 1px ${satIncorrectBorderColor}`,
|
|
443
|
-
},
|
|
444
386
|
answerStateUnanswered: {
|
|
445
387
|
backgroundColor: "#eee",
|
|
446
388
|
border: "solid 1px #999",
|
|
@@ -8,7 +8,6 @@ import * as React from "react";
|
|
|
8
8
|
import _ from "underscore";
|
|
9
9
|
|
|
10
10
|
import InputWithExamples from "../components/input-with-examples.jsx";
|
|
11
|
-
import PossibleAnswers from "../components/possible-answers.jsx";
|
|
12
11
|
import SimpleKeypadInput from "../components/simple-keypad-input.jsx";
|
|
13
12
|
import {ApiOptions} from "../perseus-api.jsx";
|
|
14
13
|
import TexWrangler from "../tex-wrangler.js";
|
|
@@ -16,7 +15,6 @@ import KhanAnswerTypes from "../util/answer-types.js";
|
|
|
16
15
|
import KhanMath from "../util/math.js";
|
|
17
16
|
|
|
18
17
|
import type {
|
|
19
|
-
MathFormat,
|
|
20
18
|
PerseusNumericInputAnswer,
|
|
21
19
|
PerseusNumericInputWidgetOptions,
|
|
22
20
|
PerseusNumericInputAnswerForm,
|
|
@@ -262,49 +260,6 @@ export class NumericInput extends React.Component<Props, State> {
|
|
|
262
260
|
previousValues: [""],
|
|
263
261
|
};
|
|
264
262
|
|
|
265
|
-
getAnswerBlurb: (Rubric) => [?React.Node, boolean] = (rubric) => {
|
|
266
|
-
let correct;
|
|
267
|
-
let answerBlurb;
|
|
268
|
-
|
|
269
|
-
/* Ignore this block because SAT is deprecated */
|
|
270
|
-
/* c8 ignore next */
|
|
271
|
-
if (this.props.apiOptions.satStyling && rubric) {
|
|
272
|
-
const score = this.simpleValidate(rubric);
|
|
273
|
-
correct = score.type === "points" && score.earned === score.total;
|
|
274
|
-
|
|
275
|
-
if (!correct) {
|
|
276
|
-
const correctAnswers = rubric.answers.filter(
|
|
277
|
-
(answer) => answer.status === "correct",
|
|
278
|
-
);
|
|
279
|
-
const answerStrings = correctAnswers.map((answer) => {
|
|
280
|
-
// Figure out how this answer is supposed to be
|
|
281
|
-
// displayed
|
|
282
|
-
let format: MathFormat = "decimal";
|
|
283
|
-
if (answer.answerForms && answer.answerForms[0]) {
|
|
284
|
-
// NOTE(johnsullivan): This isn't exactly ideal, but
|
|
285
|
-
// it does behave well for all the currently known
|
|
286
|
-
// problems. See D14742 for some discussion on
|
|
287
|
-
// alternate strategies.
|
|
288
|
-
format = answer.answerForms[0];
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
let answerString = KhanMath.toNumericString(
|
|
292
|
-
answer.value,
|
|
293
|
-
format,
|
|
294
|
-
);
|
|
295
|
-
if (answer.maxError) {
|
|
296
|
-
answerString +=
|
|
297
|
-
" \u00B1 " +
|
|
298
|
-
KhanMath.toNumericString(answer.maxError, format);
|
|
299
|
-
}
|
|
300
|
-
return answerString;
|
|
301
|
-
});
|
|
302
|
-
answerBlurb = <PossibleAnswers answers={answerStrings} />;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
return [answerBlurb, !!correct];
|
|
306
|
-
};
|
|
307
|
-
|
|
308
263
|
// TODO(Nicole, Jeremy): This is maybe never used and should be removed
|
|
309
264
|
examples: () => $ReadOnlyArray<string> = () => {
|
|
310
265
|
// if the set of specified forms are empty, allow all forms
|
|
@@ -416,10 +371,6 @@ export class NumericInput extends React.Component<Props, State> {
|
|
|
416
371
|
};
|
|
417
372
|
|
|
418
373
|
render(): React.Node {
|
|
419
|
-
const rubric = this.props.reviewModeRubric;
|
|
420
|
-
const answers = this.getAnswerBlurb(rubric);
|
|
421
|
-
const answerBlurb = answers[0];
|
|
422
|
-
|
|
423
374
|
let labelText = this.props.labelText;
|
|
424
375
|
if (labelText == null || labelText === "") {
|
|
425
376
|
labelText = i18n._("Your answer:");
|
|
@@ -460,47 +411,24 @@ export class NumericInput extends React.Component<Props, State> {
|
|
|
460
411
|
},
|
|
461
412
|
});
|
|
462
413
|
|
|
463
|
-
|
|
464
|
-
<
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
414
|
+
return (
|
|
415
|
+
<div>
|
|
416
|
+
<InputWithExamples
|
|
417
|
+
ref={(ref) => (this.inputRef = ref)}
|
|
418
|
+
value={this.props.currentValue}
|
|
419
|
+
onChange={this.handleChange}
|
|
420
|
+
labelText={labelText}
|
|
421
|
+
type={this._getInputType()}
|
|
422
|
+
examples={this.examples()}
|
|
423
|
+
shouldShowExamples={this.shouldShowExamples()}
|
|
424
|
+
onFocus={this._handleFocus}
|
|
425
|
+
onBlur={this._handleBlur}
|
|
426
|
+
id={this.props.widgetId}
|
|
427
|
+
disabled={this.props.apiOptions.readOnly}
|
|
428
|
+
style={styles.input}
|
|
429
|
+
/>
|
|
430
|
+
</div>
|
|
478
431
|
);
|
|
479
|
-
|
|
480
|
-
/* This only gets used with SAT Content */
|
|
481
|
-
/* c8 ignore next if */
|
|
482
|
-
if (answerBlurb) {
|
|
483
|
-
return (
|
|
484
|
-
<span className="perseus-input-with-answer-blurb">
|
|
485
|
-
{input}
|
|
486
|
-
{answerBlurb}
|
|
487
|
-
</span>
|
|
488
|
-
);
|
|
489
|
-
}
|
|
490
|
-
if (this.props.apiOptions.satStyling) {
|
|
491
|
-
// NOTE(amy): the input widgets themselves already have
|
|
492
|
-
// a default aria label of "Your Answer", so we hide this
|
|
493
|
-
// redundant label from screen-readers.
|
|
494
|
-
return (
|
|
495
|
-
<label className="perseus-input-with-label">
|
|
496
|
-
<span className="perseus-input-label" aria-hidden="true">
|
|
497
|
-
{i18n.doNotTranslate("Answer:")}
|
|
498
|
-
</span>
|
|
499
|
-
{input}
|
|
500
|
-
</label>
|
|
501
|
-
);
|
|
502
|
-
}
|
|
503
|
-
return <div>{input}</div>;
|
|
504
432
|
}
|
|
505
433
|
}
|
|
506
434
|
|
|
@@ -12,12 +12,9 @@ type StoryArgs = {|
|
|
|
12
12
|
pressed: boolean,
|
|
13
13
|
correct: boolean,
|
|
14
14
|
showCorrectness: boolean,
|
|
15
|
-
product: "sat" | "library",
|
|
16
15
|
multipleSelect: boolean,
|
|
17
16
|
reviewMode: boolean,
|
|
18
17
|
previouslyAnswered: boolean,
|
|
19
|
-
transparentBackground: boolean,
|
|
20
|
-
primaryProductColor?: string,
|
|
21
18
|
|};
|
|
22
19
|
|
|
23
20
|
const defaultProps = {
|
|
@@ -29,16 +26,9 @@ const defaultProps = {
|
|
|
29
26
|
pressed: false,
|
|
30
27
|
correct: false,
|
|
31
28
|
showCorrectness: false,
|
|
32
|
-
product: "library",
|
|
33
29
|
multipleSelect: false,
|
|
34
30
|
reviewMode: false,
|
|
35
31
|
previouslyAnswered: false,
|
|
36
|
-
transparentBackground: false,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const defaultSATProps = {
|
|
40
|
-
...defaultProps,
|
|
41
|
-
product: "sat",
|
|
42
32
|
};
|
|
43
33
|
|
|
44
34
|
export default {
|
|
@@ -47,98 +37,73 @@ export default {
|
|
|
47
37
|
pos: {
|
|
48
38
|
control: {type: "number", min: 0, max: 25, step: 1},
|
|
49
39
|
},
|
|
50
|
-
product: {
|
|
51
|
-
options: ["library", "sat"],
|
|
52
|
-
control: {type: "radio"},
|
|
53
|
-
},
|
|
54
40
|
},
|
|
55
41
|
args: defaultProps,
|
|
56
42
|
};
|
|
57
43
|
|
|
44
|
+
const Panel = (props: {|children: React.Node|}): React.Node => {
|
|
45
|
+
return <div style={{padding: "10px"}}>{props.children}</div>;
|
|
46
|
+
};
|
|
47
|
+
|
|
58
48
|
export const Interactive = (args: StoryArgs): React.Node => {
|
|
59
|
-
return
|
|
49
|
+
return (
|
|
50
|
+
<Panel>
|
|
51
|
+
<ChoiceIcon {...args} />
|
|
52
|
+
</Panel>
|
|
53
|
+
);
|
|
60
54
|
};
|
|
61
55
|
|
|
62
56
|
export const Default = (args: StoryArgs): React.Node => {
|
|
63
57
|
return (
|
|
64
|
-
|
|
65
|
-
<p>Library</p>
|
|
58
|
+
<Panel>
|
|
66
59
|
<ChoiceIcon {...defaultProps} />
|
|
67
60
|
<ChoiceIcon {...defaultProps} multipleSelect={true} />
|
|
68
|
-
|
|
69
|
-
<ChoiceIcon {...defaultSATProps} />
|
|
70
|
-
<ChoiceIcon {...defaultSATProps} multipleSelect={true} />
|
|
71
|
-
</>
|
|
61
|
+
</Panel>
|
|
72
62
|
);
|
|
73
63
|
};
|
|
74
64
|
|
|
75
65
|
export const Focused = (args: StoryArgs): React.Node => {
|
|
76
66
|
return (
|
|
77
|
-
|
|
78
|
-
<p>Library</p>
|
|
67
|
+
<Panel>
|
|
79
68
|
<ChoiceIcon {...defaultProps} focused={true} />
|
|
80
69
|
<ChoiceIcon
|
|
81
70
|
{...defaultProps}
|
|
82
71
|
focused={true}
|
|
83
72
|
multipleSelect={true}
|
|
84
73
|
/>
|
|
85
|
-
|
|
86
|
-
<ChoiceIcon {...defaultSATProps} focused={true} />
|
|
87
|
-
<ChoiceIcon
|
|
88
|
-
{...defaultSATProps}
|
|
89
|
-
focused={true}
|
|
90
|
-
multipleSelect={true}
|
|
91
|
-
/>
|
|
92
|
-
</>
|
|
74
|
+
</Panel>
|
|
93
75
|
);
|
|
94
76
|
};
|
|
95
77
|
|
|
96
78
|
export const Checked = (args: StoryArgs): React.Node => {
|
|
97
79
|
return (
|
|
98
|
-
|
|
99
|
-
<p>Library</p>
|
|
80
|
+
<Panel>
|
|
100
81
|
<ChoiceIcon {...defaultProps} checked={true} />
|
|
101
82
|
<ChoiceIcon
|
|
102
83
|
{...defaultProps}
|
|
103
84
|
checked={true}
|
|
104
85
|
multipleSelect={true}
|
|
105
86
|
/>
|
|
106
|
-
|
|
107
|
-
<ChoiceIcon {...defaultSATProps} checked={true} />
|
|
108
|
-
<ChoiceIcon
|
|
109
|
-
{...defaultSATProps}
|
|
110
|
-
checked={true}
|
|
111
|
-
multipleSelect={true}
|
|
112
|
-
/>
|
|
113
|
-
</>
|
|
87
|
+
</Panel>
|
|
114
88
|
);
|
|
115
89
|
};
|
|
116
90
|
|
|
117
91
|
export const CrossedOut = (args: StoryArgs): React.Node => {
|
|
118
92
|
return (
|
|
119
|
-
|
|
120
|
-
<p>Library</p>
|
|
93
|
+
<Panel>
|
|
121
94
|
<ChoiceIcon {...defaultProps} crossedOut={true} />
|
|
122
95
|
<ChoiceIcon
|
|
123
96
|
{...defaultProps}
|
|
124
97
|
crossedOut={true}
|
|
125
98
|
multipleSelect={true}
|
|
126
99
|
/>
|
|
127
|
-
|
|
128
|
-
<ChoiceIcon {...defaultSATProps} crossedOut={true} />
|
|
129
|
-
<ChoiceIcon
|
|
130
|
-
{...defaultSATProps}
|
|
131
|
-
crossedOut={true}
|
|
132
|
-
multipleSelect={true}
|
|
133
|
-
/>
|
|
134
|
-
</>
|
|
100
|
+
</Panel>
|
|
135
101
|
);
|
|
136
102
|
};
|
|
137
103
|
|
|
138
104
|
export const Correct = (args: StoryArgs): React.Node => {
|
|
139
105
|
return (
|
|
140
|
-
|
|
141
|
-
<p>Library</p>
|
|
106
|
+
<Panel>
|
|
142
107
|
<ChoiceIcon
|
|
143
108
|
{...defaultProps}
|
|
144
109
|
checked={true}
|
|
@@ -154,30 +119,13 @@ export const Correct = (args: StoryArgs): React.Node => {
|
|
|
154
119
|
reviewMode={true}
|
|
155
120
|
multipleSelect={true}
|
|
156
121
|
/>
|
|
157
|
-
|
|
158
|
-
<ChoiceIcon
|
|
159
|
-
{...defaultSATProps}
|
|
160
|
-
checked={true}
|
|
161
|
-
correct={true}
|
|
162
|
-
showCorrectness={true}
|
|
163
|
-
reviewMode={true}
|
|
164
|
-
/>
|
|
165
|
-
<ChoiceIcon
|
|
166
|
-
{...defaultSATProps}
|
|
167
|
-
checked={true}
|
|
168
|
-
correct={true}
|
|
169
|
-
showCorrectness={true}
|
|
170
|
-
reviewMode={true}
|
|
171
|
-
multipleSelect={true}
|
|
172
|
-
/>
|
|
173
|
-
</>
|
|
122
|
+
</Panel>
|
|
174
123
|
);
|
|
175
124
|
};
|
|
176
125
|
|
|
177
126
|
export const Incorrect = (args: StoryArgs): React.Node => {
|
|
178
127
|
return (
|
|
179
|
-
|
|
180
|
-
<p>Library</p>
|
|
128
|
+
<Panel>
|
|
181
129
|
<ChoiceIcon
|
|
182
130
|
{...defaultProps}
|
|
183
131
|
checked={true}
|
|
@@ -193,31 +141,14 @@ export const Incorrect = (args: StoryArgs): React.Node => {
|
|
|
193
141
|
reviewMode={true}
|
|
194
142
|
multipleSelect={true}
|
|
195
143
|
/>
|
|
196
|
-
|
|
197
|
-
<ChoiceIcon
|
|
198
|
-
{...defaultSATProps}
|
|
199
|
-
checked={true}
|
|
200
|
-
correct={false}
|
|
201
|
-
showCorrectness={true}
|
|
202
|
-
reviewMode={true}
|
|
203
|
-
/>
|
|
204
|
-
<ChoiceIcon
|
|
205
|
-
{...defaultSATProps}
|
|
206
|
-
checked={true}
|
|
207
|
-
correct={false}
|
|
208
|
-
showCorrectness={true}
|
|
209
|
-
reviewMode={true}
|
|
210
|
-
multipleSelect={true}
|
|
211
|
-
/>
|
|
212
|
-
</>
|
|
144
|
+
</Panel>
|
|
213
145
|
);
|
|
214
146
|
};
|
|
215
147
|
|
|
216
148
|
export const AllPositions = (args: StoryArgs): React.Node => {
|
|
217
149
|
const allLetters = Array(26).fill();
|
|
218
150
|
return (
|
|
219
|
-
|
|
220
|
-
<p>Library</p>
|
|
151
|
+
<Panel>
|
|
221
152
|
{allLetters.map((_, i: number) => (
|
|
222
153
|
<ChoiceIcon {...defaultProps} pos={i} key={"choice" + i} />
|
|
223
154
|
))}
|
|
@@ -230,19 +161,6 @@ export const AllPositions = (args: StoryArgs): React.Node => {
|
|
|
230
161
|
key={"choice" + i}
|
|
231
162
|
/>
|
|
232
163
|
))}
|
|
233
|
-
|
|
234
|
-
{allLetters.map((_, i: number) => (
|
|
235
|
-
<ChoiceIcon {...defaultSATProps} pos={i} key={"choice" + i} />
|
|
236
|
-
))}
|
|
237
|
-
<br />
|
|
238
|
-
{allLetters.map((_, i: number) => (
|
|
239
|
-
<ChoiceIcon
|
|
240
|
-
{...defaultSATProps}
|
|
241
|
-
pos={i}
|
|
242
|
-
multipleSelect={true}
|
|
243
|
-
key={"choice" + i}
|
|
244
|
-
/>
|
|
245
|
-
))}
|
|
246
|
-
</>
|
|
164
|
+
</Panel>
|
|
247
165
|
);
|
|
248
166
|
};
|
|
@@ -9,7 +9,6 @@ type StoryArgs = {|
|
|
|
9
9
|
correct: boolean,
|
|
10
10
|
previouslyAnswered: boolean,
|
|
11
11
|
reviewMode: boolean,
|
|
12
|
-
satStyling: boolean,
|
|
13
12
|
|};
|
|
14
13
|
|
|
15
14
|
type Story = {|
|
|
@@ -25,7 +24,6 @@ export default ({
|
|
|
25
24
|
correct: false,
|
|
26
25
|
previouslyAnswered: false,
|
|
27
26
|
reviewMode: true,
|
|
28
|
-
satStyling: false,
|
|
29
27
|
},
|
|
30
28
|
}: Story);
|
|
31
29
|
|
|
@@ -44,7 +42,6 @@ export const AllPossibleOutputs = (args: StoryArgs): React.Node => {
|
|
|
44
42
|
correct={true}
|
|
45
43
|
previouslyAnswered={true}
|
|
46
44
|
reviewMode={true}
|
|
47
|
-
satStyling={false}
|
|
48
45
|
/>
|
|
49
46
|
</div>
|
|
50
47
|
<hr />
|
|
@@ -56,7 +53,6 @@ export const AllPossibleOutputs = (args: StoryArgs): React.Node => {
|
|
|
56
53
|
correct={false}
|
|
57
54
|
previouslyAnswered={true}
|
|
58
55
|
reviewMode={true}
|
|
59
|
-
satStyling={false}
|
|
60
56
|
/>
|
|
61
57
|
</div>
|
|
62
58
|
<hr />
|
|
@@ -68,7 +64,6 @@ export const AllPossibleOutputs = (args: StoryArgs): React.Node => {
|
|
|
68
64
|
correct={true}
|
|
69
65
|
previouslyAnswered={true}
|
|
70
66
|
reviewMode={true}
|
|
71
|
-
satStyling={false}
|
|
72
67
|
/>
|
|
73
68
|
</div>
|
|
74
69
|
<hr />
|
|
@@ -80,7 +75,6 @@ export const AllPossibleOutputs = (args: StoryArgs): React.Node => {
|
|
|
80
75
|
correct={false}
|
|
81
76
|
previouslyAnswered={true}
|
|
82
77
|
reviewMode={true}
|
|
83
|
-
satStyling={false}
|
|
84
78
|
/>
|
|
85
79
|
</div>
|
|
86
80
|
<hr />
|
|
@@ -92,7 +86,6 @@ export const AllPossibleOutputs = (args: StoryArgs): React.Node => {
|
|
|
92
86
|
correct={false}
|
|
93
87
|
previouslyAnswered={false}
|
|
94
88
|
reviewMode={true}
|
|
95
|
-
satStyling={false}
|
|
96
89
|
/>
|
|
97
90
|
</div>
|
|
98
91
|
<hr />
|
|
@@ -104,7 +97,6 @@ export const AllPossibleOutputs = (args: StoryArgs): React.Node => {
|
|
|
104
97
|
correct={true}
|
|
105
98
|
previouslyAnswered={false}
|
|
106
99
|
reviewMode={true}
|
|
107
|
-
satStyling={false}
|
|
108
100
|
/>
|
|
109
101
|
</div>
|
|
110
102
|
</>
|