numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
197 stars 118 forks source link

Define min and max on ranges #1028

Closed christianp closed 10 months ago

christianp commented 10 months ago

It should be possible to recover the start and end of a range value using the min and max functions. At the moment, it tries to convert the range to a list and return the min and max of that, which is inefficient and doesn't work for continuous ranges or ranges where the end is not a multiple of the step size from the start.

Siddhant-Kashyap commented 10 months ago

can i go for it .will you please assign it to me , @christianp

christianp commented 10 months ago

@Siddhant-Kashyap thanks for offering. Please look at our guidelines on contributing to Numbas.

We need new definitions of the 'min' and 'max' JME functions in jme-builtins.js. The new function should take a single argument of type TRange. In the function body, the argument has the form [min,max,step], so you should return range[0] for min and range[1] for max.

Siddhant-Kashyap commented 10 months ago

okay working on it