learn-ocaml icon indicating copy to clipboard operation
learn-ocaml copied to clipboard

Success with 0 points

Open adhameer opened this issue 6 years ago • 1 comments

Related to #207: when a student doesn't trigger a penalty, we would like to give them a success message, but award them no points for it. Previously we were able to do this with a status of Success 0, but as of 5c24c812e05088385a7bbb5262c3107d95da422e this no longer works because of the following code:

https://github.com/ocaml-sf/learn-ocaml/blob/5c24c812e05088385a7bbb5262c3107d95da422e/src/grader/learnocaml_report.ml#L142-L143

and it now displays as a Failure instead. We could use Informative or Important, but prefer the positive feedback + green background of the Success status. Could this be fixed?

adhameer avatar Jul 15 '19 01:07 adhameer

Hi @adhameer, This issue is also blocking for us (cf. https://github.com/ocaml-sf/learn-ocaml/issues/207#issuecomment-508275838 for more context). So I'll try to adapt our graders to workaround this unexpected Failure in the reports with learn-ocaml 0.11. But actually, by looking at the previous version of the file src/grader/learnocaml_report.ml changed by 5c24c81, it seems that the Failure itself is unnecessary?

so I'd suggest to replace the line mentioned by Aliya with:

 (fun n -> if n >= 0 then Success n else if n < 0 then Penalty (-n)) ;

@yurug WDYT?

erikmd avatar Sep 22 '19 20:09 erikmd