Communication with Moodle Gradebook

Forums: 

Hi Guys,

I started to create a own Content-Type with H5P and now i want that this one can store data into the Moodle gradebook. So like the normal multiple choice questions store the result of the students in the Gradebook. But I don't know how the communication between H5P and the Gradebook API from moodle works.

Can somebody help me?

 

Cheers landa

BV52's picture

Hi Landa,

Welcome to H5P!

 

H5P emits data in the form of xAPI statements and you will need a plugin or custom code to listen to these statements and a data store such as a learning record store to save them in. Furthermore the H5P contents that are included in courses has a built in code that sends the scores to the Moodle's Gradebook.

 

I highly recommend looking through these documentation:

 

https://h5p.org/documentation/x-api

https://h5p.org/documentation/for-authors/analyzing-results-and-answers

 

-BV52

Hi BV52,

thank you for helping me. Do you know where the "built in code" that sends the scores to the Moodle's Gradebook is located?
best regards

Landa

tim's picture

Hi Landa, 

H5P is completely open source and all our code is hosted under the H5P organization on Github:
https://github.com/h5p

Here's the code for the Moodle plugin:
https://github.com/h5p/h5p-moodle-plugin

And more specifically, here's the code that connects to the gradebook:
https://github.com/h5p/h5p-moodle-plugin/blob/f0c79aaa4e431ce6ef707cf6fb45508bdee351e7/classes/user_grades.php#L77

So, Moodle reads and register H5P results through GradeBook. :)