Intervals

Students can use intervals in answers and the system will understand them as their equivalent inequality to compare it with the correct answer. Take into account the particular notation explained below to create these intervals in CalcMe.

Wiris Quizzes 4 documentation

This documentation page has been updated to the latest Wiris Quizzes version. You can find the same information for the previous versions here.

Consider the following question:

with correct answer:

To make formulas like left parenthesis 0 comma 1 right parenthesis intepreted as intervals, we need to select the corresponding checkbox in Input options > Input syntax.

Finally, as intervals are conceptually equivalent to inequalities but internally (in the Algorithm) they are different data types, we need to use the Equivalent equations validation method if we want then students to answer either intervals or inequations. Alternatively, student answers must be of the same type as the correct answer.

The intervals notation is quite particular. You can create several intervals with the syntax you can see below

Interval CalcMe word Equivalent inequality
left parenthesis a comma b right parenthesis interval_open_open(a,b) a less than x logical and x less than b
left parenthesis a comma b right square bracket interval_open_close(a,b) a less than x logical and x less or equal than b
left square bracket a comma b right parenthesis interval_close_open(a,b) a less or equal than x logical and x less than b
left square bracket a comma b right square bracket interval_close_close(a,b) a less or equal than x logical and x less or equal than b
left parenthesis a comma plus infinity right parenthesis interval_open_open(a,+∞) a less or equal than x
straight real numbers straight real numbers
left curly bracket a right curly bracket {a} x equals a
left curly bracket a comma b comma c right curly bracket {a,b,c} x equals a logical or x equals b logical or x equals c
empty set {} falseblank

Furthermore, it is also possible to do operations with intervals.

Operation Example
Union left parenthesis a comma b right parenthesis union left parenthesis c comma d right parenthesis
Intersection left parenthesis a comma b right parenthesis intersection left parenthesis c comma d right parenthesis
Difference left parenthesis c comma d right parenthesis set minus left parenthesis a comma b right parenthesis
Complementary straight real numbers set minus left parenthesis a comma b right parenthesis

The student answer can have operations, and it will be simplified and compared with the correct answer. If you want to prevent this, set Simplified in Validation options > Simplification, as usual.

If you want to make an algorithm for a question with intervals, you can not use the interval symbols directly; you must use the corresponding CalcMe word for them. See the table above. There are commands that return intervals; for instance domain_set(). Other commands return inequations; for instance domain(). You can convert the result from inequations to intervals using expression_to_set().

LIVE DEMO