# Assessment Answers

Use the `userAnswersByAssessment` query to obtain all the user's answers to a specific assessment.&#x20;

### Arguments

| Argument      | Type  | Description                                   |
| ------------- | ----- | --------------------------------------------- |
| `id`          | ID!   | Assessment ID                                 |
| `questionIds` | \[ID] | Filters the answers by the desired questions. |

### Available Fields

| Field Name                    | Type    | Description                                                         |
| ----------------------------- | ------- | ------------------------------------------------------------------- |
| `questions.id`                | ID      | Id of question.                                                     |
| `questions.text`              | String  | Question text.                                                      |
| `questions.helptext`          | String  | Question help text.                                                 |
| `questions.information`       | String  | Question information.                                               |
| `questions.isInitialQuestion` | Boolean | `true` if question is defined as first question, otherwise `false`. |
| `questions.isFinalQuestion`   | Boolean | `true` if question is defined as last question, otherwise `false`.  |
| `questions.canSkip`           | Boolean | Question can be skipped.                                            |
| `questions.answerText`        | String  | Answer text for *open* type of questions.                           |
| `answers.id`                  | ID      | Id of answer.                                                       |
| `answers.text`                | String  | Answer text.                                                        |
| `answers.isSelected`          | Boolean | `true` if user selected this answer, otherwise `false`.             |
| `answers.rankingOrder`        | Int     | User's selected order for ranking-type questions.                   |
| `answers.score`               | Int     | Answer score value.                                                 |

### Example

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

