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

Content not showing in moodle mobile app #483

Open
mjencabh opened this issue Feb 9, 2023 · 2 comments
Open

Content not showing in moodle mobile app #483

mjencabh opened this issue Feb 9, 2023 · 2 comments

Comments

@mjencabh
Copy link

mjencabh commented Feb 9, 2023

Im having an issue where the content of H5P is not showing on the moodle app.
Works fine in mobile browsers.

Im getting either a login promt in an embedded frame (not working even if signed) or a H5P picure with the text You do not have access to the content. Try to login.

Im using moodle core 4.1.1+

@abias
Copy link

abias commented Dec 11, 2023

I would like to note that we encounter the same issue on a customer's Moodle 4.1.6 instance with mod_hvp in version 2023052600 and the latest iOS App for Moodle.
The Moodle instance has forcelogin = 1 and allowframembedding = 1 set if this information is of any help.

I did some initial investigation and saw that mod_hvp uses a custom embedding mechanism for showing content in the app - see https://github.com/h5p/moodle-mod_hvp/blob/stable/templates/mobile_view_page.mustache.
But apparently, this custom embedding mechanism fails for us on https://github.com/h5p/moodle-mod_hvp/blob/stable/embed.php#L53 where the code ends up in the catch branch with the result that the app is not allowed to download the H5P content.
If I disable debugging in the Mobile App, it shows the login screen instead of the H5P content.
And if I enable debugging in the Mobile App, I see the embedloginfailed error string in the app.

I would assume that this is a misconfiguration in our setup, but it could also be a bug in mod_hvp.

The customer is currently recommending his users to use H5P content in the browser, but I would appreciate any advice how to get H5P working in the Mobile App properly.

@eloquenza
Copy link

This isn't a misconfiguration in your setup, this is a bug in mod_hvp.

This is the original issue: #424
This is the corresponding PR that fixes it: #425

The PR itself works, I have patched the H5P plugin at Hochschule Hannover and tested it. You might however need to change your server configuration, depending on your CSPs. The 'frame-ancestors' directive needs to be changed, as the app is not the same origin as your configured Moodle host.

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

No branches or pull requests

3 participants