customize h5p on Moodle


Hi, I want to customize "branching scenario" plugin on Moodle. The only resource I found online is:

So I tried to test this example on my computer but I failed.

I download the whole folder and put it under my local theme folder. (I make sure the name is same as the defined name in config.php)

Then, I modify the public function hvp_alter_styles(&$styles, $libraries, $embedType) function in h5p/output/render.php as:

    public function hvp_alter_styles(&$styles, $libraries, $embedType) {

        global $CFG;


        if ($embedType === 'editor') {


            $styles[] = (object) array(

                'path'    => $CFG->httpswwwroot . '/theme/h5pmod/style/custom.css',

                'version' => '?ver=0.0.1'