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

Feature: enable typechecking exercise templates

Open dm0n3y opened this issue 3 years ago • 3 comments
trafficstars

The exercise templates I create are always intended to be well-typed, with NotImplemented exceptions raised wherever the student is expected to provide their own solution. Sometimes these templates contain significant starter code. To verify it's well-typed, I have to build the exercise, run the server, open the exercise, and hit compile. It would be nice if I could get feedback in the build step.

dm0n3y avatar Mar 21 '22 03:03 dm0n3y

This looks like a sensible suggestion, thanks. but I'm pretty sure not all people would like to typecheck the template.ml files as well. what about a CLI option (disabled by default) that also typechecks this file for all exercises, and triggers a global failure in case of any syntax/type error?

erikmd avatar Mar 21 '22 22:03 erikmd

BTW you might be interested in the learn-ocaml-editor webapp (statically deployed at https://pfitaxel.github.io/pfitaxel-demo/#activity%3Deditor ; soon to be integrated in learn-ocaml:master so that any Test_lib improvement is taken into account):

In particular, there is a Check button in the Template tab:

Screenshot

2022-03-21_23-04-43_Screenshot_Template_Check

And there's also an import/export feature of an exercise (as a .zip file)

erikmd avatar Mar 21 '22 22:03 erikmd

Would it work to run something like ocamlc -i prelude.ml prepare.ml template.ml from the exercise directory ?

AltGr avatar Mar 22 '22 09:03 AltGr