Course Presentation - Moodle Activity Completion

Hey guys,

Sorry if this is the wrong place to post this (given that it's Moodle related), but we think it would be very useful if we could adjust the lesson completion for the Course Presentation activity. At the moment it's marked as complete if the user reaches the summary slide at the end. This is problematic though because what if we don't have a summary slide in the presentation? or if the user just skips right through to the summary slide without reading any of the content?

It's possible to hide the summary slide, or to use Active Surface mode so that the user can't use the navigation bar to skip to the end, but in both of these cases the activity is never marked as complete as a result.

What would be ideal here is if it was possible to mark the activity as complete, only if the user has viewed every slide in the presentation.


Course presentation activity completion improvements
Supporter votes Members of the Supporter Network can vote for feature requests. When the supporter network has generated sufficient funding for the top voted feature request it will normally be implemented and released. More about the H5P Supporter Network
BV52's picture

Hi Matt,

Thanks a lot for contributing your ideas on how to make H5P better! We’re now working on something called the H5P supporter program allowing the H5P community to vote for and fund the top voted H5P features. Also there are developers in the community who every now and then works on a feature they find interesting or useful.


Thanks for the response! I'd be interested in working on this myself but I'm struggling with how to do this for Moodle. I can see there's development documentation for H5P, but I can't find anything related to developing on Moodle. I've had a quick look on the file system of our Moodle instance and while I can see the H5P Moodle plugin code, I can't actually find any of the activity code, like the course presentation.

Sorry, I'm really new to H5P, but if you know of any Moodle specific developer documentation I'd appreciate it if you could point me in the right direction :-)


Hi there, I looked at this post with interest as we would also like to complete a Course Presentation in Moodle based on slides viewed. I was wondering if you made any progress on this topic. My concerns would be:

a. Is the code suitable to add to Moodle and where?
b. Is it a hack to H5P or Moodle?
c. Moodle does not support a completion criterium 'Complete when all slides are viewed' or did you find a workaround for that?

Any help would be appreciated!

Peter Jonker

icc's picture

Hi Matt,

You should be able to achieve this by just adding some extra code to your site, e.g. if you have a custom JavaScript file in your theme or similar. As an example, go to a page where you have a Course Presentation, open the browser's console(Ctrl+Shit+J in Chrome) and enter the following code:

var slidesViewed = []; for (var cid in H5PIntegration.contents) break; var content = JSON.parse(H5PIntegration.contents[cid].jsonContent); H5P.externalDispatcher.on('xAPI', function (e) { if (['en-US'] === 'progressed') { let slide =['']; if (slidesViewed.indexOf(slide) === -1) { slidesViewed.push(slide); if (slidesViewed.length === content.presentation.slides.length) console.log('All slides have been viewed!'); else console.log('Viewed ' + slidesViewed.length + ' of ' + content.presentation.slides.length + ' slides.' );} }});

Now, try to go through the slides as you observe the console.

You should be able to use something similar to this for your custom JavaScript file.