Change the default state of the eye icon in the restriction settings of Moodle Activities

Change the default state of the eye icon in the restriction settings of Moodle Activities

by Matthew Willis -
Number of replies: 4

Hi there!

I want to change the default state of the 'hidden/show greyed out' behaviour of the visibility (eye) button in Moodle Activity Restrictions from 'show greyed out' (eye open) to 'hidden otherwise' (eye closed). The screenshot below depicts this section I intend to change. I couldn't locate anything within the application's settings (site administrator access), so I assume I have to change this in PHP somewhere. Where is this instance of the hide/show eye controlled, and how can I change the default configuration of this visibility when creating new activities?


Access restrictions on an activity

Average of ratings: -
In reply to Matthew Willis

Re: Change the default state of the eye icon in the restriction settings of Moodle Activities

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

The default visibility of an availability condition can currently not be configured in Moodle. To have this functionality you will have to modify core java.

Long ago, I implemented this fix to have the language availability standard hidden, perhaps these changes can be a start point for your needs.

Average of ratings: Useful (1)
In reply to Renaat Debleu

Re: Change the default state of the eye icon in the restriction settings of Moodle Activities

by Matthew Willis -

Hi Renaat,

Thanks for the heads-up about modifying the core java and providing the link! This will help immensely smile

In reply to Renaat Debleu

Re: Change the default state of the eye icon in the restriction settings of Moodle Activities

by Dave Balch -

Perhaps that should have been JavaScript, rather than Java?..

In reply to Dave Balch

Re: Change the default state of the eye icon in the restriction settings of Moodle Activities

by Matthew Willis -
Hi David,

You are correct! I did read 'java' as JS in Renaat's response anyway, so I understood what he meant.