Trying to Hack Checklist Module

Trying to Hack Checklist Module

by Jon Fila -
Number of replies: 2

For a lot of reasons, I really love the Checklist module, one of the limitations I've run into really cuts into my time as a teacher because I have to manually update my lists for each user. I typically use a lot of Orphaned Activities in my course design method so students aren't faced with a long list of resources and activities. In an effort to try and automate my checklists, I created a checklist with course items and want it to auto-populate and it does not include orphaned activities.

Davo Smith mentioned, "look at the code in mod/checklist/locallib.php, function update_items_from_course() it may be simple to fix it to do what you want."

I have very limited ability when it comes to writing code. Can anyone tell me what I might change in the function update_items_from_course() area if I want it to just automatically search through let's say 52 topics since that's the default max topic limit by Moodle? That way, no matter how many topics are orphaned, my checklist will always search for available resources in the course.

I'm wondering if there is a way to change the numsections to a static number or to have it just loop through a particular set of topics.

Average of ratings: -
In reply to Jon Fila

Re: Trying to Hack Checklist Module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes, write "$numsections = 52;" (without quotes), just before the line 'while ($section <= $numsections ...

I still think that using orphaned sections is a terrible idea and we really need to find a better solution to having 'hidden but accessible' activities within a Moodle course. Maybe a new course format would be a good idea ...

Average of ratings: Useful (1)
In reply to Davo Smith

Re: Trying to Hack Checklist Module

by Jon Fila -

That's awesome! Thanks so much. I happen to have the luxury of seeing all of the courses on our district's sites quite frequently and I know that none of them go beyond 15 sections in Orphaned areas at the moment so I just used 15 and will continue to monitor them in case having the Checklists look at 52 sections caused any performance issues. 

I can't tell you how much I appreciate this. Thanks again.