I have a multiple choice application whose question material is stored in Google Spreadshet.
This quiz runs randomly.
I made the image component is subject of the question. So in the application the question is like: What picture is it?
The “red dot” is, I want to add sound button as the question material too in the app. So the question material in the application has images and sounds. I save sound and image files in G.Spreadsheet in URLs form.
The question is how to make sure that when the question is an image, the image component is displayed and the sound button are hidden. And when the question is a sound, then the sound button is displayed and the image component is hidden.
I don’t see any if/else blocks in your code to do what you are asking but it would look something like this:
If question is about an image
show image
hide sound button
else
hide image
show sound button
How do you determine if you’re going to ask the user a question about an image or a sound? Is it just a random row number and the skripsi column has a url for an image OR a sound? If so, then you need to do one of the following:
Add a column with a key indicator. Something like “image” or “sound” for each row. That way, you can check the value of that column for the current question and use my if/else algorithm above.
Determine if the url is for an image or a sound (perhaps, does it contain “.png” for example). Then use my if/else algorithm above.
I think you’ll find that #1 is easier and more consistent.