Moodle plugins directory: Periods format | Moodle.org
Periods format
This course format allows to set duration for each section (period) in days, weeks, months or years. Each individual section (period) may override this duration.
The course settings allow automatically collapse or hide past or future periods. For the past periods it is possible to hide them from course view page but have each individual module still accessible through reports and/or gradebook. Also it is possible to hide past periods only if all activities in them are completed and show otherwise.
Current section is automatically highlighted.
Please note that this format takes advantage of the new feature introduced only in 2.8 (see MDL-46937), so it will not work properly on 2.7.
Related issues and discussions: https://moodle.org/mod/forum/discuss.php?d=268797 , MDL-47318 , MDL-47516
There were some formal coding style issues detected by the cibot. Although we do not generally discriminate against them, I thought it might be good if HQ people tried to have their own plugin in just a perfect state (I am aware it's not always possible to make cibot 100% happy but there seem to be some issues reported that should be easy to fix). I know some community developers watch our repos as examples of good coding practises and it's harder to encourage them to follow our strict guidelines if we ourselves do not do so. Thanks for understanding.
Please note the GNU/GPL boilerplate is recommended at the beginning of each file - http://docs.moodle.org/dev/Coding_style#Files
The code in the file periodduration.php uses `format_period_*` frankenstyle prefix while the correct one should be `format_periods_*` (plural). By the way, I'm just curious what was the reason for the custom implementation of lib/form/duration.php. Was there no way to re-use the core element?
Please fix the missing bug tracker URL reported by the plugin checker above. If you plan to use our tracker, feel free to create the required CONTRIB component yourself or just let us know and we will process it.
For now, I am going to mark this plugin as needing more work until we get these issues resolved. Thanks for your patience with the review and approval process.
thanks for the review. I'll look at the codechecker results.
As for GPL boilerplate - it's a bit weird to say that "his file is part of Moodle - http://moodle.org/". Does it mean when plugin is published in this directory it becomes part of Moodle?
Regarding duration - standard element has units: minute, hour, day, week (or something like that) and each unit is identified by the exact number of seconds. It is impossible to use it when the duration is a month, because you can not know the exact number of seconds (or days) in a month. Besides, format_weeks has a hack when 2 hours are added to the course start date to avoid DST confusions. Because in case of DST change in the middle of the course one week should be an hour longer or shorter.
In my format the period duration can be set in days, weeks, months or years (internally stored as string instead of number of seconds) and it uses php functions to add a time interval, so "month" is a real month and even in case of DST change the midnight is still midnight.
Thanks for the explanation of the duration class. It makes perfect sense now. I'll be happy to approve this plugin as I really think it will be a great contribution for many teachers. Thanks a lot for your work on this course format. Please do not forget to schedule it for re-approval one you upload the new version (sorry for learning the old eagle how to fly and work with local_plugins )
Can it be set to only let the student move to the next lesson if they pass the one they are on?
Rahul, Micah, Greicy - did you find any course formats that can do this?
Thanks
Mike