5.5 Quiz App Curriculum Page
Portfolio Reflection Questions:
- Describe the significance of the global variable index. How is indexing used with lists in this app?
- The global variable index is very important because it assigns values that correspond with items in lists, so it has a position. The index feature is used with lists in order to determine which questions and pictures should be displayed (so they correspond with each other).
2. Describe how parallel lists were used in this app. Why was the parallel structure of the lists necessary?
- Parallel lists were used in this app with all three lists (AnswerList, QuestionList, and PictureList) in order to connect them through a global variable index. So, the first item in each list would correspond with each other, and so on. The parallel structure of the lists was necessary in order to get the items from each list to correspond with each other (ie. correct picture with correct question and answer).
3. Include screenshots of your code for exercises 2 and 3 from the Enhancements section.
- Screenshots attached below.
- Enhancement #2 was the changing of the response to an incorrect answer to "Sorry that is incorrect. The correct answer is..."
- Enhancement #3 was the Random Button feature for the user to get a random quiz question.
4. Include a screenshot of the code that added your extra question (exercise 4). Explain why the code for the buttons worked without any changes after the addition of the extra question.
- Screenshot attached below.
- Enhancement #4 was adding a fourth question to the quiz with its answer and picture.
- The code for the buttons worked without any changes after the addition of the extra questions because the length of list block was used which is very abstract so the code can work with any number of questions.