Code
This code is just consistent of the variables. Index is set to one and determines which part of the list is in use dependent on its value, this helps make the lists cooperate with one another. The last two variables are answers and answer choices. When the index is one the answer choices are Truman, Roosevelt and Lincoln, but the only correct answer is Roosevelt. |
The first block sets the question, image and spinner elements whenever the app is started up. The second block is triggered whenever an answer is selected from the spinner elements. The spinner elements are the answer choices, but when the chosen answer is equal to the item on the same index of the answer list, it will be correct. The last block is when the next button is clicked; the index is increased by one, unless it is greater than the length of the question list, if that is the case it is set to 1, and the image, question and correct label are reset.
|
presidentsquizlistsoflists.aia | |
File Size: | 496 kb |
File Type: | aia |
presidentsquizlistsoflists.apk | |
File Size: | 2138 kb |
File Type: | apk |