Moodle

Let user confirm leaving a page without saving form chages

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Forms Library
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

This is a proposal for a feature I have seen in Plone (see http://plone.org/products/plone/roadmap/24)

Motivation
=======

Many times it happens that a user has written lots of text in a form and forgets to click Save or by accident clicks on a link or moves to another url. It is desirable that in such a situation the browser (Moodle) asks the user if she really wants to navigate away and lose her editing.

Proposal
======

On browsers which support it, Moodle should warn before allowing the user to navigate away from a page which contains an edited form. As I have googled, IE4+/Win, Mozilla 1.7a+, Netscape 7.2+, and Firefox support the onBeforeUnload event that is fired before the browser navigates away. The event allows displaying a form which gives the user the option to continue to navigate away from the page, or to cancel the navigation and return to editing the form.

The idea is to add handling code linked to this event, that checks if the user has edited/modified the form and if no submit is clicked, he is presented a dialog where he can confirm his action. Browsers that do not support the event won't notice this mechanism (graceful degredation).

The handler should ignore the supplementary forms which can appear on a page such as the search box. It seems to me, that the feature should be used only on pages containing a form (forms) based on Moodle Forms library.

Attached there is an example.html.txt that demonstrates how this could work.

Issue Links

Activity

Hide
Dan Poltawski added a comment -

I quite like the idea and its becoming more and more common across the web (e.g. gmail) so I think its something people would be used to.

Show
Dan Poltawski added a comment - I quite like the idea and its becoming more and more common across the web (e.g. gmail) so I think its something people would be used to.
Hide
Gary Anderson added a comment -

I am voting for this issues, but I find a far more common problem to be that the student submits a very long response to an assignment either to find that the session has timed out or that they have lost network connection or that the server does not respond for some other reason.

In this case, hitting the back button in the browser brings you back to a blank text field, rather than your original composition. In many cases, this leads to many minutes of lost productivity.

What I would like to see (either in addition to or as an alternative to) this proposal is to get the field cache settings right so that using the back button in the browser retains the text in this field. I know that this is what happens in these situation when editing something in MediaWiki, so I suspect that it is a setting in the HTML head that controls this.

I wonder if the usability of the back button in the browser would not solve both these issues.

Show
Gary Anderson added a comment - I am voting for this issues, but I find a far more common problem to be that the student submits a very long response to an assignment either to find that the session has timed out or that they have lost network connection or that the server does not respond for some other reason. In this case, hitting the back button in the browser brings you back to a blank text field, rather than your original composition. In many cases, this leads to many minutes of lost productivity. What I would like to see (either in addition to or as an alternative to) this proposal is to get the field cache settings right so that using the back button in the browser retains the text in this field. I know that this is what happens in these situation when editing something in MediaWiki, so I suspect that it is a setting in the HTML head that controls this. I wonder if the usability of the back button in the browser would not solve both these issues.
Hide
David Mudrak added a comment -

Gary, thanks for your comment. I agree with you - this is a real problem. I have already encountered it during a quiz attempt. Moodle did not accept student's answers because his session ran out.

AFAIK there is no way how server side script could guarantee browser to cache a field content. IMHO that is the feature of a browser itself. But I can imagine a solution similar to Google mail Concept folder. Ie. during filling a form, an ajax based javascript would regularly save its fields values at the background. In case of any problem (lost connectivity, page left by an accident etc.), the user could find her unsaved form data in her Concept folder (maybe a part of user profile?). I already have some ideas on how this would work (XML based format, automatic recover process when user comes back to the form page later etc.) and this would solve this issue as well.

Show
David Mudrak added a comment - Gary, thanks for your comment. I agree with you - this is a real problem. I have already encountered it during a quiz attempt. Moodle did not accept student's answers because his session ran out. AFAIK there is no way how server side script could guarantee browser to cache a field content. IMHO that is the feature of a browser itself. But I can imagine a solution similar to Google mail Concept folder. Ie. during filling a form, an ajax based javascript would regularly save its fields values at the background. In case of any problem (lost connectivity, page left by an accident etc.), the user could find her unsaved form data in her Concept folder (maybe a part of user profile?). I already have some ideas on how this would work (XML based format, automatic recover process when user comes back to the form page later etc.) and this would solve this issue as well.
Hide
Matt Gibson added a comment -

+1 for Gary's comments. This has wound up me and many others countless times. Especially when a student is doing an online text assignment and despite my warnings, decides to type directly into the htmleditor for 2-3 hours and then gets hit with a lose-all-your-work session timeout.

What I would really love is a gmail-style autosave for long text fields. It should be relatively easy to implement a class to handle that, perhaps with a 'temp' table in the database which gets purged every week.

Show
Matt Gibson added a comment - +1 for Gary's comments. This has wound up me and many others countless times. Especially when a student is doing an online text assignment and despite my warnings, decides to type directly into the htmleditor for 2-3 hours and then gets hit with a lose-all-your-work session timeout. What I would really love is a gmail-style autosave for long text fields. It should be relatively easy to implement a class to handle that, perhaps with a 'temp' table in the database which gets purged every week.
Hide
Clinton Graham added a comment -

I too agree that we should take advantage of AJAX (or just Javascript) to make available functionality to auto-save partial posts and warn users of navigating away from a unsubmitted page.

Show
Clinton Graham added a comment - I too agree that we should take advantage of AJAX (or just Javascript) to make available functionality to auto-save partial posts and warn users of navigating away from a unsubmitted page.
Hide
David Mudrak added a comment -

I will try to implement this. Also see MDL-18014 for the another discussed issue.

Show
David Mudrak added a comment - I will try to implement this. Also see MDL-18014 for the another discussed issue.

People

Vote (9)
Watch (4)

Dates

  • Created:
    Updated: