# Set User Answers

Use `setUserAnswers` mutation to set the user's answers for a specific assessment.

### Arguments

| Argument                         | Type                | Description                                 |
| -------------------------------- | ------------------- | ------------------------------------------- |
| `input.assessmentId`             | ID!                 | Id of the assessment.                       |
| `input.userAnswers`              | \[UserAnswerInput!] | List of answers for the selected questions. |
| `input.userAnswers.questionId`   | ID!                 | Id of the question.                         |
| `input.userAnswers.answerId`     | ID                  | Id of the answer.                           |
| `input.userAnswers.answerText`   | String              | Used for open type of questions.            |
| `input.userAnswers.rankingOrder` | Int                 | Used to set answer ranking order.           |

### Available Fields

| Field Name    | Type           | Description                                                                   |
| ------------- | -------------- | ----------------------------------------------------------------------------- |
| `userAnswers` | \[UserAnswer!] | User answers list.                                                            |
| `success`     | string         | **True** if the answers have been created successfully. Otherwise, **False.** |
| `message`     | string         | Description of the result.                                                    |

### Example

{% tabs %}
{% tab title="Request" %}

```graphql
mutation {
  setUserAnswers(
    input: {
      assessmentId: "QXNzZXNzbWVudDpkM2QyMzA4Ny03MzZlLTQ4ZjctOGI0Yy0xODE0NzE4MTlkYjQ="
      userAnswers: [
        {
          questionId: "QXNzZXNzbWVudFF1ZXN0aW9uOmY3ZTEyNjk3LWFkZDktNDNkZS1iOGE3LWI2NmQ3YzNlNWQwZQ=="
          answerId: "QXNzZXNzbWVudEFuc3dlcjoyYjJlNmI0OC0wM2VkLTQwM2YtYWQzYS03ZjBkMDBhOGVjODI="
          rankingOrder:1
        },
        {
          questionId: "QXNzZXNzbWVudFF1ZXN0aW9uOmY3ZTEyNjk3LWFkZDktNDNkZS1iOGE3LWI2NmQ3YzNlNWQwZQ=="
          answerId: "QXNzZXNzbWVudEFuc3dlcjozMmRjMDg2YS03OTBlLTQ5OWMtYmNhMS03NDA5NDg0YzU0MmM="
          rankingOrder:3
        },
        {
          questionId: "QXNzZXNzbWVudFF1ZXN0aW9uOmY3ZTEyNjk3LWFkZDktNDNkZS1iOGE3LWI2NmQ3YzNlNWQwZQ=="
          answerId: "QXNzZXNzbWVudEFuc3dlcjpmNGQwZmIxOC03NmUyLTQ2MjMtODE3MS1iMzYxMDE0YjBjM2M="
          rankingOrder:2
        },
         {
          questionId: "QXNzZXNrbWVudFF1ZXN0aW9uOmY3ZTEyNjk3YWFkZDktNDNkZS1iOGE3LWI2NmQ3YzNlNWQwXx=="
          answerText: "For open type of questions"
        }
      ]
    }
  ) {
    success
    message
 }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "setUserAnswers": {
      "success": true,
      "errors": []
    }
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/assessments/set-user-answers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
