Problem with quiz app

Hi everyone! I am making a quiz app in which I have a problem. When I press a checkbox all the other checkboxes should be unchecked. But it s not working. I have attached the aia file and the blocks image
Quiz_base.aia

Please tell if I am typing anything wrong here in the topic, I am very new to this community

Hi @Tavish Welcome to our community :partying_face:.
I think you should shorten your code with Any Component, see the tutorial below to find out about (AnyComponent) :
http://ai2.appinventor.mit.edu/reference/other/any-component-blocks.html

The Checkbox OnChanged event is rather sensitive.
Here are some possibilities to watch out for ...

  • It is triggered by both checking and unchecking by a user
  • It is triggered by both checking and unchecking by a block

That could cause cascades of side effects.

That's why I like List Pickers and List Views for this type of app.

I know that that's why I made the variable state

Describe in detail what should happen and in what order:

  1. do this (click, un/check, ...) → result?
  2. do that (click, un/check, ...) → result?
  3. ...

and show examples (screenshots) of what the result is and how it should be.

I think you'd better use buttons or listview instead of cehckbox

It should be like if one is checked then all other should be unchecked. Just like in google forms

I have tried to make what you say but it can't work, it checked together. :yawning_face:
btw, why don't you use Listview or Button?

I believe this is what you are after ?

image

Selecting any checkbox will tick it and clear the other checkboxes, selecting a ticked checkbox will clear it, and leave other checkboxes clear also.

wow tht is cool idea thank you @TIMAI2 :star_struck:

The group of check boxes with this action is commonly called a radio button,
after antique car radios with mechanically linked push buttons for choosing radio stations.

Thanks it really worked!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.