> ## 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.

# Evaluation Submission

Once a user has completed the Learning Path, the system allows the `createLearningPathEvaluationSubmission` mutation to be called on their behalf.
The current API user will be set as an evaluation author.
For each user, the evaluation can be submitted only once per single Learning Path revision.

Mutation has a several required incoming arguments - `lpId` which represents the targeted Learning Path ID,
and `submission` that represents `EvaluationSubmissionInput` object:

| Property                | Type                      | Description                                                              |
| :---------------------- | :------------------------ | :----------------------------------------------------------------------- |
| `numericRatingFeedback` | `[NumericRatingFeedback]` | Optional; The input object that contains the numeric score feedback.     |
| `textFeedback`          | `[TextFeedback]`          | Optional; The input object that contains a common written text feedback. |

The feedback types mentioned above represents a format of how user able to submit the feedback and vary on data which should be sent:

**`NumericRatingFeedback` input object:**

| Property     | Type    | Description                                                                         |
| :----------- | :------ | :---------------------------------------------------------------------------------- |
| `questionId` | `ID`    | Optional; The reference to feedback question.                                       |
| `rating`     | `Float` | Required; The numeric value that represents a given rating. Should be in range 0-5. |

**`TextFeedback` input object:**

| Property     | Type     | Description                                                                                            |
| :----------- | :------- | :----------------------------------------------------------------------------------------------------- |
| `questionId` | `ID`     | Optional; The optional reference to feedback question.                                                 |
| `text`       | `String` | Required; The written feedback text. Max text length is 255 characters. All HTML tags will be trimmed. |

## Submit evaluation

The current API user evaluation can be submitted using the `createLearningPathEvaluationSubmission` mutation

The mutation accepts the following arguments:

| Argument     | Type                        | Description                                                                          | Default |
| :----------- | :-------------------------- | :----------------------------------------------------------------------------------- | :------ |
| `lpId`       | `ID`                        | Required; The ID of the Learning Path entity that is the target of the evaluation.   | —       |
| `submission` | `EvaluationSubmissionInput` | Required; Evaluation submission input object that contains a list of user feedbacks. | —       |

<CodeGroup>
  ```GraphQL GraphQL theme={null}
  mutation createLearningPathEvaluationSubmission {
    createLearningPathEvaluationSubmission(lpId: 23, submission: {
      "numericRatingFeedback": [
        {
          "rating": 5
        }
      ],
      "textFeedback": [
        {
          "text": "The coding labs were very useful. I learned more by trying it myself."
        }
      ],
    }) {
      errors
      response {
        id
      }
    }
  }
  ```

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

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

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