> 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

# CloneQuiz

# Package: onlinePrograms

# Namespace: QuizService

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

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

## Introduction

Clones a quiz definition and returns a new quiz ID.

A quiz with no active questions can't be cloned; the request fails with INVALID_QUIZ. Avoid modifying the source quiz while cloning it.

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.

---

## REST API

### Schema

```
 Method: cloneQuiz
 Description: Clones a quiz definition and returns a new quiz GUID.  A quiz with no active questions can't be cloned; the request fails with INVALID_QUIZ. Avoid modifying the source quiz while cloning it.  This operation copies the question and settings definition only. It doesn't copy Online Programs step associations or quiz submissions. Attach the returned GUID to a step separately when needed.
 URL: https://www.wixapis.com/online-programs/v1/quizzes/{quizId}/clone
 Method: POST
 Return type: CloneQuizResponse
  - name: quiz | type: Quiz | description: Cloned quiz definition with a new GUID. Step associations and submissions aren't cloned.  
     - 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: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_QUIZ | Description: The source quiz definition has no active questions.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: QUIZ_NOT_FOUND | Description: Couldn't find the source quiz.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: QUIZ_CONFLICT | Description: Couldn't clone the quiz because of a conflict. This doesn't necessarily mean a copy already exists. If the conflict persists, contact support with the source quiz GUID and request GUID.


```

### Examples

### Clone a quiz definition
Copy an existing quiz definition to a new quiz. Replace <AUTH> with your authorization token and the quiz ID in the URL with the ID of the quiz to copy. Save the returned ID to access the new quiz. Sample response adapted from a successful request; titles updated for readability.

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/v1/quizzes/dd58af6e-c0f3-4bf6-90a6-d4e2f256d6d9/clone' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.quizzes.cloneQuiz(quizId)
 Description: Clones a quiz definition and returns a new quiz GUID.  A quiz with no active questions can't be cloned; the request fails with INVALID_QUIZ. Avoid modifying the source quiz while cloning it.  This operation copies the question and settings definition only. It doesn't copy Online Programs step associations or quiz submissions. Attach the returned GUID to a step separately when needed.
 # 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 clone. | required: true | validation: format GUID
 Return type: PROMISE<CloneQuizResponse>
  - name: quiz | type: Quiz | description: Cloned quiz definition with a new GUID. Step associations and submissions aren't cloned.  
     - 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: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_QUIZ | Description: The source quiz definition has no active questions.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: QUIZ_NOT_FOUND | Description: Couldn't find the source quiz.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: QUIZ_CONFLICT | Description: Couldn't clone the quiz because of a conflict. This doesn't necessarily mean a copy already exists. If the conflict persists, contact support with the source quiz GUID and request GUID.


```

### Examples

### Clone 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 copy.
// The new quiz is in cloneQuizResponse.quiz. Save its _id for subsequent calls.
const cloneQuizResponse = await quizzes.cloneQuiz("963bc415-3e38-457a-a868-0269bc73c4b7");

/* 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"
  }
}
*/

```

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

---