Restrict shared account to one course

Restrict shared account to one course

by Frank Black -
Number of replies: 3

Moodle v32


I was thinking of giving the parents of our students a shared account to log-in with.

I want this shared user to be restricted to one course after logging in.

Lots of our other courses have guest access enabled (ie. no enrollment), and I don't want this shared user to access those.


Anyone have any ideas how I would do that?


Thanks.

Average of ratings: -
In reply to Frank Black

Re: Restrict shared account to one course

by S. kavita -
Picture of Testers

Hi Frank,

In Front page settings do the following:

Before login : Do not show List of courses or List of Categories, only show announcements and News items

After login: Show only Enrolled courses, do not show list of courses or list of categories.

Now you have to do some changes in code too to hide the "All courses" link which enable when you set the front page to show only enrolled courses.

You can hide this link in renderer.php file which you will find under Moodle>course>renderer.php

In the file search for "All courses" then comment out these two lines:

//'viewmoreurl' => new moodle_url('/course/index.php'),

//'viewmoretext' => new lang_string('fulllistofcourses')


After doing this the parents when logged in then they can be able to view their course in which they are enrolled.

Hope that help.


In reply to Frank Black

Re: Restrict shared account to one course

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Just pointing out though that any parent who knows about it can find the guest access courses by going to  YOURMOODLESITE/course/index.php

In reply to Frank Black

Re: Restrict shared account to one course

by Sumit Negi -

Add a block "My courses" on the user dashboard, that will show only those courses to user in which he/she is enrolled, and to prevent this user to access other courses where you have enabled guest access, the only way is that, set password for guest, so only those users will be able to access those courses who have that password.

Hope it works!!