@khanacademy/perseus-core 15.0.1 → 16.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/dist/data-schema.d.ts +1 -5
- package/dist/es/index.js +5 -5
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/radio-widget.d.ts +16 -5
- package/dist/parse-perseus-json/perseus-parsers/radio-widget.mockData.d.ts +42 -0
- package/dist/widgets/radio/index.d.ts +1 -1
- package/dist/widgets/radio/radio-util.d.ts +1 -4
- package/package.json +1 -1
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import type { ParsedValue } from "../parser-types";
|
|
2
|
+
declare const parseRadioWidgetV3: import("../parser-types").Parser<import("../..").WidgetOptions<"radio", import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
3
|
+
numCorrect: number | undefined;
|
|
4
|
+
choices: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
5
|
+
content: string;
|
|
6
|
+
rationale: string | undefined;
|
|
7
|
+
correct: boolean | undefined;
|
|
8
|
+
isNoneOfTheAbove: boolean | undefined;
|
|
9
|
+
}>[];
|
|
10
|
+
hasNoneOfTheAbove: boolean | undefined;
|
|
11
|
+
countChoices: boolean | undefined;
|
|
12
|
+
randomize: boolean | undefined;
|
|
13
|
+
multipleSelect: boolean | undefined;
|
|
14
|
+
deselectEnabled: boolean | undefined;
|
|
15
|
+
}>>>;
|
|
2
16
|
declare const parseRadioWidgetV2: import("../parser-types").Parser<import("../..").WidgetOptions<"radio", import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
3
17
|
numCorrect: number | undefined;
|
|
4
18
|
choices: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -51,24 +65,21 @@ declare const parseRadioWidgetV0: import("../parser-types").Parser<import("../..
|
|
|
51
65
|
displayCount: any;
|
|
52
66
|
noneOfTheAbove: false | undefined;
|
|
53
67
|
}>>>;
|
|
68
|
+
export declare function migrateV2toV3(widget: ParsedValue<typeof parseRadioWidgetV2>): ParsedValue<typeof parseRadioWidgetV3>;
|
|
54
69
|
export declare function migrateV1ToV2(widget: ParsedValue<typeof parseRadioWidgetV1>): ParsedValue<typeof parseRadioWidgetV2>;
|
|
55
70
|
export declare function migrateV0ToV1(widget: ParsedValue<typeof parseRadioWidgetV0>): ParsedValue<typeof parseRadioWidgetV1>;
|
|
56
71
|
export declare const parseRadioWidget: import("../parser-types").Parser<import("../..").WidgetOptions<"radio", import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
57
72
|
numCorrect: number | undefined;
|
|
58
73
|
choices: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
59
74
|
content: string;
|
|
60
|
-
|
|
75
|
+
rationale: string | undefined;
|
|
61
76
|
correct: boolean | undefined;
|
|
62
77
|
isNoneOfTheAbove: boolean | undefined;
|
|
63
|
-
widgets: import("../..").MakeWidgetMap<import("../..").PerseusWidgetTypes> | undefined;
|
|
64
78
|
}>[];
|
|
65
79
|
hasNoneOfTheAbove: boolean | undefined;
|
|
66
80
|
countChoices: boolean | undefined;
|
|
67
81
|
randomize: boolean | undefined;
|
|
68
82
|
multipleSelect: boolean | undefined;
|
|
69
83
|
deselectEnabled: boolean | undefined;
|
|
70
|
-
onePerLine: boolean | undefined;
|
|
71
|
-
displayCount: any;
|
|
72
|
-
noneOfTheAbove: false | undefined;
|
|
73
84
|
}>>>;
|
|
74
85
|
export {};
|
|
@@ -145,3 +145,45 @@ export declare const v2Widget: {
|
|
|
145
145
|
minor: number;
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
|
+
export declare const v3Widget: {
|
|
149
|
+
type: "radio";
|
|
150
|
+
graded: boolean;
|
|
151
|
+
options: {
|
|
152
|
+
choices: ({
|
|
153
|
+
content: string;
|
|
154
|
+
correct: boolean;
|
|
155
|
+
rationale: string;
|
|
156
|
+
isNoneOfTheAbove: boolean;
|
|
157
|
+
} | {
|
|
158
|
+
content: string;
|
|
159
|
+
correct: boolean;
|
|
160
|
+
rationale: string;
|
|
161
|
+
isNoneOfTheAbove?: undefined;
|
|
162
|
+
} | {
|
|
163
|
+
content: string;
|
|
164
|
+
correct: boolean;
|
|
165
|
+
isNoneOfTheAbove: boolean;
|
|
166
|
+
rationale?: undefined;
|
|
167
|
+
} | {
|
|
168
|
+
content: string;
|
|
169
|
+
rationale: string;
|
|
170
|
+
isNoneOfTheAbove: boolean;
|
|
171
|
+
correct?: undefined;
|
|
172
|
+
} | {
|
|
173
|
+
content: string;
|
|
174
|
+
correct?: undefined;
|
|
175
|
+
rationale?: undefined;
|
|
176
|
+
isNoneOfTheAbove?: undefined;
|
|
177
|
+
})[];
|
|
178
|
+
numCorrect: number;
|
|
179
|
+
hasNoneOfTheAbove: boolean;
|
|
180
|
+
countChoices: boolean;
|
|
181
|
+
randomize: boolean;
|
|
182
|
+
multipleSelect: boolean;
|
|
183
|
+
deselectEnabled: boolean;
|
|
184
|
+
};
|
|
185
|
+
version: {
|
|
186
|
+
major: number;
|
|
187
|
+
minor: number;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
@@ -4,7 +4,7 @@ export declare const currentVersion: {
|
|
|
4
4
|
major: number;
|
|
5
5
|
minor: number;
|
|
6
6
|
};
|
|
7
|
-
export type RadioDefaultWidgetOptions = Pick<PerseusRadioWidgetOptions, "choices" | "randomize" | "hasNoneOfTheAbove" | "multipleSelect" | "countChoices" | "deselectEnabled"
|
|
7
|
+
export type RadioDefaultWidgetOptions = Pick<PerseusRadioWidgetOptions, "choices" | "randomize" | "hasNoneOfTheAbove" | "multipleSelect" | "countChoices" | "deselectEnabled">;
|
|
8
8
|
export declare const defaultWidgetOptions: RadioDefaultWidgetOptions;
|
|
9
9
|
declare const radioWidgetLogic: WidgetLogic;
|
|
10
10
|
export default radioWidgetLogic;
|
|
@@ -11,14 +11,11 @@ type RadioPublicWidgetOptions = {
|
|
|
11
11
|
randomize?: PerseusRadioWidgetOptions["randomize"];
|
|
12
12
|
multipleSelect?: PerseusRadioWidgetOptions["multipleSelect"];
|
|
13
13
|
deselectEnabled?: PerseusRadioWidgetOptions["deselectEnabled"];
|
|
14
|
-
onePerLine?: PerseusRadioWidgetOptions["onePerLine"];
|
|
15
|
-
displayCount?: PerseusRadioWidgetOptions["displayCount"];
|
|
16
|
-
noneOfTheAbove?: PerseusRadioWidgetOptions["noneOfTheAbove"];
|
|
17
14
|
};
|
|
18
15
|
/**
|
|
19
16
|
* Only the options from each Radio choice that should be exposed to the client.
|
|
20
17
|
*/
|
|
21
|
-
type RadioChoicePublicData = Pick<PerseusRadioChoice, "content" | "isNoneOfTheAbove"
|
|
18
|
+
type RadioChoicePublicData = Pick<PerseusRadioChoice, "content" | "isNoneOfTheAbove">;
|
|
22
19
|
/**
|
|
23
20
|
* Shared functionality to determine if numCorrect is used, because:
|
|
24
21
|
*
|