App Lab
In this post we have made a quiz that demonstrates our ability to
Design
Purpose
- To create a quiz and a plan that demonstrates our understanding of the content we have learned this week
- Have three questions
- Each question is a different type
- Button question (one answer)
- Input question
- check box question (multiple answers)
- Score will be kept and shown at the end
- Topic will be about AP comp sci
- The quiz will ask a question and the user will input an answer to the question
- The quiz will score you after each question and change the screen if you got the question correct
Success
Button question
- This code allows you to select a button and if the button is correct, the program keeps score and the screen changes to the next question.
- This code works by detecting if the correct button is pressed and changing the score and the screen.
Input question
- This code allows you to input your answer and if your answer is correct, the program keeps score and continues to the next screen.
- This code works when the “continue” button is pressed by getting the text from the input and if the text is the same as the answer then the score is kept and changing the screen.
Checkbox question
- This code allows you to select multiple answers at once and if all of your selections are correct, the program keeps score and continues to the final screen.
- This code works when the “continue” button is pressed, if both of the proper options are selected then the score is kept and the screen is changed.
Final screen
- This code shows your score at the end of the quiz.
- This code works when the “score button” is pressed by changing the text of the score button to the amount of points you have.
Challenges
- One silly challenge that I ran into was because I was redeclaring the variable “score” every time I changed its value, as a result, the final score kept showing up as zero.
- Another challenge I ran into was getting the text from the input box but I was able to look at the documentation on code.org to figure this out.
See my project here