> For the complete documentation index, see [llms.txt](https://quml.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quml.sunbird.org/v1/samples/mcq_sample_1.md).

# mcq\_sample\_1

This sample demonstrates how QuML is used to model a simple multiple choice question (with multiple answers), configure the interactions & process the responses to produce results.

![sample mcq image](https://2501175834-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mk0O5w77ZnjFM6FJOvP%2Fsync%2F6f7a842b586cf4472d29eda1ac5ccb1f077790ea.png?generation=1632399379801074\&alt=media)

This question is a multiple choice question where the correct answer has two values - “Hydrogen” and “Oxygen”. Below is the logic for evaluating and processing the question:

* If student selects both the correct answers, the score should be 1.0
* If student selects only one of the correct answers, the score should be 0.5
* If student selects any of the wrong answers, a value of 0.5 should be removed from the total score
* If total score if 1.0, show the message “Well done!!!”&#x20;
* If total score is between 0 and 1.0 (not including 0 and 1.0, i.e. 0 < score < 1.0), show the message “Better luck next time!!!”
* If total score is less than or equal to 0, show the message “You need to work harder!!!”

**Body**

```
<!-- Question Title -->
<div class=”title”>Composition of water</div>

<!-- Question Text -->
<div class=”sub-title”>Which of the following elements are used to form water?</div>

<!-- Answer options defined using html checkbox elements -->
<div class=”vertical-options”>
<input type="checkbox" name="element" data-multi-choice-interaction data-response-variable="RESPONSE" value="Carbon"/>
         <span class=”paragraph”>Carbon</span><br>

<input type="checkbox" name="element" data-multi-choice-interaction data-response-variable="RESPONSE" value="Oxygen">
         <span class=”paragraph”>Oxygen</span><br>

<input type="checkbox" name="element" data-multi-choice-interaction data-response-variable="RESPONSE" value="Hydrogen">
         <span class=”paragraph”>Hydrogen</span><br>

<input type="checkbox" name="element" data-multi-choice-interaction data-response-variable="RESPONSE" value="Nitrogen">
         <span class=”paragraph”>Nitrogen</span><br>

</div>
```

**Response Declaration**

```
{
    “responseDeclaration”: {
            “RESPONSE”: {
                    “cardinality”: “multiple”,
                    “type”: “string”,
                    “correctResponse”: {
                            value: [“Oxygen”, “Hydrogen”]
                    },
                    “mapping”: [
                            { “key”: “Carbon”, “value”: -0.5, “caseSensitive”: false},
                            { “key”: “Oxygen”, “value”: 0.5, “caseSensitive”: false},
                            { “key”: “Hydrogen”, “value”: 0.5, “caseSensitive”: false},
                            { “key”: “Nitrogen”, “value”: -0.5, “caseSensitive”: false}
                    ]
            }
    }
}
```

**Outcome Declaration**

```
{
    “outcomeDeclaration”: {
            “SCORE”: {
                    “cardinality”: “single”,
                    “type”: “float”,
                    “defaultValue”: 0.0
            },
            “FEEDBACK”: {
                    “cardinality”: “single”,
                    “type”: “string”,
                    “range”: [“feedback_01”, “feedback_02”, “feedback_03”],
            }
    }
}
```

**Response Processing**

```
{
    “responseProcessing”: {
          “template”: “MAP_RESPONSE”,
           “mappingConfig”: [
                   {
                           “SCORE”: {“ge”: 1.0},
                           “outcomeVariables”: {“FEEDBACK”: “feedback_01”}
                   },
                   {
                           “SCORE”: {“gt”: 0, “lt”: 1},
                           “outcomeVariables”: {“FEEDBACK”: “feedback_02”}
                   },
                   {
                           “SCORE”: {“le”: 1.0},
                           “outcomeVariables”: {“FEEDBACK”: “feedback_03”}
                   }
           ]
    }
}
```

**Feedback**

```
{
    “feedback”: {
           “feedback_01”: “<h1>Well done!!!</h1>”,
           “feedback_02”: “<h1>Better luck next time!!!</h1>”
           “feedback_03”: “<h1>You need to work harder!!!</h1>”
    }
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://quml.sunbird.org/v1/samples/mcq_sample_1.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
