What happens: The error message "This file can't be displayed because it has been uploaded by a user without the required capability to deploy H5P content." is shown when you add a H5P activity and access it with role "student", without accessing it as teacher first.
This only occurs when switching the role to "student" as e.g. teacher. When you log in as student the H5P activity is displayed correctly without error message.
What is expected: The H5P activity should be shown without accessing it as teacher first. Teachers test with the role "student" a lot and because of the error message, they believe that the H5P activity is not working.
Reproduction steps (tested on https://school.moodledemo.net/ and our local instance):
- As a teacher (editing teacher) - here is is important not to be admin so to see the error.
- Add a new H5P activity
- Give the activity any name and select a H5P package file (tested with Interactive video, memory game and dialog cards).
- Save the H5P activity with "Save and return to course"
- Switch role to "student"
- Access the H5P activity and you get the error message "This file can't be displayed because it has been uploaded by a user without the required capability to deploy H5P content." If neither the H5P activity or the error message is being displayed, go back to the course and access it again.
- Go back to the course
- Return to normal role
- Access the H5P activity
- Go back to the course
- Switch role to "student"
- Access the H5P activity. No error message is being displayed and the H5P activity also works correctly.