learn-ocaml
learn-ocaml copied to clipboard
Default grading timeout is too low
With most exercises that I have written, the following message appears during grading:
La notation prend longtemps, abandonner?
The trouble is, the message often seems to appear before grading even begins; it appears while stuff is still being loaded. Grading offline is pretty fast (learn-ocaml grade runs in 0.5s to 1s), but the Web-based environment seems pretty slow.
Could loading be sped up? (Perhaps by loading stuff ahead of time, while the student is working?)
Otherwise, could the timeout value be increased so the message does not appear so soon?
During the grade stage in the Web interface, there is a hidden 1 second sleep during the loading, maybe to let the messages printing properly. Also the current timeout value is 5 seconds, it can be increased to 7-10 seconds for example.
I suppose it would be good to remove the default 1-second sleep, which seems counter-productive if it is added to the time spent grading.
What would be nice is to allow each exercise to indicate roughly how much grading time it needs. (If this indication is absent, use a default value, such as the current 5-second default.) When preparing an exercise, I can easily measure how much time grading takes (in batch mode, outside the browser) and write this value into a configuration file. (Multiplying it by a constant, because OCaml-in-the-browser is slower than batch-mode-OCaml.)
Of course this is fragile, since we do not know how fast the student's machine is, but it would still be better than using a fixed value, I think.