Closed Canx closed 6 years ago
I found the bug, it was in levels_with_algo.php (line 99):
$coef = max((float) $mform->exportValue('coefxp'), 1.001);
The problem is the "1.001" value in the max function.
Changing it for for "1.0" solves the problem, that decimal was adding an incremental error when using "1.0" as a coeficient.
Thanks for debugging this. I think I initially did this to ensure that regardless of the input in the form, it would generate sensible levels. But as the base
must be set to 1
at the very least, there doesn't seem to be any reason to use 1.001
instead of 1
, at least none that I can think of.
Will get onto fixing that. Thanks for the report.
I have fixed this. That should not break anything. Thanks!
I'm trying to create levels with linear increment of points (1000,2000,3000,...).
If I use the algorithm with parameters:
Algorithm base: 1000 Algorithm coeficient: 1
The levels generated are: 0, 1000, 2001, 3003, 4006, 5010, 6015, 7021, 8028, 9036,...
I can manually disable the levels and enter them by hand but I wanted to know why this is happening. In algo_levels_info.php there is is method:
Apparently this method works ok (I tested the code) so I'll try to figure out where comes the error from...