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 43 forks source link

Feature request: {ifnotingroup} #225

Closed garetharnott closed 1 year ago

garetharnott commented 2 years ago

Dear Michael,

I'm loving the implementation of filtercodes and the group ones you introduced are working brilliantly. There was another one that just occured to me as it would be useful - something like {ifnotingroup #}. Indeed I wonder if many of the codes would be nice to have a 'not' feature.

Realworld use - I have many, many groups ranging from 4-5 students, up to 250 students for large class groups. However, the repeater group is usually my outlier as they do not engage in all the course material (having gained exemption). If I want to send a message that only everyone else sees, then I would need to write code for all 200+ groups, but a neat {ifnotingroup} code would allow me to show stuff to everyone except the repeaters.

Sorry - just an extra idea to add to the list!

regards Gareth

michael-milette commented 2 years ago

Hi @garetharnott ,

Do you mean like a {ifnotinanygroup} tag? If not, it is not clear to me how this would work for you because wouldn't you end up writing just as many ifnot... tags as you have groups?

Michael

garetharnott commented 2 years ago

Hi Michael,

It all depends on how your groups are arranged. In my example I have 5 class groups and 1 repeater group. If I want to specifically target the class groups I must write 5 separate tags. But a {ifnotingroup} will allow me to write one tag that excludes the repeater but shows everyone else. In any event the other way to handle things is the groupings tag which is like a hidden group in some respects, but because you can easily group groups, it could be used too

I guess though, what I am suggesting is a form of Boolean logic might be good to build in which could create interesting nested results. {ifingroup OR ifingroup} or {NOT ifingroup} or {ifingroup AND ifingroup}. I just have no idea about the waythe tags work so not sure what is possible...

best Gareth

michael-milette commented 2 years ago

Hi @garetharnott ,

Give the latest version here on GitHub a try. It includes a new {ifnotingroup} tag that works just like the {ifingroup} tag but with reverse logic so it should do what you want. Note that I did not do any testing (no time today). I am hoping that you will for me and let me know how it works out.

Best regards,

Michael

garetharnott commented 2 years ago

Hi @michael-milette ,

Sorry for the delay in responding - unfortunately I am a bottom of the pond end-user so I cannot test this. Hopefully someone else sees this and gives it a try? I do think this filtercode has much potential - I know I definitely would like to use it right now.

best Gareth

michael-milette commented 1 year ago

Hi @garetharnott ,

This tag is now also available on Moodle.org. Thanks again for your suggestion!

Best regards,

Michael