How to make users can only see their own courses?
Number of replies: 9
Currently I want to make each student only can see his own courses, but not courses for others... Is that possible? How to do so?
Re: How to make users can only see their own courses?
After login students see 'my courses' in the block. You can disable the link 'All courses' in website adminsitration and you can use the 'My Moodle page as an alternative startpage after login with more information about the own courses.
Ralf
Ralf
Re: How to make users can only see their own courses?
Is there a way that faculty and students can turn off courses they no longer want to appear in the "my courses" block? They are complaining that there are too many courses in there. Thanks, Ellen
Re: How to make users can only see their own courses?
My issue is that the "my courses" block switches to a "course categories" block listing all the courses on the site when a user who is not enrolled in any courses logs in.
So,
Cheers,
Ian
So,
- Authenticated users enrolled in at least one course login to myMoodle and see only their courses in the "my courses" block. This is great.
- Authenticated users not enrolled in any courses login to myMoodle and see the entire course listing. Not ideal.
Cheers,
Ian
Re: How to make users can only see their own courses?
I changed blocks/course_list/block_course_list.php in order to do this. I edited line 64 as follows:
//if ($categories) { //Check we have categories. Commented out.
if (isadmin()) { //Only show categories if admin. Added.
This displays all courses for admin users but hides them if a user is not enrolled on any course.
I'd prefer to do this as a local customisation so that it won't be changed by future upgrades, but can't see how to do this. Any suggestions would be welcome.
//if ($categories) { //Check we have categories. Commented out.
if (isadmin()) { //Only show categories if admin. Added.
This displays all courses for admin users but hides them if a user is not enrolled on any course.
I'd prefer to do this as a local customisation so that it won't be changed by future upgrades, but can't see how to do this. Any suggestions would be welcome.
Re: How to make users can only see their own courses?
Thanks Kathryn. That is exactly the change I was looking for.
I haven't heard of local customizations before, but it looks great. We have small changes scattered throughout Moodle and consolidating some or all to a /local folder would be great. Is this working as part of the current Moodle release?
I haven't heard of local customizations before, but it looks great. We have small changes scattered throughout Moodle and consolidating some or all to a /local folder would be great. Is this working as part of the current Moodle release?
Re: How to make users can only see their own courses?
Hi Kathryn,
I am not sure about the change I need to do.
Need I to substitute all this piece of code:
$categories = get_categories("0"); // Parent = 0 ie top-level categories only
if ($categories) { //Check we have categories if (count($categories) > 1 || (count($categories) == 1 && count_records('course') >
with this one?
//if ($categories) { //Check we have categories. Commented out.
if (isadmin()) { //Only show categories if admin.Added.
Please let me know
Many thanks
Monia
I am not sure about the change I need to do.
Need I to substitute all this piece of code:
$categories = get_categories("0"); // Parent = 0 ie top-level categories only
if ($categories) { //Check we have categories if (count($categories) > 1 || (count($categories) == 1 && count_records('course') >
with this one?
//if ($categories) { //Check we have categories. Commented out.
if (isadmin()) { //Only show categories if admin.Added.
Please let me know
Many thanks
Monia
Re: How to make users can only see their own courses?
I have a client that wants the course list to be in chronological order from most recent to oldest. Is this possible to achieve??
Re: How to make users can only see their own courses?
There is another block "my courses" availiable here:
http://moodle.org/mod/data/view.php?d=13&rid=2178
This block shows all courses the user is enrolled ins, but sorted in a collapsable course category tree. To both users not enrolled and admins this block is not shown.
This block might be an alternative.
http://moodle.org/mod/data/view.php?d=13&rid=2178
This block shows all courses the user is enrolled ins, but sorted in a collapsable course category tree. To both users not enrolled and admins this block is not shown.
This block might be an alternative.
Re: How to make users can only see their own courses?
That block does not work with Moodle 2.2, unfortunately.