ุงู†ุชู‚ู„ ู„ู„ู…ุญุชูˆู‰
Robo EgyptRobo Egypt
โ˜ฐ Course contents
Robo Apps: home
0. Lab tour1
1. The start: your first app3
2. Variables2
3. Typing and maths2
4. Conditions3
5. Time2
6. Sound and speech2
7. Arranging the screen2
8. Lists2
9. Games3
10. Sensors2
11. Bluetooth with Robo Maker2
12. Your app on your phone1
13. The final project: catch the apple3

๐Ÿ› ๏ธ Project: the quiz contest

Section 8: ListsLesson 8.2 ยท โฑ 16 min
๐ŸŽฏ Project goal
Questions in a list and their answers in a second list. The player types their answer and finds out if they were right or wrong, and at the end their score appears.
The first question
The first question
The variable n is the number of the current question, and score is the points
The variable n is the number of the current question, and score is the points
  • Question number n is get # n from the questions list, and its answer is get # n from answers.
  • After every answer we add one to n, and if it becomes bigger than the number of questions the quiz is over and we hide the button.
We answered 8 โœ“, Giza โœ— and 30 โœ“: โ€œFinished! ๐ŸŽ‰ Your score 2 of 3โ€
We answered 8 โœ“, Giza โœ— and 30 โœ“: โ€œFinished! ๐ŸŽ‰ Your score 2 of 3โ€
  1. Add two questions to the two lists.
  2. Write the right answer after every mistake in a label (the code shows it in a message).

๐Ÿ“Œ Another example: a quiz with two questions

The same quiz with two shorter lists.

The design
The design
The blocks
The blocks
In the lab: the quiz is over
In the lab: the quiz is over
โœ๏ธ Practise
Make the example yourself: put the parts in โ€œ๐ŸŽจ Designโ€, then the blocks, and tap โ–ถ Run.
โœ๏ธ Practise here in the lessonor open the lab in a new page โ†—

๐ŸŽฏ Challenge yourself

Easy

One question from a list, and the answer from a second list with the same number.

๐Ÿ‘€ Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: โœ“

Medium

If they get it wrong a message with the right answer appears.

๐Ÿ‘€ Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: a message: โœ— The answer: 12

Hard

At the end it shows the score out of how many questions, and the check button is hidden.

๐Ÿ‘€ Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: Your score 1 of 2

Finished the lesson? Mark it so your progress counts.