Are you able to install plugins on your site? If so then there is a Restrict by password availability plugin that will do what you want: https://moodle.org/plugins/availability_password
Security and privacy
Folder Password in Moodle
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.