I need help with my app_Associate random questions to specific images

I am building an app as a Quiz in which the questions are shown randomly but the questions are subject to certain images. Below I show the sequence of blocks that I have made for the selection of questions. I need help to associate the questions to the images.
Thank you for your collaboration!!







1 Like

Welcome,

Your blocks are a bit blurry and I cannot see them clearly. Right-click on the procedure, select "Download blocks as PNG", and post the image here. Thank you.

1 Like

I hope now you can see them clearly. Thank you very much for your collaboration.

...and where is the variable global ListaDeComponentes?

1 Like

Hi @Gordon_Lu

I enclose the missing variables so you can see all the blocks that I have programmed.

Thx!!

blocks (12)
blocks (11)
blocks (10)
blocks (8)
blocks (8)

1 Like

Have you changed ListaDeCompenentes over the program, e.g. added items to ListaDeCompenentes? If you haven't, the blocks here will do nothing.

1 Like

Hi @Gordon_Lu,

Currently the app works. Both questions and answers appear on assigned buttons. What I can't do is make the image associated with the corresponding question appear and the questions continue to appear randomly but with their corresponding image.

1 Like

If your image name is HELLO.png, you cannot just use HELLO. You also have to include the file format, i.e., HELLO.png.

If you are using ai2.appinventor.mit.edu, and you do not want to type the names, you can use helper blocks (found in the blocks with Screen1).

image

1 Like

Thanks @Gordon_Lu !!

I have solved that problem but no type of image is shown to me and I don't know how to associate the question to that image either. I have the images loaded in the corresponding Screen, but no image is displayed.

1 Like

If you wish post your aia here. I do not see anywhere in your code where you set images besides the global variable. When a question is choosen then you have to select from image list the corresponding image according to the index of question

1 Like

Thank you very much for your contribution @dora_paz !!!

The aia file is too heavy and won't let me upload it. The problem is that I don't know how to program the blocks so that the images associated with the questions appear. I would need to know how to program the blocks so that the random questions correspond to the images.

If you wish upload it to Google Drive and post here the link

Try to add set image.picture in both procedures

Hello,
I have managed to get the images to appear along with the questions but the problem is that the images are shown randomly as well as the questions. I don't know what programming blocks I would have to use so that the questions are displayed randomly and associated with the corresponding images, could someone help me?