> For the complete documentation index, see [llms.txt](https://everyday-digital.gitbook.io/falkor-dev-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://everyday-digital.gitbook.io/falkor-dev-docs/stories/question-analysis.md).

# Question Analysis

The `logs/story-question-analysis` endpoint retrieves logs of all questions for a story.

## &#x20;Parameters

All parameters are optional and if none are provided all stories, users and groups will be called.

|            |                                      |
| ---------- | ------------------------------------ |
| **Key**    | **Type**                             |
| **app**    | String (ID or name of app)           |
| **story**  | String (ID or name of story)         |
| **groups** | Array String (name of group)         |
| **users**  | Array String (name or email of user) |

## Example

The example below fetches questions and answers for stories listed in the `stories` parameter.

```
curl -X POST \
  v1/logs/story-question-analysis \
  -H 'Authorization: Basic <Your Base64 Encoded Token>' \
  -d '{
    "story" : "Story A"
  }'
```

## Success Response

A successful response will return an array of `story` + `questions` items.

```
{
    "status": "success",
    "data": [
        {
            "story": {
                "ID": "EV72-RQZY-80AH",
                "name": "Story A",
                "type": "story",
                "app": {
                    "ID": "io.falkor.demo",
                    "name": "Falkor",
                    "version": "2.5.0"
                }
            },
            "questions": [
                {
                    "question": "Question 1: What is the color of the sky in the daytime?",
                    "type": "Multiple Choice",
                    "possibleAnswers": [
                        "Green",
                        "Blue",
                        "Purple",
                        "Black"
                    ],
                    "stats": {
                        "total": 2,
                        "correct": 1,
                        "incorrect": 1
                    },
                    "answers": [
                        {
                            "firstname": "User",
                            "lastname": "One",
                            "email": "user.one@example.com",
                            "groups": [
                                "Group A",
                                "Group B"
                            ],
                            "answer": {
                                "attempts": 1,
                                "response": "Blue",
                                "correct": true
                            }
                        },
                        {
                            "firstname": "User",
                            "lastname": "Two",
                            "email": "user.two@example.com",
                            "groups": [],
                            "answer": {
                                "attempts": 1,
                                "response": "Purple",
                                "correct": false
                            }
                        },
                        ...etc
                    ]
                },
                ...etc
            ]
        },
        ...etc
    ],
    "hash": "910f67a3a96dc84bb80c8035be4e0fce",
    "response_time": 0.1512671947479248
}
```

### Story + Questions Item

|                |                                        |
| -------------- | -------------------------------------- |
| **Key**        | **Type**                               |
| **story**      | Object                                 |
| **story.ID**   | String (ID of story)                   |
| **story.name** | String                                 |
| **story.type** | String                                 |
| **story.app**  | Object (App the story is published to) |
| **questions**  | Array of Question Items                |

### Question Item

|                     |                                            |
| ------------------- | ------------------------------------------ |
| **Key**             | Type                                       |
| **question**        | String (The question that was asked)       |
| **type**            | String (Type of question)                  |
| **possibleAnswers** | Array String (What answers were possible)  |
| **stats**           | Object                                     |
| **stats.total**     | Int (Total users who have answered)        |
| **stats.correct**   | Int (Total user who answered correctly)    |
| **stats.incorrect** | Int (Total users who answered incorrectly) |
| **answers**         | Array of answer items                      |
|                     |                                            |

### Answer Item

|                     |                                   |
| ------------------- | --------------------------------- |
| **Key**             | **Type**                          |
| **firstname**       | String                            |
| **lastname**        | String                            |
| **email**           | String                            |
| **telephone**       | String                            |
| **country**         | String                            |
| **city**            | String                            |
| **groups**          | Array String (groups assigned)    |
| **answer**          | Object                            |
| **answer.attempts** | Int (number of attempts)          |
| **answer.correct**  | Bool (if the answers was correct) |
| **answer.response** | String (the selected answer)      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://everyday-digital.gitbook.io/falkor-dev-docs/stories/question-analysis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
