Planning

Before creating this quiz, my partner and I took a general look at how the App Lab worked, trying out some ideas we could implement in our quiz. We came up with a button function(named "but" in my quiz code), which takes two inputs, name and screen. The function takes the user to the specified screen when the button with the specified name is clicked. This is an important function because there are many times when a button leads to a different screen in our quizzes.

Program Purpose and Function

The purpose of this App Lab is to demonstrate different aspects of JavaScript. The function of this App Lab is to create and score a quiz app that has three questions.

Data Abstraction

An example of Data Abstraction in this quiz is the "colors" list. It stores multiple values that represent different colors. A random number function takes a random color from the list and sets the background as that color.

Managing Complexity

An example of complexity management in this quiz is the overall organization. The quiz is split into three parts: start, questions, and finish. This can easily be seen in the first part of the code, as each has its own defined function. Later on, each of the functions are called, making the code visually easier to understand.

Procedural Abstraction

One procedure in the quiz is the if statement in the "finish" function. It states that if the number of correct answers is greater than the number of questions in the quiz, then the user will be notified that they cheated.

Algorithm Implementation

An algorithm implementaion in the quiz is the for loop in the "start" function. It goes through a list of all of the screens in the quiz and changes the background color for each one.

Testing

One way that the quiz can be tested is answering all three questions right one time, and answering only two correct another time. On the first trial, the quiz should show a score of 100 percent. On the second trial, the quiz should show a score of 67 percent.