Display hidden courses under My Courses on top menu

Display hidden courses under My Courses on top menu

Craig Stewart -
回帖数:7

We have a few courses that we keep hidden so only our instructors can see them. Don't want them visible to candidates / students. This all works fine apart for our instructors don't see these courses under the My Courses tab on the top menu. They have to scroll down the the navigation block on the left and click on my courses there to see them listed in the course overview block.

Is it possible to display the hidden courses in the drop down menu? Would be so much easier for the instructors to navigate to these hidden courses.

 

I am using the latest essential theme.

 

Below is an screenshot of a list of courses with 2 of them being hidden showing in the Course Overview block after clicking on My Courses on the left hand navigation block.

 

And this is what I see when clicking on the My Courses menu item at the top of the page. As you will see the hidden courses don't show here.

my courses

回复Craig Stewart

Re: Display hidden courses under My Courses on top menu

Mary Evans -

If your Instructors have Teacher status then when they login and go to the 'My home' link they should see all the course they are enrolled in, the URL would be something like http://sitename.com/moodle/my

Can they not Bookmark that page in their browser?  Or has no one thought of that?

Cheers

Mary

回复Mary Evans

Re: Display hidden courses under My Courses on top menu

Craig Stewart -

Hi Mary,

Thanks for the reply. The reason I am trying to achieve this is to make it as easy for the instructor as possible. Majority of them are not very computer literate. We manually register each one on the course and supply them with log in details. We have had feedback from some of them already that they have logged in but cannot see any of the courses and ask to be added even though they have. Due to the content on our home page the navigation block is not easily identified and they don't think to scroll down to find it. They just click on the My Courses link on the menu and expect it to all be there.

Bookmarking no use as they can't find the page in the first place. Spending a lot of time having to reply to all the emails so thought it would be better to try and find a solution.

I have now added a custom menu item called My Home which takes you to the My Home page with all the courses listed but ideally I want them to all appear under the My Courses link if possible.

Cheers,

Craig

回复Craig Stewart

Re: Display hidden courses under My Courses on top menu

Gareth J Barnard -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

I think its a matter of working out how this line: https://github.com/moodleman/moodle-theme_essential/blob/master/renderers/core_renderer.php#L115 - gets the list of courses and changing it to return hidden ones if the user is enrolled in them.  Perhaps discover the code that the navigation tree menu uses and adapt that.

回复Gareth J Barnard

Re: Display hidden courses under My Courses on top menu

Craig Stewart -

Hi Gareth,

Thanks for your reply. This is what I was looking for but wasn't sure where to find it. Will look into this further when I get a chance.

 

cheers,

Craig

回复Craig Stewart

Re: Display hidden courses under My Courses on top menu

Kimberly King -

Our college would love this feature as well.  Please share your results if you find a fix.

回复Kimberly King

Re: Display hidden courses under My Courses on top menu

Julian Ridden -

Line 117 on the file Gareth pointed to adds a check to see if the course is visible and only then adds it to the dropdown

if ($course->visible){
      $branch->add(format_string($course->fullname),newmoodle_url('/course/view.php?id='.$course->id),format_string($course->shortname));
}
 
Removing that if statement (and it's closing } ) will remove the check and show courses enrolled regardless of if they are hidden or not.
 
I won't be making this change in core however. Most organisations Hide courses o make them not available. That is one of their core purposes. This would cause grief for many.
 
Julian
回复Julian Ridden

Re: Display hidden courses under My Courses on top menu

Craig Stewart -

Julian,

Thank you very much for providing this information. Exactly what I was looking for.

I understand you not making a change to the core as this change is specific to something I am trying to do with Moodle that isn't the norm.

Much appreciated.

Craig