# Multiple Choice Quiz

**URL:** <https://forum.wixstudio.com/t/multiple-choice-quiz/36366>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [December 23, 2017, 5:21am UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366 "2017-12-23T05:21:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![croberts](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@croberts](https://forum.wixstudio.com/u/croberts)\
**Post date:** [December 23, 2017, 5:21am UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/1 "2017-12-23T05:21:11Z")

</div>

Dear All,

I am trying to create a Multiple Choice Quiz (6-7 questions) where persons select the correct answers from a choice of 4 radio buttons (for each question) and if the get a question right there is some form a count associated with the quiz at the end . I.e. 5 out of 8 is displayed when the button is clicked.

Can anyone help…

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/system/32/86885_2.png) [@system](https://forum.wixstudio.com/u/system)\
**Post date:** [December 24, 2017, 1:26pm UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/2 "2017-12-24T13:26:54Z")

</div>

Hi,  
See [here](https://www.wix.com/code/home/examples) , under ‘User Input’, some examples for forms. You’ll find everything you need there 🙂

Liran.

---

<div class="post-metadata">

**Author:** ![croberts](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@croberts](https://forum.wixstudio.com/u/croberts)\
**Post date:** [December 25, 2017, 8:28am UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/3 "2017-12-25T08:28:08Z")

</div>

Liran,

Thanks for your response but it doesn’t giv e me what I was after. I now how to create a form. I am really looking for how to do the count and display the count at the end of the quiz? That is not in the user input examples that i can find. I cant find what code to write / use for the count?

Cheers

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/system/32/86885_2.png) [@system](https://forum.wixstudio.com/u/system)\
**Post date:** [December 25, 2017, 9:44am UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/4 "2017-12-25T09:44:53Z")

</div>

How do you want to do that?  
Are the questions on the same page (or lightbox)?  
If so, you can have a global variable and update it through the quiz.

---

<div class="post-metadata">

**Author:** ![croberts](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@croberts](https://forum.wixstudio.com/u/croberts)\
**Post date:** [December 26, 2017, 5:46am UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/5 "2017-12-26T05:46:06Z")

</div>

Liran,

I would love to be able to have a single question on a Slide Show and ask 10 questions (10 slides) with the 11th Slide being the results.

If not possible on a slide then on a single page would be fine.

Is this a WixDataQueryResults??

How would i set up a global variable if that is the answer??

Regards

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/system/32/86885_2.png) [@system](https://forum.wixstudio.com/u/system)\
**Post date:** [December 26, 2017, 10:31am UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/6 "2017-12-26T10:31:43Z")

</div>

Hi,

It is possible with slideshow.  
You can use [selectSlide()](https://www.wix.com/code/reference/$w.Slideshow.html#changeSlide) to change slides.

In general, let’s say you have a submit button for answers (maybe even outside of the slideshow) called ‘submitButton’, and slideshow called ‘quiz’. And let’s say that each slide has a radio button group called ‘radioButtonOptions’. I would save a global variable and set an onClick function for the button that updates it and changes the slide. General skeleton just to get the idea:

```javascript
let scoreForQuiz = 0;
let currentSlideToShow = 0;
export function submitButton_onclick() {
    //get the user selected value. 
    //see https://www.wix.com/code/reference/$w.RadioButtonGroup.html#value
    //you can also do so by selectedIndex. 
    //see https://www.wix.com/code/reference/$w.RadioButtonGroup.html#selectedIndex
    const valueFromSlide = $w('radioButtonOptions').value;
    if (valueFromSlide === correctAnswer) {
        scoreForQuiz++; //adding 1 point to the score
    }
    currentSlideToShow++; // moving the index to the next question
    $w('#quiz').selectSlide(currentSlideToShow);
}

```

Liran.

---

<div class="post-metadata">

**Author:** ![drmasood](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@drmasood](https://forum.wixstudio.com/u/drmasood)\
**Post date:** [February 18, 2019, 9:31am UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/7 "2019-02-18T09:31:16Z")

</div>

Dear Croberts  
Were you able to find a solution, you were looking for. If yes, please let me know. I need your help.

---

<div class="post-metadata">

**Author:** ![saviosimondsouza](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/saviosimondsouza/32/4194_2.png) [@saviosimondsouza](https://forum.wixstudio.com/u/saviosimondsouza)\
**Post date:** [October 11, 2019, 4:38pm UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/8 "2019-10-11T16:38:48Z")

</div>

Hi,

I need help with something similar to CRoberts, above.

I’m devising a series of questionnaires each with 25 questions. Each question is to have 4 options (radio buttons) out of which only 1 option is to be the correct answer to the given question.

Once the user clicks the radio button, that option is to be saved, I. e., the result is not displayed immediately, and if the user gets a question right, that is counted and displayed at the end, after the quiz.

The user is to then click NEXT (another button), to be taken to the following question. Once NEXT is clicked the user does not have the option of going back to change the option earlier checked.

When all the questions are answered, list is to appear displaying the following:  
1: the question (listed in the order they appeared in the questionnaire)  
2: the option that the user clicked;  
3: the correct option irrespective of whether the user clicked the right or wrong answer;  
4: an explanation answering the question, again irrespective of whether the user click the right or wrong option;  
5: A summary stating:  
Questions answered correctly #  
Questions attempted #  
Percentage of correct answers %

I also need buttons to guide the user to the next test, or exit the app.

Would someone please guide me on where I might get readymade code for this ? I need to plug the code into a Wix site.

**I do not have any coding knowledge.**

Many thanks.

---

<div class="post-metadata">

**Author:** ![vishal](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@vishal](https://forum.wixstudio.com/u/vishal)\
**Post date:** [December 20, 2019, 6:56am UTC](https://forum.wixstudio.com/t/multiple-choice-quiz/36366/9 "2019-12-20T06:56:54Z")

</div>

Did you get any response to this query? am facing the same issue.
