You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latest release of learn-ocaml uses some automatic save of the exercise as soon as the window is closed.
On the one hand, it is not very "intuitive" because the operation is precisely performed transparently for the user (so several students told me this afternoon that they were not sure whether and when their exercise was saved…)
On the other hand, I've noticed the issue below (which we had also noticed and fixed in learn-ocaml-editor (so I guess I could propose a similar PR to adddress this when I'll have some time))
Steps to reproduce the bug
we open in two different tabs or windows of the browser, two views of learn-ocaml with the same user and the same exercise, say, Tab A and Tab B [this can be be useful e.g. if one has a dual screen, namely a laptop screen and an additional monitor].
we slightly modify Tab B (without clicking on "Sync" nor "Grade").
we thoroughly edit Tab A (say, with several additional lines) and click on "Sync".
we close Tab A, then Tab B (without clicking on "Sync").
we reopen the same URL of the exercise.
Actual result
The version of Tab B shows up.
Expected result
when closing Tab B at step 4., a standard dialog is displayed, and asks whether to exit without saving the changes; we choose "no" on purpose.
after step 5, the version of Tab A shows up.
The text was updated successfully, but these errors were encountered:
* Mechanism 1:
We disable the automatic and implicit saving of the student answer when the browser tab is closed. Instead, we ask the user to confirm that she wants to leave the page (unless the answer has already been synchronized).
Related: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload#example
* Mechanism 2:
When an answer has not been modified for 3 minutes, we check (upon next keystroke) if a more recent solution exists on the server. In that case, we ask the user if she/he wants to download the most recent version.
* Mechanism 3:
To avoid overloading the server with many synchronization requests, we disable the synchronization button when the answer is synchronized, and reactive it only when a modification is made on the answer.
Close#316Fix#467
Co-authored-by: Yann Regis-Gianas <yann@regis-gianas.org>
Co-authored-by: Erik Martin-Dorel <erik.martin-dorel@irit.fr>
Kind: bug
learn-ocaml version: 0.11
Context
The latest release of learn-ocaml uses some automatic save of the exercise as soon as the window is closed.
On the one hand, it is not very "intuitive" because the operation is precisely performed transparently for the user (so several students told me this afternoon that they were not sure whether and when their exercise was saved…)
On the other hand, I've noticed the issue below (which we had also noticed and fixed in learn-ocaml-editor (so I guess I could propose a similar PR to adddress this when I'll have some time))
Steps to reproduce the bug
Actual result
Expected result
The text was updated successfully, but these errors were encountered: