Math QUIZ

Math problem from quiz. What is 1.6 times 2? With answer input field and submit button

Using this Block

As you might guess this is a quiz where the answer is a number. Problems with both integer and decimal answers can be used. Answers that are fractions are not supported, however, questions such as “What is the denominator of 1/3 divided by 1/2 ?” or “What is 1/3 of 3?” are allowable, because the answer is an integer. For questions where the answer is a single word of text, use the quiz block.

The player receives a message whether this is the correct or incorrect category. The correct/ incorrect score box on the bottom right of the page has the number of correct or incorrect increased.

Making it Your Own

Like every block, the quiz block has an HTML file and config file in the folder.

  • An HTML file: math_quiz.html . You should not need to change anything here.
  • Another config file: math_quiz_config.js – Use this file for quizzes with fill-in-the blank questions.

Page options

const options = {
quiz_type: "number", // choices should be "number". For text, see the Quiz block
randomize_questions: true,
numberOfQuestionsToAsk: 5, // optional; if missing, all questions will be asked
instructions: "You will be asked a series of multiplication questions. You will get a point for every correct answer.",
completionURL: "../next_block/next_block.html",
};

quiz_type: In math_quiz_config.js the quiz_type is set to “number” and answers to questions will be a single number, either an integer or decimal. See below under “questions_and_answers” for more detail.

instructions: These are the instructions shown on the page before the quiz begins. This can be either html or just plain text. (See the example in the first image above.)

numberOfQuestionsToAsk: How many questions should be answered before going on to the next block.

randomize_questions – by default, this is set to true, so questions will be randomly selected from the questions you provide below. If you change it to false, the first question you list below will always be shown first, the second question will be shown second, and so on. NOTE: If your numberOfQuestionsToAsk is less than the total number of questions you provided and you set randomize_questions to false, the later questions in the array will never get asked.

completionURL – you’ll see this in every block. It is the URL where you want to go on the completion of this assessment.

Questions and Answers



const questions_and_answers = [
    {
        question: "What is 1.6 times 2?",
        answer: 3.2
    },
    {
        question: "What is 9 times 8?",
        answer: 72
    },

    {
        question: "What is 4 times 5?",
        answer: 20
    },

    {
        question: "What is 6 times 7?",
        answer: 42
    },

    {
        question: "What is 3 times 9?",
        answer: 27
    },

    {
        question: "What is 4 times 8?",
        answer: 32
    },

    {
        question: "What is 7 times 7?",
        answer: 49
    },

];

This is pretty straightforward. It’s an array of objects. Between each set of curly braces {}

  • Give a question, in quotes, after question:
  • Give the answer to the question, NOT in quotes, after answer:

Don’t forget the comma between the question and answer properties, and between each object.

The config file should end with:

export {options, questions_and_answers};

Similar Posts

  • Caves and Trees: Math

    This is a combination game and assessment block. You might also consider it practice or instruction. All the things! The player rolls a die to advance through the game. Caves send the player back, trees can be climbed to the next row. If a player lands on one type of square, they must answer a problem to advance. A second type of square asks a harder problem but the player advances twice as far.

  • Moving Targets Block

    This is a game block where players click on an item that is moving across the screen. This game can be used in two ways: “Good” targets that the player wants to hit and “bad” targets that they should not hit OR there can be just one type of “target”, the “good” target that the player hits or collects.

  • Drag and Drop

    This block, in the drag_and_drop folder, has two areas. The top area consists of two images. The bottom area shows four items, which may be images or text. The object is to drag and drop all of the items to the correct area before time runs out.

  • Splash Block

    Every game needs to start with a splash screen. The only requirements for the Blocks user (you!) to provide are your game title, an image for the splash screen and the link for the start of your game. Your splash screen will have an image, the title of your game and a play button. When the player clicks on the play button, they’re taken to the beginning of your game. Optionally, a sound can play as the splash screen fades out and the first screen fades in.

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *