INQ241B
Mobile Apps

Activity 13

Global Variables

In this activity you will create a quiz app.

  1. Create a new app that displays a quiz question and three buttons for answers. The question should be centered in the window, with the buttons below the question text.

    Each button will be a box with the answer text posted to the wall, an on tapped handler, and a border. To center the question and the button, put them all in a box that is centered in the window.

  2. When the user taps a button, inform the user if they got the answer correct or incorrect by changing the color of the button to green or red.

    To change the color of a button, use a global variable for the color of each button. When the incorrect answer is clicked, change the color of the corresponding variable to red. When the correct answer is clicked, change the color of the corresponding variable to green.

Submission

Please show your source code and run your scripts for the instructor or lab assistant.