Future major features

Lesson user and group overrides

 
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of Jean-Michel Védrine
Lesson user and group overrides
Group Core developersGroup Plugin developers

Hello,

I have been working on adding user and group overrides to the lesson activity module. Code and screenshots are available in MDL-7315

I have re-used all the code done by Matt Petro for implementing user and group overrides in the quiz module so it works exactly the same.

Of course as lesson has a lot of settings related to user, there is a lot more lesson settings you can override.

I would enjoy getting some comments:

  • is this an interesting feature
  • do you see any other lesson settings you would be interested in overriding ?
  • ...
I know some Moodle users would be interested in a more general approach to allow overrides for all Moodle activities, but because of the differences between modules (and I should say difference in the code quality between modules, no offence, but some modules have very old code wink ) I am convinced after working on lesson that this would be a very big task. So I decided, as there were many votes to implement this in lesson to give it a try in the hope it would be useful to those users. Maybe in the future somebody else will try a more general solution ?
Note that it was in fact rather simple because I started from good code.
 
Average of ratings: Useful (1)
Tim at Lone Pine Koala Sanctuary
Re: Lesson user and group overrides
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

I think this is a useful feature. (Though I am not a lesson user myself.)

I think it is realistic to implement this as a lesson-only feature for now. In future, if someone thinks they can re-factor all the specific implementations (Quiz, Lesson, Assignment? ...) into a new super-generic-implementation, then I will be very impressed, but actually, at that point, it will probably be helpful for them to have several independent implementations to use as a starting point for the work. (http://c2.com/cgi/wiki?ThreeStrikesAndYouRefactor)

 
Average of ratings: -
Picture of Itamar Tzadok
Re: Lesson user and group overrides
Group Core developersGroup Documentation writersGroup Plugin developers

Useful feature indeed but not necessarily useful implementation approach.

Any feature that is added to a core component which is maintained by HQ requires allocation of HQ resources on an ongoing basis. As Jean-Michel has pointed out, HQ have limited resources. These limited resources should be better invested in features of general nature and further plugin support.

Lesson overrides is a particular instance and arguably pluggable. In my opinion it is better to develop it as a contributed plugin, until HQ or one of the for/non profit partners allocates resources for a generalized solution. A general solution should probably be an API and hooks for a module overrides plugin similar to solutions in many other areas of Moodle (e.g. logging, course formats, etc.).

Should HQ opt to add the overrides feature to the core Lesson sooner than later, I think that some work should and could be done to wrap it as a core module pluggable component with hooks in relevant areas such as backup/restore.

smile

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Lesson user and group overrides
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

How do you think that can be done in a plugin? It requires changes to the core lesson code.

 
Average of ratings: -
Picture of Itamar Tzadok
Re: Lesson user and group overrides
Group Core developersGroup Documentation writersGroup Plugin developers

From what I've seen in Jean-Michel's code the overrides feature is essentially a form with DB support and events. As an aside the events are clearly general enough to be defined as core events, override_created, override_deleted etc.

So, the module specific part is the form and DB and it should be possible to implement them as a local plugin. The plugin can add a designated overrides-managment link to the activity administration and the teacher will click that link from within the activity for adding/updating/deleting overrides.

The core module code only needs to get the overrides for the current user/group on instantiation. In modules that use an object class for the module instance this would be fairly easy and centralized. Afaict the lesson does exactly that to the effect that the overrides can be fetched and applied to the instance data in the constructor (or init method as its case may be).

More generally, if it is not essential to specify DB columns for the specific overrides, the DB support can work like config and be the same for every module that implements overrides.

smile

 
Average of ratings: -