Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "Send report" button disappears in the BOOK #134

Closed
getcher123 opened this issue May 12, 2023 · 6 comments
Closed

The "Send report" button disappears in the BOOK #134

getcher123 opened this issue May 12, 2023 · 6 comments
Labels

Comments

@getcher123
Copy link

When viewing a book through h5p-standalone, the "Submit Report" button on the last screen disappears, which sends the results.
Screenshot_1
Screenshot_3

@0xMurage
Copy link
Collaborator

@getcher123 I didn't quite understand the problem.

Is the button missing altogether or the button disappears after results submission?

@getcher123
Copy link
Author

The button is missing altogether. On the first screen I showed the button on h5p.com.

@getcher123
Copy link
Author

@murageyun you could test this on https://3dfarm.ru/course

@0xMurage
Copy link
Collaborator

0xMurage commented May 15, 2023

I have seen the problem. The button has to be enabled via configuration which is not clearly documented here https://github.com/h5p/h5p-interactive-book/blob/786c11ca05bf10bfeddac345cecc1967f0a1171a/src/scripts/app.js#L58-L63

Here is a workaround until a fix is created,

const el = document.getElementById('h5p-container');
const options = {
    h5pJsonPath: '/workspace/berries-28-441940',
    frameJs: 'https://unpkg.com/h5p-standalone/dist/frame.bundle.js',
    frameCss: 'https://unpkg.com/h5p-standalone/dist/styles/h5p.css',
    metadata: {
        title: "Book title here",
        license: "CC-BY-SA"
    },

    preventH5PInit: true //prevent h5p player from initialization
}

new H5PStandalone.H5P(el, options)
    .then(() => {
        H5PIntegration.reportingIsEnabled = true; //this is the trick
        H5P.init(); //initialize the h5p player
    })

            

Summary of the fix:

  • we are preventing the H5P player from initializing automatically (preventH5PInit: true)
  • enabling the button
  • doing the H5P player initialization explicitly

@getcher123
Copy link
Author

Thank you, this method works!

@0xMurage
Copy link
Collaborator

0xMurage commented Jan 3, 2025

fixed by #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants