> 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

# DeleteQuiz

# Package: onlinePrograms

# Namespace: QuizService

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

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

## Introduction

Permanently deletes a quiz definition.

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.

To delete multiple quiz definitions in a single API call, call [Bulk Delete Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-delete-quizzes.md).

---

## REST API

### Schema

```
 Method: deleteQuiz
 Description: Permanently deletes a quiz definition.  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.  To delete multiple quiz definitions in a single API call, call [Bulk Delete Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-delete-quizzes.md).
 URL: https://www.wixapis.com/online-programs/v1/quizzes/{quizId}
 Method: DELETE
 # 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: DeleteQuizResponse
  - name: quiz | type: Quiz | description: Permanently deleted 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.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: QUIZ_CONFLICT | Description: Couldn't delete the quiz because of a conflict. This doesn't indicate that a program step references the quiz. If the conflict persists, contact support with the quiz GUID and request GUID.


```

### Examples

### Permanently delete a quiz definition
Permanently delete a quiz definition. Remove references to the quiz from program steps before deleting it. Replace <AUTH> with your authorization token and the quiz ID in the URL with the ID of the quiz you intend to delete. Sample response adapted from a successful request; titles updated for readability.

```curl
curl -X DELETE \
'https://www.wixapis.com/online-programs/v1/quizzes/2e4dfbfd-e886-4be2-a986-feed792f1fec' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.quizzes.deleteQuiz(quizId)
 Description: Permanently deletes a quiz definition.  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.  To delete multiple quiz definitions in a single API call, call [Bulk Delete Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-delete-quizzes.md).
 # 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: GUID of the quiz definition to permanently delete. | required: true | validation: format GUID
 Return type: PROMISE<DeleteQuizResponse>
  - name: quiz | type: Quiz | description: Permanently deleted 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: 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.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: QUIZ_CONFLICT | Description: Couldn't delete the quiz because of a conflict. This doesn't indicate that a program step references the quiz. If the conflict persists, contact support with the quiz GUID and request GUID.


```

### Examples

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

// Run in an authorized Wix context. Replace the sample ID with the quiz's _id to delete.
// Deletion is permanent. Remove references to the quiz from program steps first.
// The deleted quiz is in deleteQuizResponse.quiz.
const deleteQuizResponse = await quizzes.deleteQuiz("fd87a186-7a67-40e6-8859-a8b9c37f5f1d");

/* Promise resolves to:
{
  "quiz": {
    "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": "fd87a186-7a67-40e6-8859-a8b9c37f5f1d",
    "_createdDate": "2026-09-15T14:55:53.675Z",
    "_updatedDate": "2026-09-15T14:55:53.675Z"
  }
}
*/

```

### deleteQuiz (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 deleteQuiz(quizId) {
  const response = await myWixClient.quizzes.deleteQuiz(quizId);
};
```

---