# How to create Multiple choice questions form using RASA 2.0

**URL:** <https://forum.rasa.com/t/how-to-create-multiple-choice-questions-form-using-rasa-2-0/40631>\
**Category:** Rasa Open Source\
**Created:** [February 25, 2021, 5:06pm UTC](https://forum.rasa.com/t/how-to-create-multiple-choice-questions-form-using-rasa-2-0/40631 "2021-02-25T17:06:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitgawade1989](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@amitgawade1989](https://forum.rasa.com/u/amitgawade1989)\
**Post date:** [February 25, 2021, 5:06pm UTC](https://forum.rasa.com/t/how-to-create-multiple-choice-questions-form-using-rasa-2-0/40631/1 "2021-02-25T17:06:51Z")

</div>

Hello, I am new to this forum. I want to create a Multiple choice question answer form. and after finishing the exam bot should display marks. How I should do this… Please help me in this I am in learning phase. Thank you!

---

<div class="post-metadata">

**Author:** ![m.vielkind](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m.vielkind/32/12693_2.png) [@m.vielkind](https://forum.rasa.com/u/m.vielkind)\
**Post date:** [February 26, 2021, 5:17pm UTC](https://forum.rasa.com/t/how-to-create-multiple-choice-questions-form-using-rasa-2-0/40631/2 "2021-02-26T17:17:47Z")

</div>

Hi @amitgawade1989 ! You’re right, this is a great use case for using forms in Rasa. Could you share some details about what you have so far in setting up your form?

---

<div class="post-metadata">

**Author:** ![amitgawade1989](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@amitgawade1989](https://forum.rasa.com/u/amitgawade1989)\
**Post date:** [February 26, 2021, 6:29pm UTC](https://forum.rasa.com/t/how-to-create-multiple-choice-questions-form-using-rasa-2-0/40631/3 "2021-02-26T18:29:03Z")

</div>

Thank you for replay! I want to create a form that contains DEPRESSED MOOD (sadness, hopeless, helpless, worthless) (depreesed) 0 Absent. 1 These feeling states indicated only on questioning. 2 These feeling states spontaneously reported verbally. 3 Communicates feeling states non-verbally, i.e. through facial expression, posture, voice and tendency to weep. 4 Patient reports virtually only these feeling states in his/her spontaneous verbal and non-verbal communication.

2 FEELINGS OF GUILT (Guilt) 0 Absent. 1 Self reproach, feels he/she has let people down. 2 Ideas of guilt or rumination over past errors or sinful deeds. 3 Present illness is a punishment. Delusions of guilt. 4 Hears accusatory or denunciatory voices and/or experiences threatening visual hallucinations.

3 SUICIDE (Suicide) 0 Absent. 1 Feels life is not worth living. 2 Wishes he/she were dead or any thoughts of possible death to self. 3 Ideas or gestures of suicide. 4 Attempts at suicide (any serious attempt rate 4).

4 INSOMNIA: EARLY IN THE NIGHT (Insomnia\_Early\_Night) 0 No difficulty falling asleep. 1 Complains of occasional difficulty falling asleep, i.e. more than 1⁄2 hour. 2 Complains of nightly difficulty falling asleep

5 INSOMNIA: MIDDLE OF THE NIGHT (Insomnia\_Middle\_Night) 0 No difficulty. 1 Patient complains of being restless and disturbed during the night. 2 Waking during the night – any getting out of bed rates 2 (except for purposes of voiding).

At the end I want to calculate the score as per options selected… This is my form: forms: user\_details\_form: name: - type: from\_entity entity: name gender: - type: from\_entity entity: gender age: - type: from\_entity entity: age depression: - type: from\_entity entity: depression suicide: - type: from\_entity entity: suicide guilt: - type: from\_entity entity: guilt insomnia\_middle\_night: - type: from\_entity entity: insomnia\_middle\_night insomnia\_early\_night: - type: from\_entity entity: insomnia\_early\_night

My slots: slots: name: type: text gender: type: text age: type: text suicide: type: any influence\_conversation: false depression: type: any influence\_conversation: false guilt: type: any influence\_conversation: false insomnia\_early\_night: type: any influence\_conversation: false insomnia\_middle\_night: type: any influence\_conversation: false

I am new to this. This is working but what i am doing here is capturing entity as entire option and in action.py I am extracting slots ans comparing entire option with slot value like

if tracker.get\_slot(“absent”)==“absent”: suicide\_m=0 elif tracker.get\_slot(“suicide”)==“Feels life is not worth living”: suicide\_m=1 elif tracker.get\_slot(“suicide”)==“Wishes he/she were dead or any thoughts of possible death to self”: suicide\_m=2 elif tracker.get\_slot(“suicide”)==“Ideas or gestures of suicide”: suicide\_m=3 else: suicide\_m=4 but this is not convincing me… Please help I have uploaded domain, nlu and rule.yml file.

[domain.yml](https://forum.rasa.com/uploads/short-url/eOTdFNavwddNYIYNHwtPYnvgzqN.yml) (4.4 KB) [nlu.yml](https://forum.rasa.com/uploads/short-url/wLcM5xp5kdxV7WDsn1I506rFEsy.yml) (4.8 KB) [rules.yml](https://forum.rasa.com/uploads/short-url/flRFn3tC0gWtyyy82FtaeEzZJ4q.yml) (738 Bytes)

---

<div class="post-metadata">

**Author:** ![m.vielkind](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m.vielkind/32/12693_2.png) [@m.vielkind](https://forum.rasa.com/u/m.vielkind)\
**Post date:** [February 26, 2021, 7:27pm UTC](https://forum.rasa.com/t/how-to-create-multiple-choice-questions-form-using-rasa-2-0/40631/4 "2021-02-26T19:27:08Z")

</div>

Thanks so much for this! You could use [buttons](https://rasa.com/docs/rasa/responses/#buttons) in your responses for each question. With each button you can define a payload where you can set an entity value based on the user response.

Here’s a generic example of what could look like.

```auto
  utter_ask_question_a:
    - text: "Some question text."
      buttons:
      - title: "Text for answer 1"
        payload: /inform{{"answer_a":"1"}}
      - title: "Text for answer 2"
        payload: /inform{{"answer_a":"2"}}

```

Each button has a piece of text and a payload. The payload will determine the intent to be returned, `inform` in this case, and then can set entity values, `answer_a` above. For your use case you would want to convert all of your text utterances into buttons and for each answer map the proper entity to its numeric response.

On the action server when you process the form you should have all the slots filled where you can process the user responses to determine what message to send back.

---

<div class="post-metadata">

**Author:** ![amitgawade1989](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@amitgawade1989](https://forum.rasa.com/u/amitgawade1989)\
**Post date:** [February 26, 2021, 8:11pm UTC](https://forum.rasa.com/t/how-to-create-multiple-choice-questions-form-using-rasa-2-0/40631/5 "2021-02-26T20:11:58Z")

</div>

Thanks @m.vielkind , I will try this.
