Activities ::: mod_subcourse
Maintained by David Mudrák
Subcourse behaves as a graded activity. The grade for each student is automatically fetched from a final grade in another course. This allows course designers to organize the learning content into separate units.
Latest release:
2286 sites
122 fans

Moodle Plugin CI

Subcourse is an activity module that represents the final grade obtained in another course. This allows to create "meta-gradebook" in one course, where all final grades from other courses are aggregated.

  • Grades are fetched automatically or can be fetched manually any time.
  • The grade type and other grade item settings are copied from the original grade total item and can not be changed.
  • Subcourse can be automatically marked as a completed when the referenced course is completed.
  • If the final grade in the referenced course is hidden, the associated subcourse activity grade is hidden, too.

This allows to apply the concept of grades aggregation to a next level and aggregate grades across courses.

Diagram illustrating course final grades aggregated to a main course via the Subcourse instances


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6


David Mudrák (Lead maintainer)
Vadim Dvorovenko
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Fri, Jan 15, 2021, 12:18 AM

    Actually, this illustrates a likely bug in the Moodle / Plugins directory integration. The version number can get easily outdated, and it should not lead to cases like this. May I ask you to report it as a new issue at, project MDLSITE, component "" please. Thanks!

  • Fri, Jan 15, 2021, 11:59 PM
    Grrr, I posted it in the wrong Component : MDLNET ticket MDLNET 545. I don't see any way to either remove it or move it to the right project. I've to wait for a new post now.
  • Sat, Jan 16, 2021, 12:05 AM

    No worries, I was able to move it. Thank you for your report.

  • Wed, Feb 17, 2021, 5:43 PM
    Hi David,
    I'm not sure when did it happen but previously (Moodle 3.8, not sure about plugin version but the latest for Moodle 3.8) plugin allowed to set completion status for subcourse activity as "Require course completed - Student must complete the referenced course to complete this activity." without any "Expected completed on" date set. And it worked great for us as we do not need the date. Just the subcourse to be completed (according settings for course completion in appropriate subcourse).

    Now (Moodle 3.10, plugin 9.0.1) This setting is blocked/disabled until "Expect completed on" is enabled and set.
    Just wondering why is has been set like this and can it be enabled again without enabling completion date? We can't enable this date as students are coming and going randomly. We can't set one date for all of them.
  • Thu, Feb 18, 2021, 5:00 AM

    @Almants - sorry to hear about your troubles. However, I am not able to reproduce that problem. It still works as expected for me and I am able to enable "Student must complete the referenced course to complete this activity" without "Expected completed on". Maybe there are some other additional plugins installed on your site that are affecting this behaviour? Just guessing. I don't know why it should behave like that.

  • Fri, Apr 30, 2021, 1:48 PM
    Hello i m french guy, sorry for my ENglish. I use your plugins in my moodle and its the beginning what i want. I can pay you for continue to devellop this plugins.
    Several thing what i need for my LMS:
    -The possibility for the teacher to drag and drop the course columns in the note's table for easier reading.
    - The same things with the row
    - In the head of ths note's table to see the image's course
    - When the teacher clic on the note's student, he can see the détail of the note's course. "link"
    For my use the key of your plugins is the notes table.
    Thanks for your job. And i'm reday to pay your work for devellop more your plugins.
    Maybe we can change in MP.

  • Fri, Apr 30, 2021, 2:46 PM

    Hello David Gibert. Thank you for your comment and your offer. I must admit though I don't fully understand what you mean by that "note's table". May I ask you, let's move this conversation to the plugin's bug tracker (please find the link above at this page), report a new feature request there and ideally with some screenshots illustrating your use case. Thank you.

  • Mon, May 17, 2021, 5:21 PM
    Hi David,
    Thanks for your reply!
    Just by coincidence I found out, that it is some weird theme behavior. "Expected completion on" checkbox is disabling the input one row above, not same row date fields ... In subcourse plugin case it is "Require course completed". In SCORM case irt is "Require all scos to return completion status". Weird ...
  • Tue, Jun 29, 2021, 4:44 PM
    We use subcourse plugin 10.0.0 in Moodle 3.10.4. There is a loop with this error : forearch (invalid argument) on /moodle/mod/subcourse/locallib.php line 238

    We have more than 1200 groups. The loop takes about 20 ms but only with student profil.

    I modifie code to test if the value exist like this

    $gs = grade_grade::fetch_all(['itemid' => $gi->id]);
    if (is_array($gs))
    foreach ($gs as $g) {
    $values= null;//warning!!!
    if (isset($refgrades->grades[$g->userid])) {
    if ($refgrades->grades[$g->userid]>hidden != $g>hidden) {
    $g->grade_item = $gi;

    with this code, no more errors, the page is a little faster but not as fast as with the admin profile.

    Please can you tell me how to solve ?

    best regards
  • Thu, Aug 12, 2021, 4:25 AM
    Hi David:

    I am upgraded to Moodle 3.9, and I when I try to use Subcourse to fetch grades, I get this error message:

    Unable to fetch grades: error code 4

    More information about this error

    Any ideas on how to fix this?

    Thanks for your help!
  • Thu, Aug 12, 2021, 4:42 AM
    Hi David:

    To help troubleshoot, I am using subcourse to pull grades from hidden courses into a "main" portal course, where the subcourses serve as each unit.

    This is the beauty of Subcourse--you can build very large, complex courses, but keep them manageable since you can break apart your course into "subcourses", but to keep the student Dashboard from getting too messy, the subcourses are hidden and only the "Main" portal course shows up which then links out to each subcourse as well as aggregating the final grade.

    Thanks for your help and sharing your great work with the Moodle community!
  • Thu, Aug 12, 2021, 5:15 AM
    Hi David: I did more digging around and saw that this was an issue you had addressed, and apparently your latest version is to help teachers who want to keep hidden subcourses and grades hidden from students...makes sense!

    However, if you could create a tick box in the settings that would allow teachers to also be able to show hidden grades from hidden courses, then it would enable teachers to leverage the subcourse plugin as a way to link together many courses into a "main" or "master" course as the portal / launchpad into learning!

    I downgraded to the previous version, and everything works as before, but moving forwards maybe can this setting be added in?

    Thanks for all your help in the past, and also sharing your great work with the Moodle community!

  • Thu, Aug 12, 2021, 7:55 PM

    Thanks Joseph. May I ask you to summarise this as a feature request in the plugin issue tracker at

  • Mon, Oct 18, 2021, 2:13 PM
    Hello. Can this plugin restrict access to a course if the previous one is not passed?
1 2 3 4 5 6 7 8
Please login to post comments