-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate learn-ocaml-editor #295
base: master
Are you sure you want to change the base?
Conversation
* Rebased on 8ba4e3a Co-authored-by: Manuel Cabarcos-Baulina <[email protected]> Co-authored-by: Romain Grimal <[email protected]> Co-authored-by: Damien Guagno <[email protected]> Co-authored-by: Alexandre Perge <[email protected]> Co-authored-by: Sophie Rumin <[email protected]>
Co-authored-by: Manuel Cabarcos-Baulina <[email protected]> Co-authored-by: Romain Grimal <[email protected]> Co-authored-by: Alexandre Perge <[email protected]> Co-authored-by: Sophie Rumin <[email protected]>
* Switch to opam 2 * Compile (_: test_qst_untyped) directly to Test_lib * Disable compilation of TestAgainstSpec for now * Replace src/grader/test_lib.{ml,mli} with ocaml-sf/learn-ocaml@46ded0b * Start improving the polymorph_detector Co-authored-by: Manuel Cabarcos-Baulina <[email protected]> Co-authored-by: Romain Grimal <[email protected]>
* Refactor strings using {| ... |} * Fix order bug if generating/compiling a testhaut with 10+ questions + Refactor src/state, src/editor to replace most StringMap with IntMap + Remove fetch_test_index that seems unnecessary * Don't ask confirm for individual delete of testhaut question * Reimplementation of the Generate feature using Js Regexp, not (char list)s * Put the code quality section at the beginning * Replace "Dummy_Params" with a shorter identifier "Mock" * Fix Check_Test.ml to take {Prelude,Prepare} contents into account * Improve Check_Test.ml: Auto-select {Prelude,Prepare} tab (and line) if error
Fix the conflicts of the migration, leading to the following changes: * Remove the "testhaut" view to have a stronger focus on the underlying OCaml code for "test.ml"; * New implementation of "Generate" that bypasses the "testhaut" view. The application smoothly compiles and runs, but the following tasks remain: * The "Experiment" feature of the editor is temporarily commented-out; * There is a remaining isssue with the "Check" feature of the "Test" tab; * Internationalization is still to be done.
* Adapt learnocaml_toplevel_worker_main.ml to conditionally load Embedded_grading_cmis.
* If error is at line No. < 0, switch first from "Test" to "Prepare".
…xercise while grading
40cf35d
to
d82eb94
Compare
c68ee1a
to
c082d9d
Compare
* Rely on Editor_lib.extract_functions
…into learn-ocaml-editor
if (one creates a new exercise in the editor and) adds a solution+test then click on Check and very quickly, click on Save&Grade! Now, the "Check" button disables "Save&Grade!" and conversely.
* Fix static deployment of learn-ocaml-editor
* otherwise the interface is quite unpractical, e.g., using ext_alert with custom buttons would need to copy in the client code, the definition of box_button; so, DRY!
* Add some (commented-out) debug code facilities; * Add some TODO/FIXME/XXX remarks; * Workaround the issue by ignoring the 'exercise.descr' string in editor_lib.ml (otherwise its encoding-then-*decoding* fails)
7ad6ba8
to
a06f37e
Compare
* origin/master: (23 commits)
* upstream/master: (37 commits) Conflicts: learn-ocaml.opam
It is enabled by default: $ learn-ocaml build <=> $ learn-ocaml build --enable-editor unless we run the command line: $ learn-ocaml build --disable-editor
* In sub-directories: - static/editor/ (*.html) - _opam/share/learn-ocaml/editor/ (*.js|*.html) * Rename one resource as well (s/new_exercise/new-exercise/) * Ensure `learn-ocaml build --disable-editor` does not copy files into www.
1b34ab1
to
7689962
Compare
To be more precise (using Bash syntax for more clarity): * Beforehand, we used "q_${name}" and "q_${name}_1", "q_${name}_2" which could be problematic if some ${name} ends in "_1". * Henceforth, we use "q_${name}" and "q1_${name}", "q2_${name}".
(albeit learn-ocaml-editor might be internationalized at some point)
Regarding optional e-mails, for the sake of consistency, use the same as that of PR ocaml-sf#362 (branch oauth-moodle-dev). & Do some minor HTML cleanup as well.
(so that 4 is at the top)
Hello @erikmd : what's the status of this PR? Should we close it so that you can integrate its feature in a more incremental way? |
Hi @yurug, thanks anew, so the feature of this branch is almost ready but there are three things that remain to do:
but no need to close the PR I guess, I'll be able to force-push once the branch has been archived. Edit: I added these three steps at the end of the description of the issue |
To be a bit more specific of the blocking issue partly documented in commit a06f37e → the fact is that in (Learn-OCaml)Editor, tested with Firefox, when we click on Furthermore, this issue was not "present" at all in the initial version of (Learn-OCaml)Editor… (I had done a bisection and noticed the issue was introduced when the |
Kind: feature
Depends: #302
Dear all,
This PR adds the "learn-ocaml-editor" feature that has been developed in https://github.com/pfitaxel/learn-ocaml-editor by the PFITAXEL team, recently migrated by @leunam217 to the latest version of learn-ocaml (18f0ddc) then simplified − removing one view (high-level version of "Test") and renaming "Test.ml" to "Test" − to anticipate an upcoming evolution to be implemented within @leunam217's internship co-supervised by @yurug and me.
Brief overview of the design choices
From the beginning of the development of this feature, the idea is to provide a local web environment (fully client-side & statically served) for the teachers to create learn-ocaml exercises with:
solution.ml
,template.ml
,prepare.ml
,prelude.ml
,test.ml
, metadata etc.) with a faster development cycle for teachers.(albeit since the migration an issue has to be fixed with the "Test" tab)[now fixed]There is currently a JSON import/export feature for exercises, but we plan to work after this PR on enhancing these import/export facilities (e.g. targetting .zip files in the exodir format and/or fetch from external Git exercises repos)There is now a .zip import/export feature for exercises in the exodir format.
(but we could implement later on another import facility, e.g. to fetch from external Git exercises repos)
Summary of the changes brought by this PR
(Note: this button is only shown when the token is a teacher one, but the Editor URL itself is not protected (this seems unnecessary) because by design the editor is local-only and doesn't allow inspecting the compiled exercices: it is intended to create new exercices and possibly later fetch from external Git repositories some exercises to be edited)
Learnocaml_data
to add data-types used by the editoreditor
containing the corresponding files(Note: this can be refactored further, especially
editor.ml
which is strongly inspired bylearnocaml_exercise_main.ml
)toplevel
(including adding an optional arg toLearnocaml_toplevel.check
) to implement the "Check" and "Generate" features for the "Test" tab, while reusing learn-ocaml's codebase.Overview of the interface
Below is a screenshot [updated] to give a sketch of the corresponding interface:
FYI a statically deployed version (using Github pages) of the previous version of learn-ocaml-editor (0.4.0) is available here: https://pfitaxel.github.io/pfitaxel-demo/
(we'll be able to deploy the latest version of "learn-ocaml+editor" − corresponding to this PR − statically as well if #288 is addressed)
Things to be done before merging this PR
(I can say I'm up for any help on this issue anytime soon 😅 Cc @yurug @AltGr)
release-please
compliant way (but we may probably want to keep the commits in an archived branch, for historical purpose)