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

# Learning Path evaluation

### **What is a Learning Path evaluation?**

The **Learning Path Evaluation** is the gateway to submit a user feedback regarding Learning Path user experience.

The feedback can be given directly to the Learning Path, within an optional referencing to dedicated questions set, provided by platform administrator.

### **Structure**

From a technical perspective, an Evaluation Submission has a plain structure:

```
EvaluationSubmission
   └── SubmissionFeedback 1
   └── SubmissionFeedback 2
   └── SubmissionFeedback 3
```

Where each submission feedback might vary by its type:

* **NumericRatingSubmissionFeedback** is designed to provide a numeric rating feedback.
* **TextSubmissionFeedback** is a common written text feedback.

### `EvaluationSubmission` API object

A user evaluation submission is represented by the `EvaluationSubmission` object:

| Property    | Type                                      | Description                                                                          |
| :---------- | :---------------------------------------- | :----------------------------------------------------------------------------------- |
| `id`        | `ID`                                      | Required; Contains the unique identified of the LP evaluation submission.            |
| `lpId`      | `String`                                  | Required; The ID of the Learning Path entity that is the target of the evaluation.   |
| `feedbacks` | `[EvaluationSubmissionFeedbackInterface]` | Required; Represents a list of feedback provided within the scope of the evaluation. |

<Note>
  In scope of particular submission it's possible to provide multiple feedback types, which might vary by its format.
</Note>

### `NumericRatingSubmissionFeedback` API object

One of the available user feedback types is `NumericRatingSubmissionFeedback`,
which implements the `EvaluationSubmissionFeedbackInterface` and is used to submit numeric rating data as feedback:

| Property     | Type    | Description                                                                        |
| :----------- | :------ | :--------------------------------------------------------------------------------- |
| `id`         | `ID`    | Required; Contains the unique identified of the LP evaluation submission feedback. |
| `questionId` | `ID`    | Optional; The reference to feedback question.                                      |
| `rating`     | `Float` | Required; The numeric value that represents a given rating.                        |

### `TextSubmissionFeedback` API object

Another user feedback type is a `TextSubmissionFeedback`,
witch implements a `EvaluationSubmissionFeedbackInterface` interface and used to submit a written text as user feedback:

| Property     | Type     | Description                                                                        |
| :----------- | :------- | :--------------------------------------------------------------------------------- |
| `id`         | `ID`     | Required; Contains the unique identified of the LP evaluation submission feedback. |
| `questionId` | `ID`     | Optional; The reference to feedback question.                                      |
| `text`       | `String` | Required; The written feedback provided for an evaluation question.                |

### Get Evaluation Submission

The list of evaluations already submitted by the current API user can be retrieved using the `getLearningPathEvaluationSubmission` query,
which returns a list of `EvaluationSubmission` objects.

The query 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.    | —       |
| `lastOnly` | `Boolean` | Optional; Indicates whether only the latest evaluation submission should be included. | true    |

<CodeGroup>
  ```GraphQL GraphQL theme={null}
  query getLearningPathEvaluationSubmission {
    getLearningPathEvaluationSubmission(lpId: 23, lastOnly: true) {
      id
      feedbacks {
        questionId
        __typename
        ... on NumericRatingSubmissionFeedback {
          rating
        }
        ... on TextSubmissionFeedback {
          text
        }
      }
    }
  }
  ```

  ```Query Query result theme={null}
  {
    "data": {
      "getLearningPathEvaluationSubmission": [
        {
          "id": 7,
          "feedbacks": [
            {
              "id": 11,
              "text": "Yeah, doing the exercises made the ideas stick a lot more",
              "__typename": "TextSubmissionFeedback"
            },
            {
              "id": 11,
              "rating": 5,
              "__typename": "NumericRatingSubmissionFeedback"
            }
          ]
        }
      ]
    }
  }
  ```
</CodeGroup>
