Progressive Disclosure Implementation
Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable. |
Implementation instructions for Progressive Disclosure
Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.
To give new developers a head start, add advice here on how to implement the recommended elements. (Of course, the APIs should be good enough to not require lots of extra code.)
As an usability practitioner, the implementation pages like this are where I am hoping to have developers have a play: there is probably some documentation available already about how to implement many of these things, but the developers who are already 'in' know how to find it best.
So add links to appropriate places - or if need be, implementation pages like this are perfect placeholders to put also new information about how to implement the recommended moodle UI elements. --Olli Savolainen 22:20, 3 June 2009 (UTC)
Simple progressive disclosure in a form
This will store the information in a session, about in which state the form was left, so if you press the 'Show advanced' button once, you will see the advanced controls shown anytime you come back to the form.
How to access this screen
- Create a quiz in a course, and open it. The configuration form will be shown
- Alternatively, open an existing quiz as a teacher and press the "Update this quiz" button
Address of this example in your Moodle
Assuming the quiz in question has the module id of 2, the address is:
/course/modedit.php?update=2&return=1
(add a link here to an actual demo installation? if so, that would have to keep its urls forever, i.e. probably have a moodle version installed that doesn't get upgraded)
The location of the code for this implementation
Please fill in location(s) in either http://cvs.moodle.org/ or in the code cross-reference (the latter is probably more useful), specifying the Moodle version where this information applies.
Implementation How-to
Please fill in, copying information as necessary from Development_talk:Progressive_Disclosure#Examples, specifying the Moodle version(s) where this information applies.
This example uses Moodle Formslib. Moodle remembers the state the form was left in (in the user_preferences table) when the user leaves the page and restores its state when the user returns to it.
In the form when adding/updating a quiz (and other activity modules), there are several options deemed advanced that are hidden behind a button. This happens because:
- the module implements a set of default defaults for which items are advanced
- the module has implemented a settings page that allows the admin to re-specify what is advanced if they want to, and also allows the admin to change the default values for the fields
- the module uses mform which uses the settings to flag what is advanced and what isn't
- mform will automatically create the interface based on these settings plus user preferences for "stickiness"
The great thing is that if all developers implement progressive disclosure this way then it means that usability for this specific example of progressive disclosure CAN be fixed across Moodle simply by fixing mform.
Search and Advanced search of forums
Change to another page with further options if the user clicks "advanced search".
- Simple search: the "search forum" form http://moodle.org/mod/forum/view.php?id=737
- Simple search results (with link to advanced search): http://moodle.org/mod/forum/search.php?search=sweet&id=5
Collapse with javascript (left/down arrow)
/lib/weblib.php (Moodle 2.0 HEAD) (how to link directly to a specific line in Moodle code? xref.moodle.org only shows 1.9.3?)
function print_collapsible_region_start($classes, $id, $caption, $userpref = false, $default = false, $return = false)
Search options
Roles UI (Moodle 2.0). Javascript implementation. When "Search options" is clicked, reveals three checkboxes. Go to a module, such as a forum, in a course, click Update module, click Check permissions. URL of form is
- /admin/roles/check.php?contextid=X .
Enrolment options
Others
- eye: eyelid closed (hidden) or open (shown)
- Not progressive disclosure, but another way of toggling display; this time just for other users (teacher hides, student's stop seeing)