@wix/auto_sdk_online-programs_quizzes 1.0.26 → 1.0.28
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/build/cjs/index.d.ts +54 -20
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +178 -74
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +126 -56
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +54 -20
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +178 -74
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +126 -56
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +54 -20
- package/build/internal/cjs/index.typings.d.ts +178 -74
- package/build/internal/cjs/meta.d.ts +126 -56
- package/build/internal/es/index.d.mts +54 -20
- package/build/internal/es/index.typings.d.mts +178 -74
- package/build/internal/es/meta.d.mts +126 -56
- package/package.json +2 -2
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A quiz definition used by an Online Programs quiz step.
|
|
5
|
+
*
|
|
6
|
+
* Create or clone a quiz, then assign the returned quiz ID to `step.quizOptions.id` when creating an Online Programs step. Quiz IDs are intentionally discovered through quiz-type steps rather than through a Quiz list or query method.
|
|
7
|
+
*
|
|
8
|
+
* New submissions are evaluated against the quiz definition that exists when the submission is created. Previously stored submissions retain their recorded grades and answer evaluations if the definition changes later.
|
|
9
|
+
*
|
|
10
|
+
* NOT-PRECEDENT: The production v1 entity retains its legacy `wix.achievements.quizzes.v1.quiz` identity for compatibility. The Online Programs placement and workflow described here provide its public product context.
|
|
11
|
+
*/
|
|
3
12
|
interface Quiz {
|
|
4
13
|
/**
|
|
5
|
-
* ID
|
|
14
|
+
* Quiz ID.
|
|
6
15
|
* @format GUID
|
|
7
16
|
* @readonly
|
|
8
17
|
*/
|
|
9
18
|
_id?: string | null;
|
|
10
|
-
/** Quiz settings */
|
|
19
|
+
/** Quiz title, passing grade, and attempt limit. New submissions use the current settings; stored submissions retain their recorded grade data. */
|
|
11
20
|
settings?: QuizSettings;
|
|
12
21
|
/**
|
|
13
|
-
*
|
|
22
|
+
* Current revision of the stored quiz definition. The revision changes when the definition changes. The public Quiz API doesn't currently provide an update method.
|
|
14
23
|
* @readonly
|
|
15
24
|
*/
|
|
16
25
|
revision?: string | null;
|
|
17
26
|
/**
|
|
18
|
-
*
|
|
27
|
+
* Date and time the quiz was created.
|
|
19
28
|
* @readonly
|
|
20
29
|
*/
|
|
21
30
|
_createdDate?: Date | null;
|
|
22
31
|
/**
|
|
23
|
-
*
|
|
32
|
+
* Date and time the quiz was last updated.
|
|
24
33
|
* @readonly
|
|
25
34
|
*/
|
|
26
35
|
_updatedDate?: Date | null;
|
|
27
36
|
/**
|
|
28
|
-
*
|
|
37
|
+
* Active questions in the quiz. Each `QuizField` defines one question and its answer input. Creating a quiz requires at least one question. An existing definition can have no active questions after its questions are deleted through another supported workflow; retrieving that definition doesn't fail solely because this list is empty.
|
|
38
|
+
*
|
|
39
|
+
* New submissions use the current questions; stored submissions retain their recorded answer evaluations. Reading an empty definition doesn't imply that it can be used to create a new quiz or accept submissions.
|
|
29
40
|
* @minSize 1
|
|
30
41
|
* @maxSize 200
|
|
31
42
|
*/
|
|
@@ -33,119 +44,130 @@ interface Quiz {
|
|
|
33
44
|
}
|
|
34
45
|
interface QuizSettings {
|
|
35
46
|
/**
|
|
36
|
-
*
|
|
47
|
+
* Minimum unweighted integer percentage required to pass, from `0` through `100`. The earned grade is calculated as `floor((correct answer count / submitted answer count) * 100)`; question `score` values don't weight it. Non-evaluable answers count as correct. If omitted, the submission has no earned or passing grade and its status is COMPLETED, even if an individual evaluated answer is incorrect.
|
|
37
48
|
* @max 100
|
|
38
49
|
*/
|
|
39
50
|
passingGrade?: number | null;
|
|
40
51
|
/**
|
|
41
|
-
* Quiz title
|
|
52
|
+
* Quiz title.
|
|
42
53
|
* @maxLength 200
|
|
43
54
|
*/
|
|
44
55
|
title?: string | null;
|
|
45
56
|
/**
|
|
46
|
-
*
|
|
57
|
+
* Maximum number of submissions allowed per submitter. If omitted, no attempt-limit check is applied. With `groupId`, the count uses group ID and submitter ID without filtering by quiz ID; otherwise, it uses quiz ID and submitter ID. Reusing a group ID across quizzes shares their attempt count.
|
|
47
58
|
* @min 1
|
|
48
59
|
*/
|
|
49
60
|
attempts?: number | null;
|
|
50
61
|
}
|
|
62
|
+
/** Defines one quiz question and its answer input. */
|
|
51
63
|
interface QuizField extends QuizFieldFieldTypeOneOf {
|
|
52
|
-
/**
|
|
64
|
+
/** Numeric input. */
|
|
53
65
|
numeric?: NumericField;
|
|
54
|
-
/**
|
|
66
|
+
/** Short-text input. */
|
|
55
67
|
shortText?: ShortTextField;
|
|
56
|
-
/**
|
|
68
|
+
/** Long-text input. Set this to an empty object (`{}`) to select it. */
|
|
57
69
|
longText?: LongTextField;
|
|
58
|
-
/**
|
|
70
|
+
/** Input with predefined options where only one option can be selected. */
|
|
59
71
|
singleChoice?: SingleChoiceField;
|
|
60
|
-
/**
|
|
72
|
+
/** Input with predefined options where multiple options can be selected. */
|
|
61
73
|
multiChoice?: MultiChoiceField;
|
|
62
|
-
/**
|
|
74
|
+
/** File-upload input. */
|
|
63
75
|
fileUpload?: FileUploadField;
|
|
64
76
|
/**
|
|
65
|
-
*
|
|
77
|
+
* Caller-generated GUID that identifies this question. Use a stable value that is unique within the quiz. Submission answer evaluations use this ID to identify the question.
|
|
66
78
|
* @format GUID
|
|
67
79
|
* @immutable
|
|
68
80
|
*/
|
|
69
81
|
_id?: string;
|
|
70
82
|
/**
|
|
71
|
-
*
|
|
83
|
+
* Stable key used to match a submitted answer to this question. Use a value that is unique within the quiz and don't change or reuse it for another question.
|
|
72
84
|
* @maxLength 200
|
|
73
85
|
* @immutable
|
|
74
86
|
*/
|
|
75
87
|
target?: string | null;
|
|
76
88
|
/**
|
|
77
|
-
* Question
|
|
89
|
+
* Question text.
|
|
78
90
|
* @minLength 1
|
|
79
91
|
* @maxLength 350
|
|
80
92
|
*/
|
|
81
93
|
question?: string | null;
|
|
82
|
-
/** Score
|
|
94
|
+
/** Score returned for evaluable answers, whether correct or incorrect. Omitted from non-evaluable answer evaluations. This value doesn't weight the submission's unweighted `earnedGrade` percentage. */
|
|
83
95
|
score?: number | null;
|
|
84
96
|
/**
|
|
85
|
-
*
|
|
97
|
+
* Feedback returned when an evaluable submitted answer is correct. Omitted for non-evaluable answers.
|
|
86
98
|
* @maxLength 350
|
|
87
99
|
*/
|
|
88
100
|
rightMessage?: string | null;
|
|
89
101
|
/**
|
|
90
|
-
*
|
|
102
|
+
* Feedback returned when an evaluable submitted answer is incorrect. Omitted for non-evaluable answers.
|
|
91
103
|
* @maxLength 350
|
|
92
104
|
*/
|
|
93
105
|
wrongMessage?: string | null;
|
|
94
106
|
}
|
|
95
107
|
/** @oneof */
|
|
96
108
|
interface QuizFieldFieldTypeOneOf {
|
|
97
|
-
/**
|
|
109
|
+
/** Numeric input. */
|
|
98
110
|
numeric?: NumericField;
|
|
99
|
-
/**
|
|
111
|
+
/** Short-text input. */
|
|
100
112
|
shortText?: ShortTextField;
|
|
101
|
-
/**
|
|
113
|
+
/** Long-text input. Set this to an empty object (`{}`) to select it. */
|
|
102
114
|
longText?: LongTextField;
|
|
103
|
-
/**
|
|
115
|
+
/** Input with predefined options where only one option can be selected. */
|
|
104
116
|
singleChoice?: SingleChoiceField;
|
|
105
|
-
/**
|
|
117
|
+
/** Input with predefined options where multiple options can be selected. */
|
|
106
118
|
multiChoice?: MultiChoiceField;
|
|
107
|
-
/**
|
|
119
|
+
/** File-upload input. */
|
|
108
120
|
fileUpload?: FileUploadField;
|
|
109
121
|
}
|
|
122
|
+
/** File categories used by Wix Forms. Categories don't define a custom extension or MIME-type allowlist; accepted file types are controlled by Wix Forms. See [About form fields](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/about-form-fields). */
|
|
110
123
|
declare enum FileUploadFormat {
|
|
111
|
-
/** Image
|
|
124
|
+
/** Image-file category. */
|
|
112
125
|
IMAGE = "IMAGE",
|
|
113
|
-
/** Video
|
|
126
|
+
/** Video-file category. */
|
|
114
127
|
VIDEO = "VIDEO",
|
|
115
|
-
/** Audio
|
|
128
|
+
/** Audio-file category. */
|
|
116
129
|
AUDIO = "AUDIO",
|
|
117
|
-
/** Document
|
|
130
|
+
/** Document-file category. */
|
|
118
131
|
DOCUMENT = "DOCUMENT",
|
|
119
|
-
/** Archive
|
|
132
|
+
/** Archive-file category. */
|
|
120
133
|
ARCHIVE = "ARCHIVE",
|
|
121
|
-
/** 3D
|
|
134
|
+
/** 3D-model-file category. */
|
|
122
135
|
MODEL_3D = "MODEL_3D"
|
|
123
136
|
}
|
|
124
137
|
/** @enumType */
|
|
125
138
|
type FileUploadFormatWithLiterals = FileUploadFormat | 'IMAGE' | 'VIDEO' | 'AUDIO' | 'DOCUMENT' | 'ARCHIVE' | 'MODEL_3D';
|
|
126
139
|
interface NumericField {
|
|
127
|
-
/**
|
|
140
|
+
/**
|
|
141
|
+
* Correct numeric value. Matching is exact. If no correct value is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.
|
|
142
|
+
*
|
|
143
|
+
* Omitted from responses when the caller lacks achievements:quizzes:v1:quiz:read_sensitive_fields permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct value is stored.
|
|
144
|
+
*/
|
|
128
145
|
rightAnswer?: number | null;
|
|
129
146
|
}
|
|
130
147
|
interface ShortTextField {
|
|
131
148
|
/**
|
|
132
|
-
*
|
|
149
|
+
* Correct text. Matching trims leading and trailing whitespace and is case-insensitive. If no correct text is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.
|
|
150
|
+
*
|
|
151
|
+
* Omitted from responses when the caller lacks achievements:quizzes:v1:quiz:read_sensitive_fields permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct text is stored.
|
|
133
152
|
* @minLength 1
|
|
134
153
|
* @maxLength 200
|
|
135
154
|
*/
|
|
136
155
|
rightAnswer?: string | null;
|
|
137
156
|
}
|
|
157
|
+
/** Long-text input settings. Set `longText` to an empty object (`{}`) to select this input. Long-text answers aren't evaluated and count as correct when calculating the earned grade. */
|
|
138
158
|
interface LongTextField {
|
|
139
159
|
}
|
|
140
160
|
interface SingleChoiceField {
|
|
141
161
|
/**
|
|
142
|
-
*
|
|
162
|
+
* Correct option. When supplied, it must exactly match an entry in `options`; otherwise, creation fails with INVALID_QUIZ. Matching submitted answers is exact. If no correct option is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.
|
|
163
|
+
*
|
|
164
|
+
* Omitted from responses when the caller lacks achievements:quizzes:v1:quiz:read_sensitive_fields permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct option is stored.
|
|
143
165
|
* @minLength 1
|
|
144
166
|
* @maxLength 350
|
|
145
167
|
*/
|
|
146
168
|
rightAnswer?: string | null;
|
|
147
169
|
/**
|
|
148
|
-
*
|
|
170
|
+
* Options available to the participant. Labels must be unique; comparison is case-sensitive. Duplicate labels are rejected with INVALID_QUIZ before creation.
|
|
149
171
|
* @minSize 1
|
|
150
172
|
* @maxSize 90
|
|
151
173
|
* @minLength 1
|
|
@@ -153,17 +175,19 @@ interface SingleChoiceField {
|
|
|
153
175
|
*/
|
|
154
176
|
options?: string[] | null;
|
|
155
177
|
}
|
|
178
|
+
/** Multiple-choice input settings. Existing Wix Forms image-choice questions are also returned in this shape, even when their original settings allow only one selection. Image-choice-specific settings aren't exposed by the Quiz API. */
|
|
156
179
|
interface MultiChoiceField {
|
|
157
180
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
181
|
+
* Correct options. Every supplied value must exactly match an entry in `options`; otherwise, creation fails with INVALID_QUIZ. Matching submitted answers ignores option order but doesn't ignore duplicate values. If no correct options are stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.
|
|
182
|
+
*
|
|
183
|
+
* Empty in responses when the caller lacks achievements:quizzes:v1:quiz:read_sensitive_fields permission. Response filtering doesn't remove stored keys or change grading; an empty response list doesn't mean no correct options are stored.
|
|
160
184
|
* @maxSize 90
|
|
161
185
|
* @minLength 1
|
|
162
186
|
* @maxLength 350
|
|
163
187
|
*/
|
|
164
188
|
rightAnswer?: string[] | null;
|
|
165
189
|
/**
|
|
166
|
-
*
|
|
190
|
+
* Options available to the participant.
|
|
167
191
|
* @minSize 1
|
|
168
192
|
* @maxSize 90
|
|
169
193
|
* @minLength 1
|
|
@@ -173,42 +197,42 @@ interface MultiChoiceField {
|
|
|
173
197
|
}
|
|
174
198
|
interface FileUploadField {
|
|
175
199
|
/**
|
|
176
|
-
* Text
|
|
200
|
+
* Text displayed on the upload button. Default: `Upload`.
|
|
177
201
|
* @minLength 1
|
|
178
202
|
* @maxLength 100
|
|
179
203
|
*/
|
|
180
204
|
buttonText?: string | null;
|
|
181
205
|
/**
|
|
182
|
-
*
|
|
206
|
+
* Maximum number of files a participant can upload for this question, from `1` through `10`. Default: `10`.
|
|
183
207
|
* @min 1
|
|
184
208
|
* @max 10
|
|
185
209
|
*/
|
|
186
210
|
itemsLimit?: number | null;
|
|
187
211
|
/**
|
|
188
|
-
*
|
|
212
|
+
* Wix Forms file categories that participants can upload.
|
|
189
213
|
*
|
|
190
|
-
* Specify at least one format. `UNKNOWN_FILE_UPLOAD_FORMAT` isn't supported as a format selection.
|
|
214
|
+
* Specify at least one format. `UNKNOWN_FILE_UPLOAD_FORMAT` isn't supported as a format selection. File-upload answers aren't evaluated and count as correct when calculating the earned grade.
|
|
191
215
|
* @maxSize 6
|
|
192
216
|
*/
|
|
193
217
|
fileUploadFormats?: FileUploadFormatWithLiterals[];
|
|
194
218
|
}
|
|
195
219
|
interface CreateQuizRequest {
|
|
196
|
-
/** Quiz to
|
|
220
|
+
/** Quiz definition to create. Generate a stable unique GUID for every `quiz.fields.id` value. */
|
|
197
221
|
quiz: Quiz;
|
|
198
222
|
}
|
|
199
223
|
interface CreateQuizResponse {
|
|
200
|
-
/** Created quiz */
|
|
224
|
+
/** Created quiz definition. Assign its `id` to `step.quizOptions.id` to create an Online Programs quiz step. */
|
|
201
225
|
quiz?: Quiz;
|
|
202
226
|
}
|
|
203
227
|
interface CloneQuizRequest {
|
|
204
228
|
/**
|
|
205
|
-
* ID of the quiz to
|
|
229
|
+
* ID of the quiz definition to clone.
|
|
206
230
|
* @format GUID
|
|
207
231
|
*/
|
|
208
232
|
quizId: string;
|
|
209
233
|
}
|
|
210
234
|
interface CloneQuizResponse {
|
|
211
|
-
/** Cloned quiz */
|
|
235
|
+
/** Cloned quiz definition with a new ID. Step associations and submissions aren't cloned. */
|
|
212
236
|
quiz?: Quiz;
|
|
213
237
|
}
|
|
214
238
|
interface BulkCreateQuizzesRequest {
|
|
@@ -254,7 +278,7 @@ interface ApplicationError {
|
|
|
254
278
|
data?: Record<string, any> | null;
|
|
255
279
|
}
|
|
256
280
|
interface BulkCreateQuizzesResponseBulkQuizResult {
|
|
257
|
-
/** Metadata for the individual create operation. */
|
|
281
|
+
/** Metadata for the individual create operation. When the operation fails, `error` contains the original Wix Forms application error. */
|
|
258
282
|
itemMetadata?: ItemMetadata;
|
|
259
283
|
/** Created quiz. Empty when `return_entity` is `false`. */
|
|
260
284
|
item?: Quiz;
|
|
@@ -296,29 +320,29 @@ interface BulkQuizResult {
|
|
|
296
320
|
}
|
|
297
321
|
interface GetQuizRequest {
|
|
298
322
|
/**
|
|
299
|
-
* ID
|
|
323
|
+
* Quiz ID, available from `step.quizOptions.id` on a quiz-type Online Programs step.
|
|
300
324
|
* @format GUID
|
|
301
325
|
*/
|
|
302
326
|
quizId: string;
|
|
303
327
|
}
|
|
304
328
|
interface GetQuizResponse {
|
|
305
|
-
/** Requested quiz */
|
|
329
|
+
/** Requested quiz definition. */
|
|
306
330
|
quiz?: Quiz;
|
|
307
331
|
}
|
|
308
332
|
interface DeleteQuizRequest {
|
|
309
333
|
/**
|
|
310
|
-
* ID of quiz
|
|
334
|
+
* ID of the quiz definition to permanently delete.
|
|
311
335
|
* @format GUID
|
|
312
336
|
*/
|
|
313
337
|
quizId: string;
|
|
314
338
|
}
|
|
315
339
|
interface DeleteQuizResponse {
|
|
316
|
-
/**
|
|
340
|
+
/** Permanently deleted quiz definition. */
|
|
317
341
|
quiz?: Quiz;
|
|
318
342
|
}
|
|
319
343
|
interface BulkDeleteQuizzesRequest {
|
|
320
344
|
/**
|
|
321
|
-
* IDs of the
|
|
345
|
+
* IDs of the quiz definitions to permanently delete. Coordinate deletion with the Steps API and remove known step references first.
|
|
322
346
|
* @minSize 1
|
|
323
347
|
* @maxSize 100
|
|
324
348
|
* @format GUID
|
|
@@ -336,7 +360,7 @@ interface BulkDeleteQuizzesResponse {
|
|
|
336
360
|
bulkActionMetadata?: BulkActionMetadata;
|
|
337
361
|
}
|
|
338
362
|
interface BulkDeleteQuizzesResponseBulkQuizResult {
|
|
339
|
-
/** Metadata for the individual delete operation. */
|
|
363
|
+
/** Metadata for the individual delete operation. When the operation fails, `error` contains the original Wix Forms application error. */
|
|
340
364
|
itemMetadata?: ItemMetadata;
|
|
341
365
|
}
|
|
342
366
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
@@ -492,9 +516,57 @@ interface AccountInfo {
|
|
|
492
516
|
*/
|
|
493
517
|
siteId?: string | null;
|
|
494
518
|
}
|
|
519
|
+
/** @docsIgnore */
|
|
520
|
+
type CreateQuizApplicationErrors = {
|
|
521
|
+
code?: 'INVALID_QUIZ';
|
|
522
|
+
description?: string;
|
|
523
|
+
data?: Record<string, any>;
|
|
524
|
+
} | {
|
|
525
|
+
code?: 'QUIZ_CONFLICT';
|
|
526
|
+
description?: string;
|
|
527
|
+
data?: Record<string, any>;
|
|
528
|
+
};
|
|
529
|
+
/** @docsIgnore */
|
|
530
|
+
type CloneQuizApplicationErrors = {
|
|
531
|
+
code?: 'INVALID_QUIZ';
|
|
532
|
+
description?: string;
|
|
533
|
+
data?: Record<string, any>;
|
|
534
|
+
} | {
|
|
535
|
+
code?: 'QUIZ_NOT_FOUND';
|
|
536
|
+
description?: string;
|
|
537
|
+
data?: Record<string, any>;
|
|
538
|
+
} | {
|
|
539
|
+
code?: 'QUIZ_CONFLICT';
|
|
540
|
+
description?: string;
|
|
541
|
+
data?: Record<string, any>;
|
|
542
|
+
};
|
|
543
|
+
/** @docsIgnore */
|
|
544
|
+
type BulkCreateQuizzesApplicationErrors = {
|
|
545
|
+
code?: 'INVALID_QUIZ';
|
|
546
|
+
description?: string;
|
|
547
|
+
data?: Record<string, any>;
|
|
548
|
+
};
|
|
549
|
+
/** @docsIgnore */
|
|
550
|
+
type GetQuizApplicationErrors = {
|
|
551
|
+
code?: 'QUIZ_NOT_FOUND';
|
|
552
|
+
description?: string;
|
|
553
|
+
data?: Record<string, any>;
|
|
554
|
+
};
|
|
555
|
+
/** @docsIgnore */
|
|
556
|
+
type DeleteQuizApplicationErrors = {
|
|
557
|
+
code?: 'QUIZ_NOT_FOUND';
|
|
558
|
+
description?: string;
|
|
559
|
+
data?: Record<string, any>;
|
|
560
|
+
} | {
|
|
561
|
+
code?: 'QUIZ_CONFLICT';
|
|
562
|
+
description?: string;
|
|
563
|
+
data?: Record<string, any>;
|
|
564
|
+
};
|
|
495
565
|
/**
|
|
496
|
-
* Creates quiz
|
|
497
|
-
*
|
|
566
|
+
* Creates a detached quiz definition with at least one question.
|
|
567
|
+
*
|
|
568
|
+
* To use the quiz in an Online Program, pass the returned quiz ID as `step.quizOptions.id` when calling the Steps API's `CreateStep` or `BulkCreateSteps` method.
|
|
569
|
+
* @param quiz - Quiz definition to create. Generate a stable unique GUID for every `quiz.fields.id` value.
|
|
498
570
|
* @public
|
|
499
571
|
* @requiredField quiz
|
|
500
572
|
* @requiredField quiz.fields
|
|
@@ -506,22 +578,38 @@ interface AccountInfo {
|
|
|
506
578
|
* @requiredField quiz.fields.target
|
|
507
579
|
* @permissionId QUIZZES.CREATE_QUIZ
|
|
508
580
|
* @applicableIdentity APP
|
|
509
|
-
* @returns Created quiz
|
|
581
|
+
* @returns Created quiz definition. Assign its `id` to `step.quizOptions.id` to create an Online Programs quiz step.
|
|
510
582
|
* @fqn wix.achievements.quizzes.v1.QuizService.CreateQuiz
|
|
511
583
|
*/
|
|
512
|
-
declare function createQuiz(quiz: NonNullablePaths<Quiz, `fields` | `fields.${number}._id` | `fields.${number}.multiChoice.options` | `fields.${number}.question` | `fields.${number}.singleChoice.options` | `fields.${number}.target`, 3>): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 2
|
|
584
|
+
declare function createQuiz(quiz: NonNullablePaths<Quiz, `fields` | `fields.${number}._id` | `fields.${number}.multiChoice.options` | `fields.${number}.question` | `fields.${number}.singleChoice.options` | `fields.${number}.target`, 3>): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 2> & {
|
|
585
|
+
__applicationErrorsType?: CreateQuizApplicationErrors;
|
|
586
|
+
}>;
|
|
513
587
|
/**
|
|
514
|
-
* Clones quiz
|
|
515
|
-
*
|
|
588
|
+
* Clones a quiz definition and returns a new quiz ID.
|
|
589
|
+
*
|
|
590
|
+
* Checks the source before cloning. An existing definition found to have no active questions is rejected with INVALID_QUIZ before cloning. Source checks aren't atomic with cloning.
|
|
591
|
+
*
|
|
592
|
+
* This operation copies the question and settings definition only. It doesn't copy Online Programs step associations or quiz submissions. Attach the returned ID to a step separately when needed.
|
|
593
|
+
* @param quizId - ID of the quiz definition to clone.
|
|
516
594
|
* @public
|
|
517
595
|
* @requiredField quizId
|
|
518
596
|
* @permissionId QUIZZES.CREATE_QUIZ
|
|
519
597
|
* @applicableIdentity APP
|
|
520
598
|
* @fqn wix.achievements.quizzes.v1.QuizService.CloneQuiz
|
|
521
599
|
*/
|
|
522
|
-
declare function cloneQuiz(quizId: string): Promise<NonNullablePaths<CloneQuizResponse, `quiz.fields` | `quiz.fields.${number}._id`, 3
|
|
600
|
+
declare function cloneQuiz(quizId: string): Promise<NonNullablePaths<CloneQuizResponse, `quiz.fields` | `quiz.fields.${number}._id`, 3> & {
|
|
601
|
+
__applicationErrorsType?: CloneQuizApplicationErrors;
|
|
602
|
+
}>;
|
|
523
603
|
/**
|
|
524
|
-
* Creates up to 30 quiz definitions in a single API call.
|
|
604
|
+
* Creates up to 30 detached quiz definitions in a single API call. Each definition must contain at least one question.
|
|
605
|
+
*
|
|
606
|
+
* Quiz IDs, revisions, and creation and update timestamps are assigned by the server. Client-supplied values for these read-only fields are ignored. Question IDs (`quizzes.fields.id`) must be supplied by the caller.
|
|
607
|
+
*
|
|
608
|
+
* Invalid quiz definitions fail the entire request before any quizzes are created.
|
|
609
|
+
*
|
|
610
|
+
* Individual item failures don't fail the bulk request. For each failed item, `results.itemMetadata.error` contains the original application error from the Wix Forms operation.
|
|
611
|
+
*
|
|
612
|
+
* To use the quizzes in an Online Program, pass the returned quiz IDs as `step.quizOptions.id` values when calling the Steps API's `CreateStep` or `BulkCreateSteps` method.
|
|
525
613
|
* @param quizzes - Quiz definitions to create.
|
|
526
614
|
* @public
|
|
527
615
|
* @documentationMaturity preview
|
|
@@ -537,7 +625,9 @@ declare function cloneQuiz(quizId: string): Promise<NonNullablePaths<CloneQuizRe
|
|
|
537
625
|
* @applicableIdentity APP
|
|
538
626
|
* @fqn wix.achievements.quizzes.v1.QuizService.BulkCreateQuizzes
|
|
539
627
|
*/
|
|
540
|
-
declare function bulkCreateQuizzes(quizzes: NonNullablePaths<Quiz, `fields` | `fields.${number}._id` | `fields.${number}.multiChoice.options` | `fields.${number}.question` | `fields.${number}.singleChoice.options` | `fields.${number}.target`, 3>[], options?: BulkCreateQuizzesOptions): Promise<NonNullablePaths<BulkCreateQuizzesResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4
|
|
628
|
+
declare function bulkCreateQuizzes(quizzes: NonNullablePaths<Quiz, `fields` | `fields.${number}._id` | `fields.${number}.multiChoice.options` | `fields.${number}.question` | `fields.${number}.singleChoice.options` | `fields.${number}.target`, 3>[], options?: BulkCreateQuizzesOptions): Promise<NonNullablePaths<BulkCreateQuizzesResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4> & {
|
|
629
|
+
__applicationErrorsType?: BulkCreateQuizzesApplicationErrors;
|
|
630
|
+
}>;
|
|
541
631
|
interface BulkCreateQuizzesOptions {
|
|
542
632
|
/**
|
|
543
633
|
* Whether to return the created quizzes in the response.
|
|
@@ -547,31 +637,45 @@ interface BulkCreateQuizzesOptions {
|
|
|
547
637
|
returnEntity?: boolean;
|
|
548
638
|
}
|
|
549
639
|
/**
|
|
550
|
-
*
|
|
551
|
-
*
|
|
640
|
+
* Retrieves a quiz definition by ID. A stored definition whose questions have all been deleted can be returned with no active questions.
|
|
641
|
+
*
|
|
642
|
+
* To discover a quiz ID, query or retrieve its quiz-type Online Programs step and read `step.quizOptions.id`.
|
|
643
|
+
* @param quizId - Quiz ID, available from `step.quizOptions.id` on a quiz-type Online Programs step.
|
|
552
644
|
* @public
|
|
553
645
|
* @requiredField quizId
|
|
554
646
|
* @permissionId achievements:quizzes:v1:quiz:get_quiz
|
|
555
647
|
* @applicableIdentity APP
|
|
556
|
-
* @returns Requested quiz
|
|
648
|
+
* @returns Requested quiz definition.
|
|
557
649
|
* @fqn wix.achievements.quizzes.v1.QuizService.GetQuiz
|
|
558
650
|
*/
|
|
559
|
-
declare function getQuiz(quizId: string): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 2
|
|
651
|
+
declare function getQuiz(quizId: string): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 2> & {
|
|
652
|
+
__applicationErrorsType?: GetQuizApplicationErrors;
|
|
653
|
+
}>;
|
|
560
654
|
/**
|
|
561
|
-
*
|
|
562
|
-
*
|
|
655
|
+
* Permanently deletes a quiz definition.
|
|
656
|
+
*
|
|
657
|
+
* This operation doesn't check whether Online Programs steps reference the quiz. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.
|
|
658
|
+
*
|
|
659
|
+
* NOT-PRECEDENT: This caller-responsibility behavior is retained as a production v1 compatibility exception. New delete APIs should provide an authoritative server-side reference safeguard.
|
|
660
|
+
* @param quizId - ID of the quiz definition to permanently delete.
|
|
563
661
|
* @public
|
|
564
662
|
* @requiredField quizId
|
|
565
663
|
* @permissionId QUIZZES.DELETE_QUIZ
|
|
566
664
|
* @applicableIdentity APP
|
|
567
665
|
* @fqn wix.achievements.quizzes.v1.QuizService.DeleteQuiz
|
|
568
666
|
*/
|
|
569
|
-
declare function deleteQuiz(quizId: string): Promise<NonNullablePaths<DeleteQuizResponse, `quiz.fields` | `quiz.fields.${number}._id`, 3
|
|
667
|
+
declare function deleteQuiz(quizId: string): Promise<NonNullablePaths<DeleteQuizResponse, `quiz.fields` | `quiz.fields.${number}._id`, 3> & {
|
|
668
|
+
__applicationErrorsType?: DeleteQuizApplicationErrors;
|
|
669
|
+
}>;
|
|
570
670
|
/**
|
|
571
671
|
* Permanently deletes up to 100 quiz definitions.
|
|
572
672
|
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
673
|
+
* Individual item failures don't fail the bulk request. For each failed item, `results.itemMetadata.error` contains the original application error from the Wix Forms operation.
|
|
674
|
+
*
|
|
675
|
+
* This operation doesn't check whether Online Programs steps reference the quizzes. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.
|
|
676
|
+
*
|
|
677
|
+
* NOT-PRECEDENT: This caller-responsibility behavior is retained as a production v1 compatibility exception. New bulk-delete APIs should provide an authoritative server-side reference safeguard.
|
|
678
|
+
* @param quizIds - IDs of the quiz definitions to permanently delete. Coordinate deletion with the Steps API and remove known step references first.
|
|
575
679
|
* @public
|
|
576
680
|
* @documentationMaturity preview
|
|
577
681
|
* @requiredField quizIds
|
|
@@ -581,4 +685,4 @@ declare function deleteQuiz(quizId: string): Promise<NonNullablePaths<DeleteQuiz
|
|
|
581
685
|
*/
|
|
582
686
|
declare function bulkDeleteQuizzes(quizIds: string[]): Promise<NonNullablePaths<BulkDeleteQuizzesResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4>>;
|
|
583
687
|
|
|
584
|
-
export { type AccountInfo, type ActionEvent, type ApplicationError, type BulkActionMetadata, type BulkCloneQuizzesRequest, type BulkCloneQuizzesResponse, type BulkCreateQuizzesOptions, type BulkCreateQuizzesRequest, type BulkCreateQuizzesResponse, type BulkCreateQuizzesResponseBulkQuizResult, type BulkDeleteQuizzesRequest, type BulkDeleteQuizzesResponse, type BulkDeleteQuizzesResponseBulkQuizResult, type BulkQuizResult, type CloneQuizRequest, type CloneQuizResponse, type CreateQuizRequest, type CreateQuizResponse, type DeleteQuizRequest, type DeleteQuizResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type FileUploadField, FileUploadFormat, type FileUploadFormatWithLiterals, type GetQuizRequest, type GetQuizResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type LongTextField, type MessageEnvelope, type MultiChoiceField, type NumericField, type Quiz, type QuizField, type QuizFieldFieldTypeOneOf, type QuizSettings, type RestoreInfo, type ShortTextField, type SingleChoiceField, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateQuizzes, bulkDeleteQuizzes, cloneQuiz, createQuiz, deleteQuiz, getQuiz };
|
|
688
|
+
export { type AccountInfo, type ActionEvent, type ApplicationError, type BulkActionMetadata, type BulkCloneQuizzesRequest, type BulkCloneQuizzesResponse, type BulkCreateQuizzesApplicationErrors, type BulkCreateQuizzesOptions, type BulkCreateQuizzesRequest, type BulkCreateQuizzesResponse, type BulkCreateQuizzesResponseBulkQuizResult, type BulkDeleteQuizzesRequest, type BulkDeleteQuizzesResponse, type BulkDeleteQuizzesResponseBulkQuizResult, type BulkQuizResult, type CloneQuizApplicationErrors, type CloneQuizRequest, type CloneQuizResponse, type CreateQuizApplicationErrors, type CreateQuizRequest, type CreateQuizResponse, type DeleteQuizApplicationErrors, type DeleteQuizRequest, type DeleteQuizResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type FileUploadField, FileUploadFormat, type FileUploadFormatWithLiterals, type GetQuizApplicationErrors, type GetQuizRequest, type GetQuizResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type LongTextField, type MessageEnvelope, type MultiChoiceField, type NumericField, type Quiz, type QuizField, type QuizFieldFieldTypeOneOf, type QuizSettings, type RestoreInfo, type ShortTextField, type SingleChoiceField, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateQuizzes, bulkDeleteQuizzes, cloneQuiz, createQuiz, deleteQuiz, getQuiz };
|