Star Student Builder logoStar Student BuilderA Learnerโ€™s Guide
โ† Real Games Std 6โ€“8Project 2 of 4

A Quiz That Keeps Score

๐ŸŽฏ The program asks questions from a list, checks the answers, and gives a mark at the end.

๐Ÿ’ก The idea behind it

Lists hold many values, so the questions live in data rather than in the code โ€” which means adding a question does not mean rewriting anything.

๐Ÿงฑ Blocks you will need

ask and waitansweradd to listitem of listlength of listif โ€ฆ then โ€ฆ elserepeat

๐Ÿ”จ Build it

  1. Make two lists: questions and answers. Put the first question in item 1 of each.
  2. Make a variable n, set to 1, and a variable score, set to 0.
  3. repeat (length of questions): ask (item n of questions) and wait.
  4. if (answer) = (item n of answers) โ†’ change score by 1 โ†’ say 'Correct!' else โ†’ say (join 'The answer was ' (item n of answers)).
  5. change n by 1, and after the loop, say the final score.

๐Ÿš€ Make it harder

  • Shuffle the questions so the order differs each time.
  • Save high scores in a third list and show the best three.

๐Ÿž Bugs you will hit

  • It always says wrong: Scratch compares text exactly, so spaces and spelling matter. Trim your list entries.
  • It asks the same question forever: you forgot 'change n by 1' inside the loop.

โฌ‡ Need Scratch itself?

Free from MIT, in a browser or as an offline app that needs no connection at all.

Get it โ†’
Ask GuruAcharya Samayeshwar