Simplifying teacher interface

Simplifying teacher interface

by Gustav W Delius -
Number of replies: 3

Many activity modules provide the teacher with many options when setting up an activity. Not all the options are needed in all schools though and it would therefore be good if the Moodle administrator could choose default settings for some of the options and then hide them form the teachers. It will make Moodle easier to use for teachers.

I have implemented such a scheme in the quiz module in Moodle 1.5dev where the admin now can set and fix defaults for all quiz options (except the dates) on the quiz module config page. Other modules may want to do something similar.

The defaults and the flags whether options should be fixed for the teacher are stored in the config table. I have also extended the mechanism whereby Moodle sets up initial defaults by allowing each module to provide its own defaults.php similar to the one in lib/defaults.php.

My scheme should be improved by giving the teacher a button "Show advanced options" which will show the options if the teacher really wants them. This will be easy to do and I probably will do this for the quiz module soon.

Average of ratings: -
In reply to Gustav W Delius

Re: Simplifying teacher interface

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Um, see my comments on your other quiz module thread about re-using the Resource interface in other modules (and not ever making options inaccessible).

Most modules are already doing something similar to defaults.php in lib.php (see resource module for an example). The advantage of the current method is that the config table is "self-healing" because values are checked each time and a consistent evironment is guaranteed.

However, the defaults.php file is more compact (especially when there are many options) so it's probably a good idea to use that.  I can't really think of a situation when it could get out of synch, unless the config table was messed with.
In reply to Martin Dougiamas

Re: Simplifying teacher interface

by Gustav W Delius -

Yes, I fully agree, I will use the interface idea from the resource module.

The reason I used the default.php mechanism to set the default values for the configuration variables is that otherwise they would not get initialized until the admin visits the module config page. This would not be good because visiting the module config pages is not currently something most admins do after an upgrade.

In reply to Gustav W Delius

Re: Simplifying teacher interface

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
When in lib.php they would get initialised when anyone does anything to do with the module...