interactive book not saving or reporting attempts

Re: interactive book not saving or reporting attempts

by Steve Bilton -
Number of replies: 2

Hi Joanne,

You can fix this issue by make a small change to 1 file within Moodle (depending on your version).

I'm using 3.9.1 and this fix works for me:

Find this file in your Moodle installation: Moodle/h5p/classes.player.php

Go to line 349 and find this bit of code:

private function get_assets(): array {
        // Get core assets.
        $settings = helper::get_core_assets();
        // Added here because in the helper we don't have the h5p content id.
        $settings['moodleLibraryPaths'] = $this->core->get_dependency_roots($this->h5pid);
        // Add also the Moodle component where the results will be tracked.
        $settings['moodleComponent'] = $this->component;

        $cid = $this->get_cid();

Replace it with this code, although you only need to insert the code in bold text:

private function get_assets(): array {
        // Get core assets.
        $settings = helper::get_core_assets();
        // Added here because in the helper we don't have the h5p content id.
        $settings['moodleLibraryPaths'] = $this->core->get_dependency_roots($this->h5pid);
        // Add also the Moodle component where the results will be tracked.
        $settings['moodleComponent'] = $this->component;
        // SB Edited 21-10-2020 - No submit button existed for Interactive Book, below code fixes missing submit button on summary page
        if (!empty($settings['moodleComponent'])) {
                    $settings['reportingIsEnabled'] = true;
            }    // End of fix 21-10-2020   


        $cid = $this->get_cid();

Save the file, go back to your Moodle and refresh the Interactive Book. Complete a question or interaction and go to the submit and summary page. You'll now see a green submit button.

Clicking it then submits the grade to Moodle gradebook and records the users attempt history.

So this tiny bit of code should fix the issue for you and everyone else.

Note: The fix has been implemented in the most recent Moodle versions for download as far as I know. This means when upgrading Moodle there will be no issue and Interactive Book will continue to work with the submit button available. This fix will help as  there is no need for a major upgrade or full Moodle instance replacement.

Hope that helps!

Steve

In reply to Steve Bilton

Re: interactive book not saving or reporting attempts

by Brigitte Denton -
Thank you for this patch. I have inputted the code as directed without success. I am running Moodle 3.9.1 and won't have time to upgrade to 3.10 likely for another month. I have tested using both my student test account and admin account, in Chrome and Edge browsers. I also changed themes to rule out a theme conflict.

I do have mod_hvp 1.21.0 installed. Could this be contributing to the problem?

Is there a setting somewhere that I might be missing?

Thank you in advance for your help!
In reply to Brigitte Denton

Re: interactive book not saving or reporting attempts

by Mia Musolino -
The issue was fixed in 3.9.3. We have upgraded and it’s now working. I didn’t try the separate patch.