How to make a student see only their courses

How to make a student see only their courses

by Mawuli Kuivi -
Number of replies: 9
Hello everyone,
I want to know if someone has some work or knows how to make students see only the courses they are registered in.

Hence when a user comes to the main site, they see only courses they have permissions to access. If they login, then you see all the courses you have permission to see.

How do you set this or where in the code to change this?

We have a lot of students and courses and we do not want them to see any course they do not have permissions to access.
Average of ratings: -
In reply to Mawuli Kuivi

Re: How to make a student see only their courses

by Scott Krajewski -
The solution here is to use enrollment keys in courses.  We use database enrollment and course keys.  The course keys "lock the door" to the course and the database enrollment places students in their right courses.  Students can browse to other courses but cannot enter without the key.

But when a student does login they should see just their own courses if you have your Site Settings -> Front page format -> set to "Show list of categories."  But we've modified the my_moodle function a bit so I don't exactly remember how things work in a standard install.
In reply to Scott Krajewski

Re: How to make a student see only their courses

by Mawuli Kuivi -
Hello Steve,
Thanks for the reply.

We do not want the students to browse other courses.

If the person is not logged in, then they should not see any courses. If they are logged in, then they should see only the courses they have permission to see.

If the is a course that does not require a login, then that should be visible to them even when they are not logged in.

This is what we want to accomplish.

Any ideas?
In reply to Mawuli Kuivi

Re: How to make a student see only their courses

by Robert Brenstein -
I think it is possible to accomplish what you want but it requires hacking Moodle quite a bit (the course/category.php file, for example, would require serious revisions). You should really rethink whether using the standard options, course categories and access codes, can't work for you. We have in our Moodle a number of courses that are specific to certain study tracks only. Our first temptation was to do what you want but then we decided to just create multi-level category system with top level being the study track. So yes, students in any track can see courses in any other track but without knowing the access codes, they can't access them anyway. The course offerings are not really secret anyway. Most student just choose their track and sign up for their courses. Students that signed up for any courses see only those courses after login.
In reply to Robert Brenstein

Re: How to make a student see only their courses

by Mawuli Kuivi -
Hi Robert,
Thanks for the update.

I understand what you are saying. The problem comes when you have so many courses and some of the courses have many sections. We create a Moodle course for each section. You get many courses and when a students comes in, they see a lot of courses and sometimes get confuse at to which one they are registered in. All students are enroll from LDAP automatically. So they do not use enrollment keys. That is why we want them to see only courses they are enroll in. The courses themselves are not secret. Just want them to see only theirs.
In reply to Mawuli Kuivi

Re: How to make a student see only their courses

by Robert Brenstein -
Ahh, you pre-register all students. In that case, when they log in, they should see only the list of the courses they are actually registered in with a button to see all courses and another to search for a course, both below their course list. If that is not the case, may be the front page display mode is set wrong (in site settings) or a given student is not registered for any course. The display mode must be set to display courses or categories (in your case the latter me thinks). Note that anyone logging in with admin rights will always see all courses. If you do not want to have those extra buttons displayed, you can hack function print_my_moodle() in course/lib.php.
In reply to Robert Brenstein

Re: How to make a student see only their courses

by Mawuli Kuivi -
thanks.
In reply to Mawuli Kuivi

Re: How to make a student see only their courses

by Anton de Waal -

Hi Mawuli

Have you succeeded in removing all courses before login but showing enrolled courses after login? I have exactly this problem.

In reply to Robert Brenstein

Re: How to make a student see only their courses

by John Hennessy -
Hi
I'm new to php - could you perhaps give the hack to print_my_moodle() course/lib.php which would remove buttons for "see all courses" and "search all courses"? Is it just comment out?
Thanks
In reply to Mawuli Kuivi

Re: How to make a student see only their courses

by Jeff Fila -
I'd like to see more about this too. My demo site is for corporate learning. When customers log in, I only want them to see the categories/courses for them.

I don't want customer A to be able to see what kind of courses customer B has. I will pre-register all students.

Possible?