Filtered course list
Maintained by
Charles Fulton, Kevin Wiliarty, Andrew Zito
The Filtered Course List block displays a configurable list of courses. It is intended as a replacement for the My Courses block, although both may be used. It is maintained by the Collaborative Liberal Arts Moodle Project (CLAMP).
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
idnumber | exp | Spring 2025 | 2024SEM2
idnumber | exp | Summer 2025 | 2024SEM3
category | exp | 48 (=Moodle Support) | 62 (=Moodle Subcategory)
category | exp | 61 (=Community Moodle) | 0
category | exp | 57 (=BSN Online Development Courses) | 0
regex | col | 2024-2025 | _2024SEM\d
regex | col | 2023-2024 | _2023SEM\d
regex | col | 2022-2023 | _2022SEM\d
regex | col | 2021-2022 | _2021SEM\d
A bit lost with the mobile app right now, but this would be the n°1 customization we'd need to just start using mobile. Cheers and thanks !
When I add filter text to Filter configuration field, nothing is changing. Why it is so?
Also, any inklings of Moodle making the functionality of this plugin available in core?
Lastly, wondering if you have seen similar categorization abilities created in other plugins for the "/grade/report/overview/index.php" grades page for students, to group and sort those courses (especially useful when multiple years of courses are on one Moodle instance)?
Nathan
The code in question is in "block_filtered_course_list.php" file around line 264 (last if-else if).
Instead of:
if (count($this->rubrics) > 0) {
$content = new \block_filtered_course_list\output\content($this->rubrics, $this->instance->id);
$this->content->text = $output->render($content);
} else if ($this->fclconfig->filters != BLOCK_FILTERED_COURSE_LIST_GENERIC_CONFIG) {
$this->liststyle = 'generic_list';
$this->fclconfig->filters = 'generic|e';
$this->_process_filtered_list();
}
that is showing all courses, I put:
// My replacment code for no courses enroled message instead of generic list.
$usernome = fullname($USER);
if (count($this->rubrics) > 0) {
$content = new \block_filtered_course_list\output\content($this->rubrics, $this->instance->id);
$this->content->text = $output->render($content);
} else {
$this->content = new stdClass();
$this->content->text = '
Sorry '.$usernome.',
';you don\'t have enroled courses in this
type of filtered categories.
$this->content->footer = '';
return $this->content;
}
As you can see $usernome should be defined before If-else.
I found this personalized message is much more adequate for users without enrolment, and you can change message to better suit your system.
Of course this is not the best practice in moodle plugin development, and this message should be actually placed in language strings file and called here, but I didn't have time, sorry.
I hope somebody will find this useful.
$this->mycourses = enrol_get_my_courses(null, "$sortstring");
With
if (is_siteadmin()){
$this->mycourses = core_course_category::get(0)->get_courses(array('recursive' => true));
} else {
$this->mycourses = enrol_get_my_courses(null, "$sortstring");
}
This will give the administrators that much wanted capability to filter all courses as they need, and other users will see only courses where they are enroled as that was the main purpose of the plugin. With that said, I have problem with 'generic_list' shown to users in cases where they don't have enroled courses in specified category. Can you please help me with that because I don't have time to find in the code where to turn it off, and replace with "no courses" for example.
Thanks in advance!
Thank you very much for answering my question, yesterday I was testing the block more thoroughly and I understand what you are saying, in effect the block only shows the courses in which the user is enrolled.
Is there a way to show all the courses () visible to the user of the platform? (regardless of whether you are enrolled or not).
Thank you very much and success!
PD: The structure of the platform is as follows
-Subjects
Institutions
Subjects (courses)
-Postgraduate
-Tutorials
I need your help, I don't know how to show all the courses without generating a link to the category, that is, I want the list of courses that fall within that category to appear in the block itself.
Thank you so much!