To take the quizzes, you must log in.

*Username:***student***Password:***Formulas.1**You can view this site in

the language of your choice.

- More examples
### More examples

# More examples

Examples are presented below, several in response to discussions in the Moodle forum, which show some of the possibilities of the formulas question.

## Addition and subtraction with positive answer

Moodle forum discussion: 2020-03-20.

### Example

This is a simple question including addition and subtraction of integers with the answer always a positive number.

General Question name! Addition and subtraction with positive answer Variables Random variables a={5:95}; b={5:95}; d={5:95}; e={5:95}; rand={0.1:0.9:0.01}; Global variables sumPos=a+b+d+e; sumNeg=rand*sumPos; c=floor(rand*sumNeg); f=floor(sumNeg-c); answer=a+b-c+d+e-f; Main question Question text! What is {a} + {b} - {c} + {d} + {e} - {f}? Part 1 Part's mark* 1 Answer type Number Answer* answer Part's text {_0}

The Formulas question should look like this:

## Simple calculation in words

Moodle forum discussion: 2019-10-18.

### Example

In this example, we ask to compute where , and are integers. The numbers in the question are displayed in words and the answer must also be given in words. For example, the question is: "What is two thirds of twenty-one?", not "What is ?", and the answer must be given as "seven", not "".

The values , and are selected randomly in the following ranges:

The condition is also imposed.

The answer can be forced to be an integer by letting:

where is also an integer, with range varying from to according to the value of .

## Small values

Moodle forum discussion: 2019-11-08.

### Example

## Very small range values

## Parts on the same line

## Learn how to add