Selecting sublist items

I want to make an app where people are given a multiple choice question. I made a list for the questions and then another list with sublist for answers for each question.
I wanted to make it so that when Question 1 is displayed, the 3 subitems would be displayed separately on 3 buttons.
Not sure how to select specific items withing sublsits, or if its even possible in MIT and I need to find another approach for this test.

Then use index method that would be simple one.
Initialise a global index variable with 0
On button click or screen init
Set this variable as 1
Now select the first item from the question variable with this 1.
Also with this index select item from answer variable (this will be return as three item from list) so while printing on label again use select list item list with above answer variables as 1,2&3. 1 to print on label 1, 2 to print on label2 like wise. Put all these and all in procedure.

So if you change the index from 1 to 2 by means of any method you will get exact result

@PatExMachina Check this out too:

Btw, there are a lot of quiz app examples on youtube :grin:

Although that does work, I was hoping to find something that I can incorporate into a procedure as I want the code to execute multiple times. As @Salman_Dev has mentioned, there are quiz app samples I could look up. Which I did and gave me a solution. I just did select list item twice.

Thank you for the example, but finding this video really helped me with what I was looking for. Multiple choice quiz app in MIT App Inventor (Part 2) | Trivia quiz in MIT App Inventor - YouTube

1 Like

The app I was making was a Personality Quiz like "Which friend are you from friends"
This app is unoptimized but functional as a "What kind of shape are you"
The questions are very silly and so are the results.
Shape_Trivia.aia (59.5 KB)

1 Like

Better Luck Next time, i have tried to modify the same aia with what i said procedure

I meant this method with less blocks
Shape_Trivia(1).aia (57.9 KB)



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