Creating a Quiz
Описание | Как создать квиз - викторину из вопросов и ответов. |
---|---|
Область знаний | Информатика |
Область использования (ISTE) | Computational Thinker |
Возрастная категория | 10
|
Поясняющее видео | |
Близкие рецепту понятия | |
Среды и средства для приготовления рецепта: | Scratch |
Scratch contains the resources available for creating a question/answer system. This system can be used for one to be "quizzed", or to repetitively answer automated questions. This tutorial shows various methods on how to create a question system. For each method, the ask () and wait block is used to ask questions and input answers.
Simple Method
This method can become lengthy in scripting, repetitive, and orderly, but still accomplishes a simple question system. The script tells the sprite to ask a question, detect if it is right or wrong, and play a sound according to the outcome. This is a simple way to program a quiz game.
List Method
The next method continuously picks a random question to ask, with questions and answers added to certain lists. The list storage makes adding questions and answers quicker. Each item in the list "questions" must directly correspond to the same item in "answers". Further methods can be used to group questions and implement other functions for various purposes. For the following tutorial, assume the following:
- "questions" is the list which contains each question
- "answers" is the list which contains the corresponding answers to the questions in the list above
- "item#" is a variable used to determine the current question one can answer
Group Method
This method is much like the List Method of coding a quiz, but the Grouping Method can be used to group questions and repetitively ask the specified group of questions until a condition is reached. For example, if there are twenty questions, this method can be used to ask four of those questions in the group until they are known very well, and then the system will select a new group. For this method, assume the additional following:
- "current questions" is the list which contains the current group of questions
- "current answers" is the list which contains the current group of corresponding answers
- "correct" is the variable used to determine how many questions of a specific group have been correct
Mathematical Method
This method is used in a math quiz in a way very much like the list method, but takes use of the Operators blocks to make several possibilities without needing to list them. Take, for example, randomly generated addition questions involving addends from 1 to 20. For this method, assume these variables:
- "number1" is the first added to the question
- "number2" is the second added in the question
- "expect_answer" is the expected answer of the generated question