> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetQuiz

# Package: onlinePrograms

# Namespace: QuizService

# Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/get-quiz.md

## Permission Scopes:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Retrieves a quiz definition by ID.

A retrieved quiz can have an empty fields list after all its questions have been deleted. Check for active questions before displaying or reusing it.

To discover a quiz ID, query or retrieve its quiz-type Online Programs step and read `step.quizOptions.id`.

---

## REST API

### Schema

```
 Method: getQuiz
 Description: Retrieves a quiz definition by GUID.  A retrieved quiz can have an empty fields list after all its questions have been deleted. Check for active questions before displaying or reusing it.  To discover a quiz GUID, query or retrieve its quiz-type Online Programs step and read `step.quizOptions.id`.
 URL: https://www.wixapis.com/online-programs/v1/quizzes/{quizId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  quizId
 Method parameters: 
   param name: quizId | type:   none | required: true 
 Return type: GetQuizResponse
  - name: quiz | type: Quiz | description: Requested quiz definition.  
     - name: id | type: string | description: Quiz GUID.  | read-only: true | validation: format GUID
     - name: settings | type: QuizSettings | description: Quiz title, passing grade, and attempt limit. New submissions use the current settings; stored submissions retain their recorded grade data.  
        - name: passingGrade | type: integer | description: Minimum unweighted integer percentage required to pass. 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.  | validation: minimum 0, maximum 100, format int32
        - name: title | type: string | description: Quiz title.  | validation: maxLength 200
        - name: attempts | type: integer | description: Maximum number of submissions allowed per submitter. If omitted, no attempt-limit check is applied. Submissions grouped together share an attempt count, even across quizzes. See [Attempt limits](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/quiz-grading.md#attempt-limits) for how submissions are counted.  | validation: minimum 1, format int32
     - name: revision | type: string | description: 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.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the quiz was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the quiz was last updated.  | read-only: true | validation: format date-time
     - name: fields | type: array<QuizField> | description: Active questions in the quiz. Each `QuizField` defines one question and its answer input. Creating or cloning a quiz requires at least one active question. A retrieved quiz can have an empty list after all its questions have been deleted. Check for active questions before displaying or reusing it.  New submissions use the current questions; stored submissions retain their recorded answer evaluations.  | validation: minItems 1, maxItems 200
        - ONE-OF: 
           - name: numeric | type: NumericField | description: Numeric input.  
              - name: rightAnswer | type: number | description: 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.  Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct value is stored.  | validation: format double
           - name: shortText | type: ShortTextField | description: Short-text input.  
              - name: rightAnswer | type: string | description: 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.  Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct text is stored.  | validation: minLength 1, maxLength 200
           - name: longText | type: LongTextField | description: Long-text input. Set this to an empty object (`{}`) to select it.  
      EMPTY-OBJECT {}
           - name: singleChoice | type: SingleChoiceField | description: Input with predefined options where only one option can be selected.  
              - name: rightAnswer | type: string | description: 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.  Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct option is stored.  | validation: minLength 1, maxLength 350
              - name: options | type: array<string> | description: Options available to the participant. Labels must be unique; comparison is case-sensitive. Duplicate labels are rejected with INVALID_QUIZ before creation.  | validation: minItems 1, maxItems 90, minLength 1, maxLength 350
           - name: multiChoice | type: MultiChoiceField | description: Input with predefined options where multiple options can be selected.  
              - name: rightAnswer | type: array<string> | description: 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.  Empty in responses when the caller can't access answer keys. Hidden answers still participate in grading; an empty response list doesn't mean no correct options are stored.  | validation: minItems 0, maxItems 90, minLength 1, maxLength 350
              - name: options | type: array<string> | description: Options available to the participant.  | validation: minItems 1, maxItems 90, minLength 1, maxLength 350
           - name: fileUpload | type: FileUploadField | description: File-upload input.  
              - name: buttonText | type: string | description: Text displayed on the upload button.  Default: `Upload`.  | validation: minLength 1, maxLength 100
              - name: itemsLimit | type: integer | description: Maximum number of files a participant can upload for this question.  Default: `10`.  | validation: minimum 1, maximum 10, format int32
              - name: fileUploadFormats | type: array<FileUploadFormat> | description: Wix Forms file categories that participants can upload.  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.  | validation: maxItems 6
                     - enum:
                     -     IMAGE: Image-file category.
                     -     VIDEO: Video-file category.
                     -     AUDIO: Audio-file category.
                     -     DOCUMENT: Document-file category.
                     -     ARCHIVE: Archive-file category.
                     -     MODEL_3D: 3D-model-file category.
        - name: id | type: string | description: Caller-generated GUGUID that identifies this question. Use a stable value that is unique within the quiz. Submission answer evaluations use this GUID to identify the question.  | validation: format GUID, immutable
        - name: target | type: string | description: 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.  | validation: maxLength 200, immutable
        - name: question | type: string | description: Question text.  | validation: minLength 1, maxLength 350
        - name: score | type: number | description: 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.  | validation: format double
        - name: rightMessage | type: string | description: Feedback returned when an evaluable submitted answer is correct. Omitted for non-evaluable answers.  | validation: maxLength 350
        - name: wrongMessage | type: string | description: Feedback returned when an evaluable submitted answer is incorrect. Omitted for non-evaluable answers.  | validation: maxLength 350

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: QUIZ_NOT_FOUND | Description: Couldn't find the quiz.


```

