Showing configured courses inside an HTML block

Showing configured courses inside an HTML block

by Ezequiel Uberti -
Number of replies: 0

Hello all,

I'm trying to use an HTML block to show specific courses depending on whether the user clicks on one of two options. Here’s the idea:

We have 5 course categories, and in each of them two subsets of courses: professional and non-professional courses. I am designing a simple menu with JavaScript, so if the user clicks on the ‘Professional’ button, a list of all five categories should be shown, but inside each category, only the professional type of course. We’ve enforced that all courses will include a suffix in its short name telling which course type it is. For example, we would have ‘Course001_PR’ for Course 1 is of type professional, and ‘Course002_NP’ defined as non-professional. I’m mentioning this to explain how I expect to filter between both types.

My question is:

Is it possible to ‘query’ or ‘reference’ the courses that have already been created, from inside an HTML block, then filter them out using part of the short name, and finally show them?

I’m using Moodle 2.5.1+ (Build: 20130905)

Average of ratings: -