@khanacademy/perseus 1.3.4 → 1.3.5
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 +7 -0
- package/dist/es/index.js +89 -41
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +89 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/item-renderer_test.jsx.snap +1 -1
- package/src/__tests__/__snapshots__/server-item-renderer_test.jsx.snap +1 -1
- package/src/components/input-with-examples.jsx +12 -13
- package/src/index.js +1 -0
- package/src/multi-items/__tests__/__snapshots__/multi-renderer_test.js.snap +6 -6
- package/src/perseus-types.js +5 -4
- package/src/util.js +1 -1
- package/src/widgets/__stories__/input-number.stories.jsx +29 -3
- package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +5 -5
- package/src/widgets/__tests__/__snapshots__/input-number_test.jsx.snap +1 -1
- package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +52 -52
- package/src/widgets/input-number.jsx +65 -11
- package/src/widgets/numeric-input.jsx +3 -0
- package/src/widgets/radio/choice.jsx +1 -1
|
@@ -120,7 +120,7 @@ exports[`multi-choice question should snapshot the same when invalid: invalid st
|
|
|
120
120
|
aria-disabled="false"
|
|
121
121
|
aria-hidden="true"
|
|
122
122
|
aria-label=""
|
|
123
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
123
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
124
124
|
tabindex="0"
|
|
125
125
|
type="button"
|
|
126
126
|
>
|
|
@@ -245,7 +245,7 @@ exports[`multi-choice question should snapshot the same when invalid: invalid st
|
|
|
245
245
|
aria-disabled="false"
|
|
246
246
|
aria-hidden="true"
|
|
247
247
|
aria-label=""
|
|
248
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
248
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
249
249
|
tabindex="0"
|
|
250
250
|
type="button"
|
|
251
251
|
>
|
|
@@ -370,7 +370,7 @@ exports[`multi-choice question should snapshot the same when invalid: invalid st
|
|
|
370
370
|
aria-disabled="false"
|
|
371
371
|
aria-hidden="true"
|
|
372
372
|
aria-label=""
|
|
373
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
373
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
374
374
|
tabindex="0"
|
|
375
375
|
type="button"
|
|
376
376
|
>
|
|
@@ -486,7 +486,7 @@ exports[`multi-choice question should snapshot the same when invalid: invalid st
|
|
|
486
486
|
aria-disabled="false"
|
|
487
487
|
aria-hidden="true"
|
|
488
488
|
aria-label=""
|
|
489
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
489
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
490
490
|
tabindex="0"
|
|
491
491
|
type="button"
|
|
492
492
|
>
|
|
@@ -737,7 +737,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
737
737
|
aria-disabled="false"
|
|
738
738
|
aria-hidden="true"
|
|
739
739
|
aria-label=""
|
|
740
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
740
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
741
741
|
tabindex="0"
|
|
742
742
|
type="button"
|
|
743
743
|
>
|
|
@@ -875,7 +875,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
875
875
|
aria-disabled="false"
|
|
876
876
|
aria-hidden="true"
|
|
877
877
|
aria-label=""
|
|
878
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
878
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
879
879
|
tabindex="0"
|
|
880
880
|
type="button"
|
|
881
881
|
>
|
|
@@ -1000,7 +1000,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
1000
1000
|
aria-disabled="false"
|
|
1001
1001
|
aria-hidden="true"
|
|
1002
1002
|
aria-label=""
|
|
1003
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
1003
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
1004
1004
|
tabindex="0"
|
|
1005
1005
|
type="button"
|
|
1006
1006
|
>
|
|
@@ -1128,7 +1128,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
1128
1128
|
aria-disabled="false"
|
|
1129
1129
|
aria-hidden="true"
|
|
1130
1130
|
aria-label=""
|
|
1131
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
1131
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
1132
1132
|
tabindex="0"
|
|
1133
1133
|
type="button"
|
|
1134
1134
|
>
|
|
@@ -1353,7 +1353,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
1353
1353
|
aria-disabled="false"
|
|
1354
1354
|
aria-hidden="true"
|
|
1355
1355
|
aria-label=""
|
|
1356
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
1356
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
1357
1357
|
tabindex="0"
|
|
1358
1358
|
type="button"
|
|
1359
1359
|
>
|
|
@@ -1491,7 +1491,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
1491
1491
|
aria-disabled="false"
|
|
1492
1492
|
aria-hidden="true"
|
|
1493
1493
|
aria-label=""
|
|
1494
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
1494
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
1495
1495
|
tabindex="0"
|
|
1496
1496
|
type="button"
|
|
1497
1497
|
>
|
|
@@ -1616,7 +1616,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
1616
1616
|
aria-disabled="false"
|
|
1617
1617
|
aria-hidden="true"
|
|
1618
1618
|
aria-label=""
|
|
1619
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
1619
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
1620
1620
|
tabindex="0"
|
|
1621
1621
|
type="button"
|
|
1622
1622
|
>
|
|
@@ -1744,7 +1744,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
1744
1744
|
aria-disabled="false"
|
|
1745
1745
|
aria-hidden="true"
|
|
1746
1746
|
aria-label=""
|
|
1747
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
1747
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
1748
1748
|
tabindex="0"
|
|
1749
1749
|
type="button"
|
|
1750
1750
|
>
|
|
@@ -1969,7 +1969,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
1969
1969
|
aria-disabled="false"
|
|
1970
1970
|
aria-hidden="true"
|
|
1971
1971
|
aria-label=""
|
|
1972
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
1972
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
1973
1973
|
tabindex="0"
|
|
1974
1974
|
type="button"
|
|
1975
1975
|
>
|
|
@@ -2107,7 +2107,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
2107
2107
|
aria-disabled="false"
|
|
2108
2108
|
aria-hidden="true"
|
|
2109
2109
|
aria-label=""
|
|
2110
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
2110
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
2111
2111
|
tabindex="0"
|
|
2112
2112
|
type="button"
|
|
2113
2113
|
>
|
|
@@ -2232,7 +2232,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
2232
2232
|
aria-disabled="false"
|
|
2233
2233
|
aria-hidden="true"
|
|
2234
2234
|
aria-label=""
|
|
2235
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
2235
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
2236
2236
|
tabindex="0"
|
|
2237
2237
|
type="button"
|
|
2238
2238
|
>
|
|
@@ -2360,7 +2360,7 @@ exports[`single-choice question satStyling: false reviewMode: false should snaps
|
|
|
2360
2360
|
aria-disabled="false"
|
|
2361
2361
|
aria-hidden="true"
|
|
2362
2362
|
aria-label=""
|
|
2363
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
2363
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
2364
2364
|
tabindex="0"
|
|
2365
2365
|
type="button"
|
|
2366
2366
|
>
|
|
@@ -2585,7 +2585,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
2585
2585
|
aria-disabled="false"
|
|
2586
2586
|
aria-hidden="true"
|
|
2587
2587
|
aria-label=""
|
|
2588
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
2588
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
2589
2589
|
tabindex="0"
|
|
2590
2590
|
type="button"
|
|
2591
2591
|
>
|
|
@@ -2723,7 +2723,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
2723
2723
|
aria-disabled="false"
|
|
2724
2724
|
aria-hidden="true"
|
|
2725
2725
|
aria-label=""
|
|
2726
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
2726
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
2727
2727
|
tabindex="0"
|
|
2728
2728
|
type="button"
|
|
2729
2729
|
>
|
|
@@ -2848,7 +2848,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
2848
2848
|
aria-disabled="false"
|
|
2849
2849
|
aria-hidden="true"
|
|
2850
2850
|
aria-label=""
|
|
2851
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
2851
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
2852
2852
|
tabindex="0"
|
|
2853
2853
|
type="button"
|
|
2854
2854
|
>
|
|
@@ -2976,7 +2976,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
2976
2976
|
aria-disabled="false"
|
|
2977
2977
|
aria-hidden="true"
|
|
2978
2978
|
aria-label=""
|
|
2979
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
2979
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
2980
2980
|
tabindex="0"
|
|
2981
2981
|
type="button"
|
|
2982
2982
|
>
|
|
@@ -3201,7 +3201,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
3201
3201
|
aria-disabled="false"
|
|
3202
3202
|
aria-hidden="true"
|
|
3203
3203
|
aria-label=""
|
|
3204
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
3204
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
3205
3205
|
tabindex="0"
|
|
3206
3206
|
type="button"
|
|
3207
3207
|
>
|
|
@@ -3339,7 +3339,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
3339
3339
|
aria-disabled="false"
|
|
3340
3340
|
aria-hidden="true"
|
|
3341
3341
|
aria-label=""
|
|
3342
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
3342
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
3343
3343
|
tabindex="0"
|
|
3344
3344
|
type="button"
|
|
3345
3345
|
>
|
|
@@ -3464,7 +3464,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
3464
3464
|
aria-disabled="false"
|
|
3465
3465
|
aria-hidden="true"
|
|
3466
3466
|
aria-label=""
|
|
3467
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
3467
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
3468
3468
|
tabindex="0"
|
|
3469
3469
|
type="button"
|
|
3470
3470
|
>
|
|
@@ -3592,7 +3592,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
3592
3592
|
aria-disabled="false"
|
|
3593
3593
|
aria-hidden="true"
|
|
3594
3594
|
aria-label=""
|
|
3595
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
3595
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
3596
3596
|
tabindex="0"
|
|
3597
3597
|
type="button"
|
|
3598
3598
|
>
|
|
@@ -3817,7 +3817,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
3817
3817
|
aria-disabled="false"
|
|
3818
3818
|
aria-hidden="true"
|
|
3819
3819
|
aria-label=""
|
|
3820
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
3820
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
3821
3821
|
tabindex="0"
|
|
3822
3822
|
type="button"
|
|
3823
3823
|
>
|
|
@@ -4040,7 +4040,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
4040
4040
|
aria-disabled="false"
|
|
4041
4041
|
aria-hidden="true"
|
|
4042
4042
|
aria-label=""
|
|
4043
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
4043
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
4044
4044
|
tabindex="0"
|
|
4045
4045
|
type="button"
|
|
4046
4046
|
>
|
|
@@ -4234,7 +4234,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
4234
4234
|
aria-disabled="false"
|
|
4235
4235
|
aria-hidden="true"
|
|
4236
4236
|
aria-label=""
|
|
4237
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
4237
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
4238
4238
|
tabindex="0"
|
|
4239
4239
|
type="button"
|
|
4240
4240
|
>
|
|
@@ -4426,7 +4426,7 @@ exports[`single-choice question satStyling: false reviewMode: true should snapsh
|
|
|
4426
4426
|
aria-disabled="false"
|
|
4427
4427
|
aria-hidden="true"
|
|
4428
4428
|
aria-label=""
|
|
4429
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
4429
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
4430
4430
|
tabindex="0"
|
|
4431
4431
|
type="button"
|
|
4432
4432
|
>
|
|
@@ -4692,7 +4692,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
4692
4692
|
aria-disabled="false"
|
|
4693
4693
|
aria-hidden="true"
|
|
4694
4694
|
aria-label=""
|
|
4695
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
4695
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
4696
4696
|
tabindex="0"
|
|
4697
4697
|
type="button"
|
|
4698
4698
|
>
|
|
@@ -4825,7 +4825,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
4825
4825
|
aria-disabled="false"
|
|
4826
4826
|
aria-hidden="true"
|
|
4827
4827
|
aria-label=""
|
|
4828
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
4828
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
4829
4829
|
tabindex="0"
|
|
4830
4830
|
type="button"
|
|
4831
4831
|
>
|
|
@@ -4945,7 +4945,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
4945
4945
|
aria-disabled="false"
|
|
4946
4946
|
aria-hidden="true"
|
|
4947
4947
|
aria-label=""
|
|
4948
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
4948
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
4949
4949
|
tabindex="0"
|
|
4950
4950
|
type="button"
|
|
4951
4951
|
>
|
|
@@ -5068,7 +5068,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
5068
5068
|
aria-disabled="false"
|
|
5069
5069
|
aria-hidden="true"
|
|
5070
5070
|
aria-label=""
|
|
5071
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
5071
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
5072
5072
|
tabindex="0"
|
|
5073
5073
|
type="button"
|
|
5074
5074
|
>
|
|
@@ -5277,7 +5277,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
5277
5277
|
aria-disabled="false"
|
|
5278
5278
|
aria-hidden="true"
|
|
5279
5279
|
aria-label=""
|
|
5280
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
5280
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
5281
5281
|
tabindex="0"
|
|
5282
5282
|
type="button"
|
|
5283
5283
|
>
|
|
@@ -5410,7 +5410,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
5410
5410
|
aria-disabled="false"
|
|
5411
5411
|
aria-hidden="true"
|
|
5412
5412
|
aria-label=""
|
|
5413
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
5413
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
5414
5414
|
tabindex="0"
|
|
5415
5415
|
type="button"
|
|
5416
5416
|
>
|
|
@@ -5530,7 +5530,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
5530
5530
|
aria-disabled="false"
|
|
5531
5531
|
aria-hidden="true"
|
|
5532
5532
|
aria-label=""
|
|
5533
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
5533
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
5534
5534
|
tabindex="0"
|
|
5535
5535
|
type="button"
|
|
5536
5536
|
>
|
|
@@ -5653,7 +5653,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
5653
5653
|
aria-disabled="false"
|
|
5654
5654
|
aria-hidden="true"
|
|
5655
5655
|
aria-label=""
|
|
5656
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
5656
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
5657
5657
|
tabindex="0"
|
|
5658
5658
|
type="button"
|
|
5659
5659
|
>
|
|
@@ -5862,7 +5862,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
5862
5862
|
aria-disabled="false"
|
|
5863
5863
|
aria-hidden="true"
|
|
5864
5864
|
aria-label=""
|
|
5865
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
5865
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
5866
5866
|
tabindex="0"
|
|
5867
5867
|
type="button"
|
|
5868
5868
|
>
|
|
@@ -5995,7 +5995,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
5995
5995
|
aria-disabled="false"
|
|
5996
5996
|
aria-hidden="true"
|
|
5997
5997
|
aria-label=""
|
|
5998
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
5998
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
5999
5999
|
tabindex="0"
|
|
6000
6000
|
type="button"
|
|
6001
6001
|
>
|
|
@@ -6115,7 +6115,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
6115
6115
|
aria-disabled="false"
|
|
6116
6116
|
aria-hidden="true"
|
|
6117
6117
|
aria-label=""
|
|
6118
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
6118
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
6119
6119
|
tabindex="0"
|
|
6120
6120
|
type="button"
|
|
6121
6121
|
>
|
|
@@ -6238,7 +6238,7 @@ exports[`single-choice question satStyling: true reviewMode: false should snapsh
|
|
|
6238
6238
|
aria-disabled="false"
|
|
6239
6239
|
aria-hidden="true"
|
|
6240
6240
|
aria-label=""
|
|
6241
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
6241
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
6242
6242
|
tabindex="0"
|
|
6243
6243
|
type="button"
|
|
6244
6244
|
>
|
|
@@ -6447,7 +6447,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
6447
6447
|
aria-disabled="false"
|
|
6448
6448
|
aria-hidden="true"
|
|
6449
6449
|
aria-label=""
|
|
6450
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
6450
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
6451
6451
|
tabindex="0"
|
|
6452
6452
|
type="button"
|
|
6453
6453
|
>
|
|
@@ -6580,7 +6580,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
6580
6580
|
aria-disabled="false"
|
|
6581
6581
|
aria-hidden="true"
|
|
6582
6582
|
aria-label=""
|
|
6583
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
6583
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
6584
6584
|
tabindex="0"
|
|
6585
6585
|
type="button"
|
|
6586
6586
|
>
|
|
@@ -6700,7 +6700,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
6700
6700
|
aria-disabled="false"
|
|
6701
6701
|
aria-hidden="true"
|
|
6702
6702
|
aria-label=""
|
|
6703
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
6703
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
6704
6704
|
tabindex="0"
|
|
6705
6705
|
type="button"
|
|
6706
6706
|
>
|
|
@@ -6823,7 +6823,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
6823
6823
|
aria-disabled="false"
|
|
6824
6824
|
aria-hidden="true"
|
|
6825
6825
|
aria-label=""
|
|
6826
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
6826
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
6827
6827
|
tabindex="0"
|
|
6828
6828
|
type="button"
|
|
6829
6829
|
>
|
|
@@ -7032,7 +7032,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
7032
7032
|
aria-disabled="false"
|
|
7033
7033
|
aria-hidden="true"
|
|
7034
7034
|
aria-label=""
|
|
7035
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
7035
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
7036
7036
|
tabindex="0"
|
|
7037
7037
|
type="button"
|
|
7038
7038
|
>
|
|
@@ -7165,7 +7165,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
7165
7165
|
aria-disabled="false"
|
|
7166
7166
|
aria-hidden="true"
|
|
7167
7167
|
aria-label=""
|
|
7168
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
7168
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
7169
7169
|
tabindex="0"
|
|
7170
7170
|
type="button"
|
|
7171
7171
|
>
|
|
@@ -7285,7 +7285,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
7285
7285
|
aria-disabled="false"
|
|
7286
7286
|
aria-hidden="true"
|
|
7287
7287
|
aria-label=""
|
|
7288
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
7288
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
7289
7289
|
tabindex="0"
|
|
7290
7290
|
type="button"
|
|
7291
7291
|
>
|
|
@@ -7408,7 +7408,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
7408
7408
|
aria-disabled="false"
|
|
7409
7409
|
aria-hidden="true"
|
|
7410
7410
|
aria-label=""
|
|
7411
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
7411
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
7412
7412
|
tabindex="0"
|
|
7413
7413
|
type="button"
|
|
7414
7414
|
>
|
|
@@ -7617,7 +7617,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
7617
7617
|
aria-disabled="false"
|
|
7618
7618
|
aria-hidden="true"
|
|
7619
7619
|
aria-label=""
|
|
7620
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
7620
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
7621
7621
|
tabindex="0"
|
|
7622
7622
|
type="button"
|
|
7623
7623
|
>
|
|
@@ -7817,7 +7817,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
7817
7817
|
aria-disabled="false"
|
|
7818
7818
|
aria-hidden="true"
|
|
7819
7819
|
aria-label=""
|
|
7820
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
7820
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
7821
7821
|
tabindex="0"
|
|
7822
7822
|
type="button"
|
|
7823
7823
|
>
|
|
@@ -7988,7 +7988,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
7988
7988
|
aria-disabled="false"
|
|
7989
7989
|
aria-hidden="true"
|
|
7990
7990
|
aria-label=""
|
|
7991
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
7991
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
7992
7992
|
tabindex="0"
|
|
7993
7993
|
type="button"
|
|
7994
7994
|
>
|
|
@@ -8157,7 +8157,7 @@ exports[`single-choice question satStyling: true reviewMode: true should snapsho
|
|
|
8157
8157
|
aria-disabled="false"
|
|
8158
8158
|
aria-hidden="true"
|
|
8159
8159
|
aria-label=""
|
|
8160
|
-
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-
|
|
8160
|
+
class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1jvwfht"
|
|
8161
8161
|
tabindex="0"
|
|
8162
8162
|
type="button"
|
|
8163
8163
|
>
|
|
@@ -3,14 +3,23 @@
|
|
|
3
3
|
// @flow
|
|
4
4
|
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
5
5
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
6
|
-
import
|
|
6
|
+
import Spacing from "@khanacademy/wonder-blocks-spacing";
|
|
7
|
+
import {StyleSheet} from "aphrodite";
|
|
7
8
|
import * as React from "react";
|
|
8
9
|
import _ from "underscore";
|
|
9
10
|
|
|
10
11
|
import InputWithExamples from "../components/input-with-examples.jsx";
|
|
11
12
|
import PossibleAnswers from "../components/possible-answers.jsx";
|
|
12
13
|
import SimpleKeypadInput from "../components/simple-keypad-input.jsx";
|
|
13
|
-
import {
|
|
14
|
+
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";
|
|
14
23
|
import TexWrangler from "../tex-wrangler.js";
|
|
15
24
|
import KhanAnswerTypes from "../util/answer-types.js";
|
|
16
25
|
|
|
@@ -187,14 +196,26 @@ class InputNumber extends React.Component<Props> {
|
|
|
187
196
|
}
|
|
188
197
|
}
|
|
189
198
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
199
|
+
// Note: This is _very_ similar to what `numeric-input.jsx` does. If
|
|
200
|
+
// you modify this, double-check if you also need to modify that
|
|
201
|
+
// component.
|
|
202
|
+
const inputStyles = [
|
|
203
|
+
styles.default,
|
|
204
|
+
this.props.size === "small" ? styles.small : null,
|
|
205
|
+
this.props.rightAlign ? styles.rightAlign : styles.leftAlign,
|
|
206
|
+
];
|
|
207
|
+
// Correct
|
|
208
|
+
if (rubric && correct && this.props.currentValue) {
|
|
209
|
+
inputStyles.push(styles.answerStateCorrect);
|
|
210
|
+
}
|
|
211
|
+
// Incorrect
|
|
212
|
+
if (rubric && !correct && this.props.currentValue) {
|
|
213
|
+
inputStyles.push(styles.answerStateIncorrect);
|
|
214
|
+
}
|
|
215
|
+
// Unanswered
|
|
216
|
+
if (rubric && !this.props.currentValue) {
|
|
217
|
+
inputStyles.push(styles.answerStateUnanswered);
|
|
218
|
+
}
|
|
198
219
|
|
|
199
220
|
const input = (
|
|
200
221
|
<InputWithExamples
|
|
@@ -202,7 +223,7 @@ class InputNumber extends React.Component<Props> {
|
|
|
202
223
|
ref="input"
|
|
203
224
|
value={this.props.currentValue}
|
|
204
225
|
onChange={this.handleChange}
|
|
205
|
-
|
|
226
|
+
style={inputStyles}
|
|
206
227
|
type={this._getInputType()}
|
|
207
228
|
examples={this.examples()}
|
|
208
229
|
shouldShowExamples={this.shouldShowExamples()}
|
|
@@ -393,6 +414,39 @@ class InputNumber extends React.Component<Props> {
|
|
|
393
414
|
}
|
|
394
415
|
}
|
|
395
416
|
|
|
417
|
+
const styles = StyleSheet.create({
|
|
418
|
+
default: {
|
|
419
|
+
width: 80,
|
|
420
|
+
height: "auto",
|
|
421
|
+
},
|
|
422
|
+
small: {
|
|
423
|
+
width: 40,
|
|
424
|
+
},
|
|
425
|
+
leftAlign: {
|
|
426
|
+
paddingLeft: Spacing.xxxSmall_4,
|
|
427
|
+
paddingRight: 0,
|
|
428
|
+
},
|
|
429
|
+
rightAlign: {
|
|
430
|
+
textAlign: "right",
|
|
431
|
+
paddingLeft: 0,
|
|
432
|
+
paddingRight: Spacing.xxxSmall_4,
|
|
433
|
+
},
|
|
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
|
+
answerStateUnanswered: {
|
|
445
|
+
backgroundColor: "#eee",
|
|
446
|
+
border: "solid 1px #999",
|
|
447
|
+
},
|
|
448
|
+
});
|
|
449
|
+
|
|
396
450
|
const propTransform = (
|
|
397
451
|
widgetOptions: PerseusInputNumberWidgetOptions,
|
|
398
452
|
): RenderProps => {
|
|
@@ -448,6 +448,9 @@ export class NumericInput extends React.Component<Props, State> {
|
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
+
// Note: This is _very_ similar to what `input-number.jsx` does. If
|
|
452
|
+
// you modify this, double-check if you also need to modify that
|
|
453
|
+
// component.
|
|
451
454
|
const styles = StyleSheet.create({
|
|
452
455
|
input: {
|
|
453
456
|
textAlign: this.props.rightAlign ? "right" : "left",
|
|
@@ -228,7 +228,7 @@ function Choice(props: ChoicePropsWithForwardRef): React.Node {
|
|
|
228
228
|
apiOptions.staticRender ||
|
|
229
229
|
apiOptions.readOnly
|
|
230
230
|
}
|
|
231
|
-
style={{flex: 1, color: Color.offBlack}}
|
|
231
|
+
style={{flex: 1, color: Color.offBlack, userSelect: "text"}}
|
|
232
232
|
ref={(forwardedRef: any)}
|
|
233
233
|
aria-hidden="true"
|
|
234
234
|
>
|