A grading error in "Time of Planet Shadokus" in the demo of the platofrm.
While going through the exercises available in the demo of the platform ( https://ocaml-sf.org/learn-ocaml-public/ ), I found a grading problem in the "Time of Planet Shadokus" exercise. Assuming a link between ocaml-sf project and the demo, I would like to report this error here, even though, strictly speaking, this is not the repository of the demo. I assume this is related to a typo in the "grading rules" but cannot disregard a bug in the platform. Please find below (a) the evaluated function, (b) three wrongly evaluated examples with the logic and the expected answers, and (c) a screenshot for the third example. Please note, sometimes this function is evaluated to 10 out 10 examples, and sometimes (like in these three) is evaluated to below 10.
let next date =
if date.minute = 0
then {year = date.year; month = date.month;
day = date.day; hour = date.hour; minute = 1}
else if date.hour < 2
then {year = date.year; month = date.month;
day = date.day; hour = date.hour + 1; minute = 0}
else if date.day < 4
then {year = date.year; month = date.month;
day = date.day + 1; hour = 0; minute = 0}
else if date.month < 5
then {year = date.year; month = date.month + 1;
day = 0; hour = 0; minute = 0}
else {year = date.year + 1; month = 0; day = 0; hour = 0; minute = 0} ;;
next {year = 3; month = 2; day = 4; hour = 2; minute = 1};;
next {year = 7; month = 4; day = 4; hour = 2; minute = 1};;
next {year = 10; month = 5; day = 4; hour = 2; minute = 1};;
according to the rules: year ∈ [1, ), month ∈ [1, 5], day ∈ [1, 4], hour ∈ [0, 2], minute ∈ [0, 1]; the logic of time increments; and the one minute increment; the function must return the following results, respectively,
{year = 3; month = 3; day = 0; hour = 0; minute = 0};;
{year = 7; month = 5; day = 0; hour = 0; minute = 0};;
{year = 11; month = 0; day = 0; hour = 0; minute = 0};;

Hi @dborisog,
While going through the exercises available in the demo of the platform ( https://ocaml-sf.org/learn-ocaml-public/ ), I found a grading problem in the "Time of Planet Shadokus" exercise. Assuming a link between ocaml-sf project and the demo, I would like to report this error here, even though, strictly speaking, this is not the repository of the demo.
Thanks for your detailed report. Indeed, the demo exercises are not stored in this repo https://github.com/ocaml-sf/learn-ocaml/ − maybe @yurug would have some advice on the best place to report issues and questions on the demo(?)
I assume this is related to a typo in the "grading rules" but cannot disregard a bug in the platform. Please find below (a) the evaluated function, (b) three wrongly evaluated examples with the logic and the expected answers, and (c) a screenshot for the third example.
the expected answers you provided:
{year = 3; month = 3; day = 0; hour = 0; minute = 0};; {year = 7; month = 5; day = 0; hour = 0; minute = 0};; {year = 11; month = 0; day = 0; hour = 0; minute = 0};;
do not seem to be well-formed. Hence the output Wrong value. Indeed, they have day = 0, while the exercise question says:
A date is well-formed if its year index is >= 1, its month index is >= 1 and <= 5, its day index is >= 1 and <= 4, its hour index is >= 0 and <= 2, and its minute index is >= 0 and <= 1.
Finally:
Please note, sometimes this function is evaluated to 10 out 10 examples, and sometimes (like in these three) is evaluated to below 10.
That does not seem too surprising, because learn-ocaml's primitives provide some random tests cases generation features (which are not always used, of course, but can be used at the discretion of the author of the considered exercise-grader).
@erikmd, thank you for pointing to inaccuracy in my solution, thus fairly invalidating this report.
In general, I've been treating the exercises on demo being a partial coverage for the UAT of the main project.