top of page

Presidents Quiz - App Inventor 2 - Advanced tutorial

 

The Presidents Quiz is a trivia game about former leaders of the United States. Though this quiz is about presidents, you can use it as a template to build quizzes or study guides on any topic.

 

In the previous tutorials, you have been introduced to some fundamental programming concepts. Now, you’re

ready for something more challenging. You’ll find  that this chapter requires a conceptual leap in terms of programming skills and abstract thinking. In particular, you’ll use two list variables to store the data—in this case, the quiz questions and answers—and you’ll use an index variable to track where the user is in the quiz.

 

When you finish,  you’ll be armed with the knowledge to create quiz apps and many other apps that require list processing.

 

This tutorial assumes that you’re familiar with the basics of App Inventor: using the Component Designer to build the user interface, and using the Blocks Editor to specify event handlers and program the component behavior. If you are not familiar with these fundamentals, be sure to review the previous tutorials before continuing. You’ll design the quiz so that the user proceeds from question to question by clicking a Next button and receives feedback about the answers.

 

What You’ll Learn

 

This app, covers:

 

• Defining list variables for storing the questions and answers in lists.

 

• Sequencing through a list using an index; each time the user clicks Next, you’ll display the

next question.

 

• Using conditional (if) behaviors: performing certain operations only under specific conditions.

You’ll use an if block to handle the app’s behavior when the user reaches the end of the quiz.

 

• Switching an image to show a different picture for each quiz question.

bottom of page