Scroll manager and validation errors

Scroll manager and validation errors

Joseph Rézeau -
回帖数:1
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像 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

回复Joseph Rézeau

Re: Scroll manager and validation errors

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.