Check box starting ticked (selected)

Check box starting ticked (selected)

  

Hello,

I'm trying to create an app where you can take an exam or quiz. Each question with its possible answers is shown in a screen, when you hit next, you navigate away to the next question (it's the same screen but the question ID changes so the content is different). 

The answers are logged into a different table, which holds the Quiz ID, the Question ID, the Answer ID, and whether it was selected at the time of submit.

This all works well, but then I want to have the possibility to go back and forth in the questions and change your answer if you'd like. 

I'm having difficulty making it so when you go back to an already answered question, your previous choices are shown on screen; those answers which were selected before should have their checkboxes ticked. I tried setting the boolean to which those checkboxes reference to but that's just silly, it's what they're gonna store, not what they show on screen. Unlike other widgets, check boxes don't seem to have a Value field.

Is there any way to do this?

Solution

Hi Mariano,

Check boxes are true or false. If the value of the variable is true the check box will appear ticked.

Maybe you want radio buttons? Or in the questions you can have multiple answers correct?

Cheers,

José

Solution

I was attaching the check box to a Boolean source I had added to the preparation, like some guides I had seen online. 

After reading your explanation, I attached the check box's variable to the actual log variable, since at the beginning this log doesn't even exist, it comes out false and all the answers are empty. After you pick an answer and submit, then the log entry is created. When you go back to the question now it reads correctly as true, and the check box is picked. 


Thanks a lot!


By the way, would you have any idea on how would I go around dynamically making it so questions with only one correct answer show radio buttons, and those with one or more show check boxes?

Hi Mariano,

For that you will have to change the data model to allow for that (1 to many relation).

In the screens you would have to have an If condition that depending on the type of question would display a web block with the check boxes or a web block with the radio buttons. In those web blocks you would have the logic to handle multiple answers for example.

This is just an overview of a possible solution. Try it and then let us know how it went.

Cheers,

José