-
Notifications
You must be signed in to change notification settings - Fork 2
Operations
This page describes the different operations implemented, their types (if any are implemented) and the arguments they acknowledge
A basic operation consists of the summation/multiplication/subtraction or division of at least two operands. There are two different types of basic operations:
- Type 0: all operands are given and the student has to provide the right answer
- Type 1: one operand is missing but the result is visible. The student has to guess the value of the missing operand
Note that it is mandatory to provide the type of basic operation. Basic operations also acknowledge the following arguments which are mandatory:
-
operator
: one and only one among+
,-
,*
or/
-
nboperands
: number of operands in the basic operation -
nbdigitsop
: number of digits of the operands -
nbdigitsrslt
: number of digits of the result
The values of these arguments can be given either as strings, int or float numbers, but the first one which is necessarily a string.
For example:
{{.BasicOperation (dict "type" 0 "operator" "+" "nboperands" 3 "nbdigitsop" 2 "nbdigitsrslt" 3)}}
generates a sum of three numbers in the range (9, 100) whose result is in the range (99, 1000), where the student has to compute the value of the summation.
No optional parameters are honoured.
A sequence consists just of a sequence of numbers. Currently, the difference between two adjacent numbers is always equal to 1. There are four different types of sequences:
- Type 0: neither the first nor the last element of the sequence are given. Instead, an arbitrary number in between is given as a hint ---but only one, and the rest have to be filled in by the student.
- Type 1: only the first element of the sequence is given, the rest have to be filled in by the student.
- Type 2: only the last element of the sequence is given, the rest have to be filled in by the student
- Type 3: both the first and last element of the sequence are given, the rest have to be filled in by the student.
Note that it is mandatory to provide the type of sequence. Sequences also acknowledge the following arguments which are also mandatory:
-
nbitems
: number of items in the sequence -
geq
: forces all numbers in the sequence to be strictly greater or equal than this lower bound -
leq
: forces all numbers in the sequence to be strictly less or equal than this upper bound
The values of these arguments can be given either as strings, int or float numbers.
For example:
{{.Sequence (dict "type" 2 "nbitems" 5 "geq" 0 "leq" 9)}}
generates a sequence of 5 numbers, all greater or equal than 0 and lower or equal than 9, showing both the first and last number.
No optional parameters are honoured.
A division consists overall of three components: the dividend, divisor and the quotient. Currently, mathprob
generates instances with any remainder. All arguments are given below and they are mandatory:
-
nbdvdigits
: number of digits of the dividend -
nbdrdigits
: number of digits of the divisor -
nbqdigits
: number of digits of the quotient
In particular, the ability to generate instances with a different number of digits in the quotient serves to finely tune the difficulty of each problem.
For example,
{{.Division (dict "nbdvdigits" 2 "nbdrdigits" 1 "nbqdigits" 1)}}
generates an instance where the divisor has two digits, and both the divisor and the quotient have only one digit (e.g., 65 divided by 8).
No optional parameters are honoured