This is a follow-on topic from a thread I started entitled "Editing section code: starting point" which I originally posted to the developer forum, and which was subsequently moved by a moderator to this Themes forum and is currently unresolved. I thought that if I were a bit more specific about the task I need to carry out, that I might get more specific advice, so here goes:
By default, when a course is created it has 10 sections. Although the number of sections can be increased or reduced by the up/down icons in the bottom right of the middle column, or via Course Administration >> Edit Settings >> Course Format >> Number of sections, in practice many teachers don't use these facilities so you often get courses with, say, 5 active content sections and 5 empty ones.
What I've been asked to do is to produce a course format such that, on course creation, only one content section appears. Inside, or below, that section, plus and minus icons should appear to add/delete* sections. The hope is that the course won't end up with empty sections.
I'm a fairly new (couple of months experience) Moodle coder, though very experienced PHP developer and Course Manager, and my main problem with this task is that I don't know where to start. So my questions are:
- Where is the code that generates the middle column and content sections?
- Where should I start on this task?
- Might the time taken for the task be disproportionate, given that there are already add/delete* icons at the end of the sections column?
I could probably answer (3) based on the replies to (1) and (2).
I've done a lot of reading of the fine manualsFAQs and fora, gone through tutorials, and even dug into core code, and am so far still a puny field mouse lost in the abundant undergrowth of the Moodle jungle. If someone could hold up a direction sign pointing the way that would be helpful
* I know that sections aren't deleted as such, just hidden, but the teacher will likely think of '-' as a deletion.
(Edited by Mary Evans - original submission Monday, 21 July 2014, 5:38 PM)