### Examples

### Get a quiz definition
Retrieve a quiz definition by ID. Replace <AUTH> with your authorization token and the quiz ID in the URL with an ID returned by Create Quiz. Sample response adapted from a successful request; titles updated for readability.

```curl
curl -X GET \
'https://www.wixapis.com/online-programs/v1/quizzes/dd58af6e-c0f3-4bf6-90a6-d4e2f256d6d9' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.quizzes.getQuiz(quizId)
 Description: Retrieves a quiz definition by GUID.  A retrieved quiz can have an empty fields list after all its questions have been deleted. Check for active questions before displaying or reusing it.  To discover a quiz GUID, query or retrieve its quiz-type Online Programs step and read `step.quizOptions.id`.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  quizId
 Method parameters: 
   param name: quizId | type: string | description: Quiz GUID, available from `step.quizOptions.id` on a quiz-type Online Programs step. | required: true | validation: format GUID
 Return type: PROMISE<Quiz>
  - name: _id | type: string | description: Quiz GUID.  | read-only: true | validation: format GUID
  - name: settings | type: QuizSettings | description: Quiz title, passing grade, and attempt limit. New submissions use the current settings; stored submissions retain their recorded grade data.  
     - name: passingGrade | type: integer | description: Minimum unweighted integer percentage required to pass. 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.  | validation: minimum 0, maximum 100, format int32
     - name: title | type: string | description: Quiz title.  | validation: maxLength 200
     - name: attempts | type: integer | description: Maximum number of submissions allowed per submitter. If omitted, no attempt-limit check is applied. Submissions grouped together share an attempt count, even across quizzes. See [Attempt limits](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/quiz-grading.md#attempt-limits) for how submissions are counted.  | validation: minimum 1, format int32
  - name: revision | type: string | description: 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.  | read-only: true | validation: format int64
  - name: _createdDate | type: Date | description: Date and time the quiz was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the quiz was last updated.  | read-only: true 
  - name: fields | type: array<QuizField> | description: Active questions in the quiz. Each `QuizField` defines one question and its answer input. Creating or cloning a quiz requires at least one active question. A retrieved quiz can have an empty list after all its questions have been deleted. Check for active questions before displaying or reusing it.  New submissions use the current questions; stored submissions retain their recorded answer evaluations.  | validation: minItems 1, maxItems 200
     - ONE-OF: 
        - name: numeric | type: NumericField | description: Numeric input.  
           - name: rightAnswer | type: number | description: 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.  Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct value is stored.  
        - name: shortText | type: ShortTextField | description: Short-text input.  
           - name: rightAnswer | type: string | description: 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.  Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct text is stored.  | validation: minLength 1, maxLength 200
        - name: singleChoice | type: SingleChoiceField | description: Input with predefined options where only one option can be selected.  
           - name: rightAnswer | type: string | description: 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.  Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct option is stored.  | validation: minLength 1, maxLength 350
           - name: options | type: array<string> | description: Options available to the participant. Labels must be unique; comparison is case-sensitive. Duplicate labels are rejected with INVALID_QUIZ before creation.  | validation: minItems 1, maxItems 90, minLength 1, maxLength 350
        - name: multiChoice | type: MultiChoiceField | description: Input with predefined options where multiple options can be selected.  
           - name: rightAnswer | type: array<string> | description: 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.  Empty in responses when the caller can't access answer keys. Hidden answers still participate in grading; an empty response list doesn't mean no correct options are stored.  | validation: minItems 0, maxItems 90, minLength 1, maxLength 350
           - name: options | type: array<string> | description: Options available to the participant.  | validation: minItems 1, maxItems 90, minLength 1, maxLength 350
        - name: fileUpload | type: FileUploadField | description: File-upload input.  
           - name: buttonText | type: string | description: Text displayed on the upload button.  Default: `Upload`.  | validation: minLength 1, maxLength 100
           - name: itemsLimit | type: integer | description: Maximum number of files a participant can upload for this question.  Default: `10`.  | validation: minimum 1, maximum 10, format int32
           - name: fileUploadFormats | type: array<FileUploadFormat> | description: Wix Forms file categories that participants can upload.  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.  | validation: maxItems 6
                 - enum:
                 -     IMAGE: Image-file category.
                 -     VIDEO: Video-file category.
                 -     AUDIO: Audio-file category.
                 -     DOCUMENT: Document-file category.
                 -     ARCHIVE: Archive-file category.
                 -     MODEL_3D: 3D-model-file category.
     - name: _id | type: string | description: Caller-generated GUGUID that identifies this question. Use a stable value that is unique within the quiz. Submission answer evaluations use this GUID to identify the question.  | validation: format GUID, immutable
     - name: target | type: string | description: 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.  | validation: maxLength 200, immutable
     - name: question | type: string | description: Question text.  | validation: minLength 1, maxLength 350
     - name: score | type: number | description: 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.  
     - name: rightMessage | type: string | description: Feedback returned when an evaluable submitted answer is correct. Omitted for non-evaluable answers.  | validation: maxLength 350
     - name: wrongMessage | type: string | description: Feedback returned when an evaluable submitted answer is incorrect. Omitted for non-evaluable answers.  | validation: maxLength 350

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: QUIZ_NOT_FOUND | Description: Couldn't find the quiz.


```

