Just created a very simple block that displays the child courses for a Meta course.
Here's the page for the block in the Modules and plugins DB:
http://moodle.org/mod/data/view.php?d=13&rid=1723
Enjoy,
MartyJust created a very simple block that displays the child courses for a Meta course.
Here's the page for the block in the Modules and plugins DB:
http://moodle.org/mod/data/view.php?d=13&rid=1723
Enjoy,
MartyHi Marty,
This might not be the most appropriate place to ask but it relates to the use of child courses. We would like to use child courses that are accessed from within the Meta course as your block operates but is there a way to hide the child courses in the list of available courses to students when they login. So what we are aiming to do is only show for example a top level English course that students login to and through this course they see access to individual child English modules but this would be the only point of entry so the top level English course acts as a kind of portal.
Hope you can help and that this isn't too far off the point of your block.
Thanks
John
Hi Marty,
Thanks for your suggestion I can see that it works for Moodle installations that are allowing students to access their courses by working through the categories but unfortunately we are trying to set up our installation so that students only see a list of courses they are enrolled on, once logged in. So we use the 'List of courses' option in the Front page settings and this unfortunately displays courses that are open in hidden categoires. We are going down this path as a way of keeping it simple for students to login and only see their own courses because we intend to handle all enrollment on courses behind the scences by integrating Moodle with our other systems.
It is early days with our use of Moodle, which is still really in a trial stage so your suggestion has given us a decision about how we best let students access their courses. Unless anyone knows of a way to hide courses in this 'List of courses' view and still have them accessible to students.
Thanks again for your help
John
Thanks Marty, Thats exactly what we would like to do and this has provided me with a useful workaround. I take it from the code that all individual courses that don't have child courses attached would still need to be assigned meta course status in order to be displayed in the course list. I'm guessing this doesn't have any impact anywhere else it is just a setting to apply on setting up each course.
Thanks for your help and access to the test area to see it in practice.
Cheers
John
Hi Marty,
Thanks for the tips on how we can hide our child courses. It is important to know this is possible and I will explore these avenues in more detail in the coming months as we develop our new Moodle installation.
Thanks
John
Hi Matt,
Welcome to the Moodle community. Don't worry, we're a friendly bunch, honest!
It is very easy to modify the above hack to display only normal/child courses and hide metacourses. Follow the steps above, but during steps 2 and 3 and remove the "!" from the line of code, e.g.
if ($course->metacourse) {
continue;
}
instead of:
if (!$course->metacourse) {
continue;
}
Also, during step 1, make sure you make the addition to the correct section of code, as there are two very similar snippets in the page. The one you're looking for is within the function called get_my_courses.
Please bear in mind that the metacourses will still show on the "all courses" listings page and the "my moodle" page, see following example URLs:
http://www.mymoodlesite.com/course/index.php
http://www.mymoodlesite.com/my
However, I'm pretty sure these pages could be easily hacked too.
Give me a shout if you need help with this hack.
Hope this helps,
Marty
P.S. To see this hack in action, login to moodle.martyjacobs.net with the username 'megaman' and the password c4Pc0m*!. As before, I may reverse the hack soon, so take a look asap!
I didn't initially notice how old your original post was Matt, sorry for not replying sooner!
Your metacourse model works well, I've created some demo courses on my site so that you can see how this would work:
http://moodle.martyjacobs.net/course/view.php?id=34
Use the username and password mentioned in my last post (see above).
All the best,
Marty
Hi Marty,
I am very interested in hiding the meta courses. I juts need to know what file (PHP) I need to make this modification to. Is it in all of the three files you mentioned above?
Thanks for your help.
Rahmat.
Hi Marty
Thank you very much for this block! it is very useful, we use it for a library-scenrio:
courses are related to a metacourse, called "Mediathek" and we named your block "Kontext": it shows the link
to the library and back:
in the course <-------------->
in the Library or "Mediathek"
What happens is: a user that is entering the library, sees a link also to our test-course (which is also a child of the library).
But this link should not be visible for a "normal" user because, she/he can't enter our test course (and will get such a message, after clicking the link).
Therefore our Question: could the Links to the Child-Courses in the Related_courses Block be visible under the condition that the user has the capability/is allowed to see the child course,
because it is frustrating the user, clicking the link and then she/he gets obviously the message : not allowed to enter this course.
thank you from switzerland
I installed “Related Courses Block” plugin on Moodle 1.9.9.
But I cannot see the “Related Courses Block” option in the “add block” list box.
What should I check?
Thanks very much
Domenico
Hi Dominco
have you defined a meta course for the course you want to test the block with?
after that the block should be in the list
andy
Is the related courses block available for Moodle 2.1?
Hi
I'm using Moodle 1.9.7.
Is it possible to hide, or otherwise, prevent the display of courses on the Related Courses block, whose availability in course settings is selected as This course is not available to students?
Thanks
Russell
Moodle 2.1 handles meta courses as an enrolment type so the original version of the block no longer works.
Attached is a modified version that queries the enrolment table to identify meta courses attached as a parent or child to the current course.
It is worth nothing that a course can now be both a mata course and have metacourses attached to it (so it is in both parent and child relationships) so this modified block will display both although it does not identify which are which.
I hope this is of some assistance. I forgot to include a readme so just extract the archive into the blocks directory and it should get picked up.
Hi Matt
Thanks for the information – I'll let you know how the modified block works.
Russell
Just to clarify Matt Elvey's version is for Moodle 2.1+
Ahhhh! OK – thanks for that Adam – guess I'll have to wait until we move to Moodle 2.1.
HI, Matt
Your Provided Related_Course_BLock is not Working in Moodle 2.0 version
Hi Jaymin,
I developed and tested the block on moodle 2.1 so I am not sure that it will work on 2.0.
Unfortunately I am not in a position to test/develop the plugin for 2.0 and can only recommend upgrading to 2.1. If it still does not work in 2.1 please enable full debugging and post the log file in order that I might see where it is failing.
Also any details on what is actually happening would be helpful. I suspect the most lilely scenario is that the page fails to render (you get a blank page) but the more deatils you can provide the better.
Thanks for reply Matt Now I am redevelop Child Course Block and if i have any query asking you.
Hi Matt,
Thanks for putting this togther, really helpfull. I've added an ascending sort on the resulting list of courses. Updated version on github https://github.com/nathanfriend/related-courses
Cheers,
Nathan.