Scroll manager and validation errors

Scroll manager and validation errors

by Joseph Rézeau -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

In the new question engine (2.1 and newer), there is a nifty scroll manager feature:

Scroll manager is a class that helps with saving the scroll positing when you
 * click on an action icon, and then when the page is reloaded after processing
 * the action, it scrolls you to exactly where you were. This is much nicer for
 * the user.

Wouldn't it be nice if we had the same scroll manager feature all over moodle's forms which have a validation element. The idea would be to position the page on the error message (or the first error message if more than one) when the page is redisplayed after validation has found error(s). This would be particularly useful for lengthy forms, where the error message is located out of sight when a page with errors is re-displayed.

What do developers think?

Joseph

Average of ratings: -
In reply to Joseph Rézeau

Re: Scroll manager and validation errors

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes! (Of course I think that, I coded scroll manager). While it is a small thing, it has a surprisingly big effect on usability.

The code is here: https://github.com/moodle/moodle/blob/master/question/qengine.js#L25 - if we started using this in other parts of Moodle, we could, of course, move it to a more central location.

You could also search for 'scrollpos' within the page http://docs.moodle.org/dev/Using_the_question_engine_from_module for more information about how this works.

Average of ratings: Useful (1)