General help

 
 
Picture of Robert Weeks
Hiding courses and categories to unenrolled users
 
Hi everyone,

I'm just setting up my Moodle site and I am having problems.

We are a business user, and our site will cover educating resellers how to use our products (so they can go on to sell them and demonstrate them themselves), and it will also host our staff training for new starters.

To just make it a little more complicated, we have more than one type of reseller, and each will have their own courses that they need to complete.

Therefore I will have several types of user:

Staff members
Reseller group 1
Reseller group 2

(I hope you're with me so far!)

Ideally, I need to hide the categories and courses that users are not enrolled in. For example, I don't want the reseller groups viewing the categories or courses for our staff members.

I've already mastered enrolling users by uploading a CSV file, but I have not mastered the fine art of making categories and courses viewable only if users are enrolled in them.

If anyone could help me I'd be grateful as I'm going around in circles at the moment!
 
Average of ratings: -
Picture of Rahmat Costas
Re: Hiding courses and categories to unenrolled users
 

Hi There,

Has anyone found a resolution for this? We have various categories and courses within these categories and we need to be able to hide courses and categories to unenrolled users. That is, only enroll students should see the category and only those courses within that category that they are enrolled in. If they are not enroll in any courses within that category, they should not see the overall category at all.

Any assistance is appreciated. Thanks.

Rahmat.

 
Average of ratings: -
Head
Re: Hiding courses and categories to unenrolled users
Group Particularly helpful MoodlersGroup Testers
You can allow visible courses within hidden categories, then remove the "all courses" link from the course menu and password protect every course...
 
Average of ratings: -
Picture of Dean DiMonte
Re: Hiding courses and categories to unenrolled users
 

can you tell me how to do that?

 
Average of ratings: -
Picture of Ramakant Sawant
Re: Hiding courses and categories to unenrolled users
 

Has anyone found solution for this request. Our team is also looking out for same help.

 
Average of ratings: -
Picture of Jaimie Wilson
Re: Hiding courses and categories to unenrolled users
 

I, too, have run into visibility problems. I have three different user groups that need to operate independantly from each other and their activity and courses must remain invisible to the other user groups. To accomplish this, I used FlexPage (a Moodle course format) to develop three separate landing pages, one for each group. I removed the Courses and Course Category listings from the Front Page of our site (a simple adjustment in your Front Page settings) so that users could not see them prior to logging in. I then set up a Profile Redirect block on the Front Page, so that upon login, each user group would be funneled to their own landing page or learning portal. I keep my course categories hidden (this is accomplished under Add/Edit Courses) and I remove the course category from the breadcrumbs so that students can't click on it and access the complete list of courses. This is another simple settings adjustment. I do not hide the courses themselves, as this will not allow students to access them.\

Within each course, I do not use a Course Menu block, as this will reveal courses that I don't want certain users to see. Instead, I use the Courses Available To You block, which you can configure to your visibility needs. This will allow you to present your users with a list of their available courses that also functions as a navigation tool (the course names function as links). With this block, you can reveal only the courses that the user is enrolled in and many other options. Check it out.

I know this has been a very quick and dirty explanation, and not in great enough detail, but maybe it will point you in the right direction. If you have questions, just let me know. Peace!

 
Average of ratings: -
Picture of Richard Barnes
Re: Hiding courses and categories to unenrolled users
 

I am intrigued by your solution. However, I cannot find a Courses Available To You block. Can you tell me where it is found? Thanks.

 
Average of ratings: -
Gmads
Re: Hiding courses and categories to unenrolled users
 
Average of ratings: -
Picture of Gisela Salgado
Re: Hiding courses and categories to unenrolled users
 

Hi Jaimie. I'm trying to follow all your instructions but I have problems finding the blocks you mentioned. I've already installed flex page, but cannot find the site where I can download the other 2 blocks (profile redirect and courses available). The only stuff I've found are manuals. Can you help me aout with this? Please?...

 
Average of ratings: -
Picture of marina g
Re: Hiding courses and categories to unenrolled users
 

Hi guys, I'm having the same issue, we are using Moodle 2.4.6, and we have students that enroll on a course, but then they are able to see all the other courses that they are NOT enrolled in. How do i hide those courses from them?

PS: am 100% new to moodle

Thanks

M

 
Average of ratings: -
Picture of marina g
Re: Hiding courses and categories to unenrolled users
 

BTW: i think i have tried everything, spent 2 hours playing around with the settings, hiding courses, changing permissions, all to no avail.. please HELP

 
Average of ratings: -
no me
Re: Hiding courses and categories to unenrolled users
 

This tweek is for Moodle 2.6 and may work with 2.x

In my moodle units are displayed as 'Combo list'. So if you have a different setting you might have to adapt the code.

Script file to edit course/renderer.php

To hide units that users have no access to

This bit is easy and straightforward. You simply have to add a line of code

in function coursecat_courses(...)

    in foreach ($courses as $course) {

         if($course->can_access()) // add this line
                $content .= $this->coursecat_coursebox($chelper, $course, $classes); // just before this line

 

To hide categories with no accessable units

This part is a bit tricky. The function coursecat_category_content() returns HTML code that is placed under each category. What I look for here is if there is any units in that block. Each unit is wrapped in a div tag with a class 'coursebox'. So we search for this and if found concludes that this category has units and hence display it. The code is added in 3 parts of the function.

in function coursecat_category(...)
$hidecat = false; // add this in the beginning
.
.
.
// load category content
$categorycontent = $this->coursecat_category_content($chelper, $coursecat, $depth); // under this line
if(strpos($categorycontent,'coursebox')===false) // add this two lines
     $dol_hidecat = true; // and this line too
.
.
.
if($dol_hidecat)  // just before the return an the end of the function, add this two lines
    $content = '';
return $content;

 

 
Average of ratings: -
Picture of Mark Hardwick
Re: Hiding courses and categories to unenrolled users
 

We went rounds with one a couple of years ago and I haven't heard any solution yet but I haven't dug into it lately.

Based on our situation we just "hide" the courses except the ones thet are active at the time but it sounds like you need many courses active for different groups at the same time.  I know we did a couple of things to help.  I can't remember where it was but our students only see what they are enrolled in as long as they have an active course.  When they go inactive is when they can see everything and that's where we hide the inactive courses.  But I see that you can't do that.

If this is what you are running into (seeing all of the courses once they are not currently in a active course), here's what we did for a while as a work-a-round.  

We created a course called "Sorry, You are not Currently Enrolled in a Course".  Then we enrolled them as their regular course expired and when they logged in that's what they saw.  If they clicked on it there was nothing there but as far as Moodle goes, they were enrolled in a course and didn't see all of the courses.  I don't know why Moodle shows everything if they are not enrolled in a course but they can log in.

If they are seeing every course while they are enrolled in a active course, then you can fix that.  If so, just re-post and I'll dig around to see what we did to fix that part.

For sure... our students only see the courses they are enrolled in IF they are in an active course.

Mark 

 
Average of ratings: -