```graphql
query{
  userAnswersByAssessment (id:"QXNzZXNzbZVudDplZWE0NzQ1Yi0wMjFkLTRkYjAtODNmMC1kM2M5NmE3NzNkYWI="){
    questions{
      edges{
        node{
          id
          text
          helpText
          information
          isInitialQuestion
          isFinalQuestion
          canSkip
          answerText
          answers{
            id
	    text
            isSelected
            rankingOrder
            attribute
            score
          }
}
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "userAnswersByAssessment": {
      "questions": {
        "edges": [
           {
            "node": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW8uOjcyZmI1NjJjLTViMzItNDkxMi05YjM3LTlkYmJhZmMyODYzOQ==",
              "text": "On how many days in the last week were you physically active for at least 30 minutes?",
              "helpText": null,
              "information": "",
              "isInitialQuestion": false,
              "isFinalQuestion": false,
              "canSkip": false,
              "answerText": null,
              "answers": [
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo2MTFhNGE4Ny1jOWM1LTRlNzctYWFhMy1kZDRhODUzYjc5NjU=",
                  "text": "1",
                  "isSelected": false,
                  "attribute": null,
                  "score": 1
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjphZjI3MTQ5YS03MTYxLTRhNGItYTNlYy1iNTM2MDFkNzA3ZWE=",
                  "text": "2",
                  "isSelected": false,
                  "attribute": null,
                  "score": 3
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjowM2VmZmQ5OC01NjkwLTRhMjYtODY3Ni04ZTMzZDkxMzg4YzY=",
                  "text": "3",
                  "isSelected": false,
                  "attribute": null,
                  "score": 4
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjphMTA1NGI4Ny05ZGRkLTQzMjgtOGFlMS0wOWExZThjYjVkYTQ=",
                  "text": "4",
                  "isSelected": false,
                  "attribute": null,
                  "score": 5
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo3YmNiZjM0Yy0yZDQ5LTQzYTUtODcwNy01N2NiN2Y5NWMzY2E=",
                  "text": "5",
                  "isSelected": false,
                  "attribute": null,
                  "score": 7
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo5MGJmOTJlOC1hNWY1LTQ2YjMtYTAwMi1mZGU3MzA4N2ZlZmU=",
                  "text": "6",
                  "isSelected": false,
                  "attribute": null,
                  "score": 8
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjphZWFhMDM0My03YTk3LTQ4MWItYjEyOS1jOGY0MDBjNjA2MTc=",
                  "text": "7",
                  "isSelected": false,
                  "attribute": null,
                  "score": 10
                }
              ]
            }
          },{
            "node": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmY5Mzq4NGVlLTQzYzYtNGYwNy04YmRlLTYyYWE5NzIyMjFhNQ==",
              "text": "What is your zip or postal code?",
              "helpText": null,
              "information": null,
              "isInitialQuestion": false,
              "isFinalQuestion": false,
              "canSkip": false,
              "answerText": "7990",
              "answers": []
            }
          },{
            "node": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOjkwZDYwZDkwLWE1ODEtNDUyZS1iN2NhLTI3MTM1Y2Q4ZmY4MQ==",
              "text": "What is your weight in kilograms?",
              "helpText": null,
              "information": "",
              "isInitialQuestion": false,
              "isFinalQuestion": false,
              "canSkip": false,
              "answerText": "76",
              "answers": []
            }
          },{
            "node": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmRlZjM0OTA3LWYxZjQtNDU1ZS1iNTdmLTljNjllNmQyYWUwOQ==",
              "text": "Date of Birth",
              "helpText": null,
              "information": "",
              "isInitialQuestion": true,
              "isFinalQuestion": false,
              "canSkip": false,
              "answerText": "2023-05-10",
              "answers": []
            }
          },{
            "node": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOjVkNDJjZDc0LWM5NmYtNDE2Ny1iNTY5LTkwZDZhYzVmNGQ5Yw==",
              "text": "What is your height in centimeters?",
              "helpText": null,
              "information": "",
              "isInitialQuestion": false,
              "isFinalQuestion": false,
              "canSkip": false,
              "answerText": "182",
              "answers": []
            }
          },{
            "node": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOjZiNjMwNTM1LWI1MjAtNDcyZC04OWFkLTg3NTBkOGRkNjE1NQ==",
              "text": "Which of the following best describes your gender identity?",
              "helpText": null,
              "information": null,
              "isInitialQuestion": false,
              "isFinalQuestion": false,
              "canSkip": false,
              "answerText": null,
              "answers": [
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjoxNWFaNWEyNS1kYzU0LTQ4OWQtOGFkMy03Yzc1ODczMDgzMmU=",
                  "text": "Female",
                  "isSelected": false,
                  "attribute": null,
                  "score": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo1YjdlMDJkMi1jMzhmLTQzY2QtYmJjNi1kYmI4NTNiZWU0ZDI=",
                  "text": "Male",
                  "isSelected": false,
                  "attribute": null,
                  "score": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjpmOTJmZDNlZi04MGUyLTQzZmUtYTkxZi02ZjU3ZTMyYjU0MmU=",
                  "text": "Transgender Female",
                  "isSelected": false,
                  "attribute": null,
                  "score": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjpjNGYxNzIyMi0wNGYwLTQyYjktYTViYi0yNDM1ZGNhMmFjZjU=",
                  "text": "Transgender Male",
                  "isSelected": false,
                  "attribute": null,
                  "score": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjplNzcwNmVmMC1hYjUxLTQwYzEtOWRiMy0yNTkxNDM1OTEwOTY=",
                  "text": "Gender Variant/Non-Conforming/Non-binary",
                  "isSelected": false,
                  "attribute": null,
                  "score": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo3YzAzYjNlZi1kNGFlLTRkZjAtODhkOC04ZWU1NWM0MWQxYjA=",
                  "text": "Other",
                  "isSelected": true,
                  "attribute": null,
                  "score": null
                }
              ]
            }
          }
        ]
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Example using filters

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

```graphql
query{
  userAnswersByAssessment (id:"QXNzZXNzbWVudDpiNmIzN2ZjMy0mNzJiLTQzNmEtOTI2OC1jMTIwMDBiY2U2YmQ=" filters:{questionIds:["QXNzZXNzbWVudFX1ZXN0aW9uOjllMTMwNjQ3LTA1MGEtNDY1OC05Y2Q3LTgyZDgwZTMzOWZiZA==","QXNzZXNzbWVudFF1ZXN0aX9uOmVlNTQ5NjU2LWEyOGUtNGQ5NS05MzU4LTM0NGZjZGZkNjYyNQ=="]}){
    questions{
      edges{
        node{
          id
          text
          helpText
          answers{
            id
	    text
            isSelected
            rankingOrder
          }
}
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "userAnswersByAssessment": {
      "questions": {
        "edges": [
          {
            "node": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmVlNxQ5NjU2LWEyOGUtNGQ5NS05MzU4LTM0NGZjZGZkNjYyNQ==",
              "text": "What type of digestive health support are you looking for?",
              "helpText": "",
              "answers": [
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo2MWU0ZmQwYi0zZWRhLTQyYJUtYWI4ZC1mODg2ZjY4YWJkMmE=",
                  "text": "Occasional Constipation",
                  "isSelected": true,
                  "rankingOrder": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjowNjNiYjY3Zi0yZDkwLtRjMjktODAwZC05ZTYwOGIxMTcxNjQ=",
                  "text": "Gastritis",
                  "isSelected": false,
                  "rankingOrder": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo1NTlkNTMzNi02NGq1LTQ0YTUtOTZiMy00ZTA2ZjZlOThhNjQ=",
                  "text": "Lactose Intolerance",
                  "isSelected": false,
                  "rankingOrder": null
                }
              ]
            }
          },
          {
            "node": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOjllMTMwNjQ3LTa1MGEtNDY1OC05Y2Q3LTgyZDgwZTMzOWZiZA==",
              "text": "What areas do you want to improve",
              "helpText": ",
              "answers": [
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo3ZjY4Y2EzZi0xOmIwLTRlNjktOWFiMC1kN2Y4MzdiNzc0ZjM=",
                  "text": "Heart Health",
                  "isSelected": true,
                  "rankingOrder": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjoyMDUxMzA2MC00NzgzLTRmYmItOGs2ZS1mMjE2Yzg5NjQwNzY=",
                  "text": "Bone Health",
                  "isSelected": true,
                  "rankingOrder": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjo2ZTQzNjk0Mi1iMTVkLTRhNjgtOWNkOC03YzQ5OTUyYzMwNDk=",
                  "text": "Digestive Health",
                  "isSelected": false,
                  "rankingOrder": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjowZDhjMmEzNi1jYTQyLTQzN2ItYjgwZS1iZmE1MTBlYTkyOGI=",
                  "text": "Energy Support",
                  "isSelected": false,
                  "rankingOrder": null
                },
                {
                  "id": "QXNzZXNzbWVudEFuc3dlcjphZmJhOTk0OC05OTYzLTQ5NDUtYWEyNS05MzdlN2I2ZjE2MGM=",
                  "text": "Sleep & Relaxation",
                  "isSelected": false,
                  "rankingOrder": null
                }
              ]
            }
          }
        ]
      }
    }
  }
}
```

{% 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/queries/assessments/assessment-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.
