> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Restart a module

A quiz module can be restarted if it was completed by the current API user with the "failed" status
(the earned score is less than the required one) and if the number of possible attempts is not reached yet.

To restart a module, `restartContentAttempt` mutation should be executed.
All necessary parameters will be returned in `RESTART_EDGE` CTA data when execute `getLearningPath` query:

<CodeGroup>
  ```GraphQL GraphQL theme={null}
  query getLearningPath {
    getLearningPath(lpId: 40) {
      navigation {
        edgeId
        edgeRid
        contentType
        sequence
        attempt {
          metrics {
            status
          }
        }
        cta {
          title
          actionId
          arguments {
            key
            value
          }
        }
      }
    }
  }
  ```

  ```Query Query result [expandable] theme={null}
  {
    "data": {
      "getLearningPath": {
        "navigation": [
          {
            "edgeId": "119",
            "edgeRid": "485",
            "contentType": "MODULE",
            "sequence": "CURRENT",
            "attempt": {
              "metrics": {
                "status": "FAILED"
              }
            },
            "cta": [
              {
                "title": "Review",
                "actionId": "REVIEW_EDGE",
                "arguments": [
                  {
                    "key": "lpId",
                    "value": "40"
                  },
                  {
                    "key": "lpAttemptContextId",
                    "value": "2396"
                  },
                  {
                    "key": "edgeRid",
                    "value": "486"
                  }
                ]
              },
              {
                "title": "Restart",
                "actionId": "RESTART_EDGE",
                "arguments": [
                  {
                    "key": "lpAttemptContextId",
                    "value": "2396"
                  },
                  {
                    "key": "edgeRid",
                    "value": "485"
                  }
                ]
              }
            ]
          },
        ],
      }
    }
  }
  ```
</CodeGroup>

## `restartContentAttempt` mutation

| Argument             | Type | Description                                              |
| :------------------- | :--- | :------------------------------------------------------- |
| `edgeRid`            | `ID` | Required; contains the module edge ID.                   |
| `lpAttemptContextId` | `ID` | Required; contains the corresponding attempt context ID. |

As a result, the mutation returns a `RestartContentAttemptResponse` object:

| Property   | Type          | Description                                                                                |
| :--------- | :------------ | :----------------------------------------------------------------------------------------- |
| `errors`   | `[Violation]` | Contains the list of validation errors, if there are any.                                  |
| `response` | `Attempt`     | The created [attempt object](/OpignoEnterpriseAPI/LearningPathResults#attempt-api-object). |

Here is an example of the mutation execution:

<CodeGroup>
  ```GraphQL GraphQL theme={null}
    mutation restartContentAttempt {
      restartContentAttempt(edgeRid: 485, lpAttemptContextId: 2396) {
        errors
        response {
          id
        }
      }
    }
  ```

  ```Query Query result [expandable] theme={null}
  {
    "data": {
      "errors": [],
      "response": {
        "id": 1509
      },
    }
  }
  ```
</CodeGroup>
