Block user role

Block user role

by Matti Jordman -
Number of replies: 2
Hi

I've courses open for guests but it's recommended to log in and join the course to get grades. I'd develop a block to check if a user is guest. Then it shows the user a message to log in (a link to the enrol page). It works ok but I was wondering what's the recommended way to get information on whether the user is a guest (and not a student).

thanks
Matti
Average of ratings: -
In reply to Matti Jordman

Ang: Block user role

by Preben Pedersen -
Hi Matti

I have similar environments. I can recommend using the plugin FilterCodes (https://moodle.org/plugins/filter_filtercodes).

With that you can use the shortcode {ifguest}{/ifguest} anywhere you use the editor, and the information between the tags will only be displayed to guests.

I hope it helps.
In reply to Preben Pedersen

Re: Ang: Block user role

by Matti Jordman -
Thanks Preben
This is nice option. I'll try it.
The idea of my block is that it needs less manual writing. My Moodle courses are multilingual (only two at the moment) and using this filter needs text for each language. Also the block automaticly adds link to the enrol page of current course.
I'll check this anyway, great plugin!