# Math Quiz : Simple Equation

5
• 11 favourites

### Attached Files

The following files have been attached to this tutorial:

.capx

### Stats

5,581 visits, 12,963 views

### Translations

This tutorial hasn't been translated.

## CREATING THE QUESTION

5.) Add new event sheet and name it "Create". We'll use it to place our "Create()" function event.

6.) Add global variable "OPERATION" (text). Then, randomize it to give variety to the game. To do it, use "choose()" expression.

7.) Add sub event, and compare OPERATION variable's value.

Add two more variable NUMBER1 and NUMBER2 and randomize their value.

8.) Do the calculation based on OPERATION. Then, add one more number variable and name it "RESULT" to store the result.

8.) For divide question, make sure that NUMBER1 can be divided by NUMBER2 . randomize NUMBER2's value first, then set NUMBER1's value to NUMBER2*floor(floor(random(minimum_value,maximum_value)))

9.) Create text object "txt_Question" to display the question. Set the value to NUMBER1&" "&OPERATION&" "&NUMBER2&" = ?".

10.) Create another text object "txt_Choice" to display the answers. Copy and paste it, so you have three txt_Choices

11.) Randomize the answers with for each. But, pick one random txt_Choice to display the correct answer.