INQ241B
Mobile Apps

Activity 13

Hiding & Showing

In this activity you will extend the quiz app from the previous activity to have multiple questions.

  1. Modify the quiz app from the previous activity so that when the user gets a question correct, a new question is displayed. Create a separate function for each question to minimize the code in the main page. The app should have at least 3 questions.

    To hide one question and display another, create a global variable for the current question number. Call the function that displays each question inside of an if statement that checks what the current question number is. When the user gets a question correct increase the value of the current question number variable.

  2. When the user has answered the last question, hide the question and display a congratulatory message.

Submission

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