True/False question's dependency on Video 1.3
Starting a new thread for this particular problem. I am making the .Net implementation (this thread https://h5p.org/node/87316) and am now expanding the content types supported. I am trying to create an instance of the True/False question with a video file attached. The editor works just fine with the current implementation, but when trying to view the content, it fails since the reference to the H5P.Video-1.3 is missing. This reference is not mentioned anywhere in the preload dependencies of the content type? Is this a bug? Neither is H5P.Image which is the other attachable media type.
I did find that the content.json file produced has a media.library property which references the video content type, but how is this supposed to be detected? Is there a described standard by which these additional resources can be identified? Any documentation, or at least a pointer to the php code where this is done?
There also doesn't seem to be anything in the .js files for H5P.TrueFalse-1.2 which would dynamically request these additional dependencies, so they should be included in the cache package?
MiikaLangille
Wed, 05/09/2018 - 08:34
Permalink
It would appear that when
It would appear that when creating the .js and .css cache files, you need to scan the content.json file for any property named library and add the library named in it to the dependencies. I assume this is done so you don't load up dependencies unnecessarily, however it does feel a bit obfuscated and unintuitive. Especially as these library attributes can be found within all kinds of properties. What if the system doesn't even have that library saved to it, since it wasn't listed in the dependencies?
Anyway, managed to solve my problem, so moving on. The code for finding these content dependencies is listed below, in case someone else needs it. Written in C#.
BV52
Wed, 05/09/2018 - 09:01
Permalink
Hi MiikaLangille,Thank you
Hi MiikaLangille,
Thank you for the information and I'm sorry the core team is taking some time answering posts. There is a big push to get H5P.com released before summer.
-BV52
MiikaLangille
Wed, 05/09/2018 - 09:23
Permalink
Hi BV52,Not a problem at all.
Hi BV52,
Not a problem at all. Was able to solve this particular problem by myself. Just posting them publicly in case they might help others who are making their own implementations or integrations.
otacke
Tue, 05/15/2018 - 09:51
Permalink
Hi Miika!Just to wrap it up:
Hi Miika!
Just to wrap it up: There are library dependencies that are crucial for H5P content or its editor to work. Those are listed in library.json.
Furthermore, there are dependencies that are optional/their necessity depends on the choice of the content author. when editing. Those are loaded dynamically as needed, but can be identified in advance by looking at the fields that have the type library. These will also have a field called options that may contain further dependencies that are not loaded yet -- and may have additional dependencies themselves.
For example, the editor of True-False-Question will always need the RadioGroup Widget for the answer, that's found in library.json. A True-False-Question can also have an optional image or video above of the question that can be set in the editor and is defined in semantics.json by
This will only load as needed, and that's why you have to wait briefly when you optionally want to set an image or a video in the editor.
I hope that was clear enough?
Best,
Oliver