michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
32 stars 45 forks source link

Feature Request: FilterCode based on completion of another course #164

Open davefoord opened 3 years ago

davefoord commented 3 years ago

Would it be possible to have an if filter code that is based on the completion of another course?

Something along the lines of:

{ifcoursecomplete courseshortname} and then the corresponding negative {ifcoursenotcomplete coursehsortname}

That way I could show different content based on whether they have or haven't completed another course.

(or could use course ID rather than shortname)

Thanks in advance.

michael-milette commented 3 years ago

Hi @davefoord ,

It would be possible to do this.

Michael

davefoord commented 3 years ago

That would be excellent if this could be added. Thanks

davefoord commented 3 years ago

Actually just thinking this through, using the course shortname would be better than using course ID, as if the course ever had to be recreated from a back up the courseid would change but the shortname would remain the same.

michael-milette commented 3 years ago

Hi @davefoord

Normally I would agree. However, unlike in many parts of Moodle where the shortname is a label that is never seen by students, the course name is displayed. If the course shortname changes by even one character (correcting a typo for example), you might need to go though a considerable amount of your course content to update the shortname, depending on how often you used the new tag. Of course if you cloned the course, you would need to do the same thing anyway.

Could you provide me with a few examples of use case of how you would use this? Have you considered using the Conditional Activities to restrict visibility of content in your course depending on completion of another course?

Best regards,

Michael

LogFish commented 1 year ago

Hey folks. I managed to do this with filtercodes by pairing it with the subcourse plugin. You add a hidden subcourse activity and set it to self-complete when the targeted course within the subcourse activity is complete. You can then use that subcourse activity ID and it's completion status as the reference for the 'ifactivitycompleted' filtercode.

davefoord commented 1 year ago

Thanks LogFish - yes what you have described would do this. I have only just realised that it was back in 2021 that I started this thread, and I never actually provided the use case examples that I was asked to provide (sorry I was on holiday at the time).

The use case for me, is in some of my Moodles, I am creating my own labels within courses that link to the different activities within the course (eg all the activities are available but not visible) so the way into them is via the mechanism I have created. This basically makes the interface much simpler and cleaner for the user, so yes I can use restrict access to limit access to certain items, I also want to be able to mirror that within the labels that I have produced.

Obviously this is a very niche way of working, that most other's won't follow, and especially as we move to Moodle 4.1 this method actually becomes harder to manage, so I think will get used less, but I can still see a use for people to add textual items into something e.g. 'Well done {firtname}, you have completed the Health and Safety module - the other core module that you need to complete is introduction to safeguarding'