Moodle plugins directory: Single activity format | Moodle.org
Single activity format
Course formats ::: format_singleactivity
Maintained by Marina Glancy
Allows to create course that consists of only one activity
Latest release:
1 sites
6 downloads
3 fans
Current versions available: 2
Course format 'Single activity' allows to create a format that consists of only one
activity. Course view page is automatically redirected to this activity.
Type of activity is specified in course settings.
Single activity course format has it's own settings where manager can specify
the default activity type for the new courses.
Useful links
Contributors
Marina Glancy (Lead maintainer)
Please login to view contributors details and/or to contact them
Yay! it works, and the code is pretty good.
Some code review comments.
1. There are details that don't really work, including:
"Display description on course page" setting,
"Save and return to course" button.
Having both the course name and the quiz name in the navigation bar.
2. Surely, in settings.php, you should make a sub-class of admin_setting_configselect and override the load_choices() method so the choices are lazy-loaded. See admin_setting_configmultiselect_modules for an example of how to do this.
3. Invalid get_string() identifier: 'sectionname' or component 'format_singleactivity'. Perhaps you are missing $string['sectionname'] = ''; in /fs1/www_root/tjh238/moodle_head/course/format/singleactivity/lang/en/format_singleactivity.php?
I got that by creating a new course using Single activity format, and with activity type Quiz, then going to the course page.
"Having both the course name and the quiz name in the navigation bar." - this is the biggest problem that I see. I wil try to solve it but it still might not work for all module types unfortunately
2. eh, i could. But why bother? I will have 20 lines of code instead of 3 and no performance increase.
3. thanks, will fix that
2. The whole point of this is as a performance win. The admin tree appears on every page for admins. It is important that creating the an admin settings class requires 0 DB queries. That is why the load_choices lasy-loading was implemented. You must use it for this sort of thing.
Also as Tim suggested I hid some "back to course" buttons with CSS
With version 2013010900 running on Moodle 2.4.3+ (Build: 20130502) version 2012120303.11 if you change to the format from an existing course which has lots of activities / resources in different sections and then back again you find that all of the 'activities / resources' have been placed in the first section (0 or 1 I think without having to rerun the destructive test). Please fix .
Cheers,
Gareth
Then perhaps we will have to agree on disagreeing. As I firmly believe that the principle of a course format is that it is there to present the course in a way that the user intends. That changing between them should not loose the intent of the sections that the activities / resources have been placed in even if they are not visible. In this way the user can tryout several different formats to see which one is the best for the particular educational situation. Even if they know what the format will do beforehand, users need to have form and function without fear of unintended consequences.
Cheers,
Gareth