A math quiz is no different from a regular quiz, except for a really cool math editor for entering formulas!
See quiz elements to understand how to add a quiz. If you already know how to add a quiz, adding a math quiz is not that complicated anymore.
Go to your course ➝ your Section ➝ add a new building block ➝ Text tasks ➝ Math quiz
As you can see here you can add some formulars or math questions that users have to answer.
We recommend you to insert the final solutions of the mathematical tasks as answers, e.g. x = 3 or simply a number like 239, because adding slightly different symbols or formulas, which are usually correct, may cause format errors which the system can not recognize as correct answer.