### Examples

### Get a quiz definition
```javascript
import { quizzes } from "@wix/online-programs";

// Run in an authorized Wix context. Replace the sample ID with your quiz's _id.
// Returns the quiz directly, including its questions and settings.
const quiz = await quizzes.getQuiz("963bc415-3e38-457a-a868-0269bc73c4b7");

/* Promise resolves to:
{
  "settings": {
    "passingGrade": 70,
    "title": "Introduction to French Geography",
    "attempts": 3
  },
  "revision": "1",
  "fields": [
    {
      "target": "capitalOfFrance",
      "question": "What is the capital of France?",
      "score": 1,
      "rightMessage": "Correct.",
      "wrongMessage": "Try again.",
      "singleChoice": {
        "rightAnswer": "Paris",
        "options": [
          "Paris",
          "Lyon",
          "Marseille"
        ]
      },
      "_id": "41c8698b-45b1-47b3-bb59-e9440844e3b5"
    }
  ],
  "_id": "963bc415-3e38-457a-a868-0269bc73c4b7",
  "_createdDate": "2026-09-15T14:55:09.034Z",
  "_updatedDate": "2026-09-15T14:55:09.034Z"
}
*/

```

### getQuiz (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { quizzes } from '@wix/online-programs';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { quizzes },
  // Include the auth strategy and host as relevant
});


async function getQuiz(quizId) {
  const response = await myWixClient.quizzes.getQuiz(quizId);
};
```

---