111 Commits

Author SHA1 Message Date
Paul Holden
5255026717 MDL-71050 h5p: account for parent languages retrieving translations.
Take account of parent languages when requesting given library
translation. For example if we are currently using "de_kids" as the
current language, we need to recurse each language pack looking for
a matching H5P translation ("de_kids" -> "de_du" -> "de").
2021-07-12 13:17:02 +01:00
Sara Arjona
692abf2c46 MDL-71885 core_h5p: Display the edit content button
A new parameter has been added to the display method, to define whether
the edit button should be displayed or not.
The H5P activity will display this button (if the user has the required
permissions). However, it won't be displayed when previewing H5P in the
content bank.
2021-07-05 10:56:13 +02:00
Sara Arjona
86b06a7b9a MDL-71885 core_h5p: Add the form for editing content
The editor form is based on the code that Victor Deniz prepared
while he was working on the integration of the H5P editor into
Moodle. The original version of this file can be found in
MDL-67814.
2021-07-05 10:56:13 +02:00
Sara Arjona
13de79c66f MDL-71885 core_h5p: Add new methods to API 2021-07-05 10:56:13 +02:00
Rajneel Totaram
7596e27989 MDL-71343 core_h5p: Convert all line-endings to UNIX format 2021-05-01 00:12:52 +12:00
Andrew Nicols
c58e9a14ee Merge branch 'MDL-69415-master' of git://github.com/sarjona/moodle 2021-04-16 07:57:01 +01:00
Sara Arjona
39fa45e299 MDL-69331 core_contentbank: Hide disabled H5P content-types
If a H5P content-type is disabled:
- The content bank won't display existing contents having it as a
main library.
- The content bank won't allow to create new contents using it.
2021-04-15 09:16:32 +02:00
Sara Arjona
dbfd4aebb5 MDL-69331 core_h5p: Only upgrade enabled libraries
The core\task\h5p_get_content_types_task task will only download
content-type for enabled libraries.
2021-04-15 09:03:56 +02:00
Sara Arjona
5308ba0947 MDL-69331 core_h5p: Display error when main library is disabled
H5P contents with the main library disabled won't be deployed; a
message error will be displayed instead of.
2021-04-15 09:03:56 +02:00
Sara Arjona
d3d3b3bdc0 MDL-69331 core_h5p: Add enabled field to libraries
The "enabled" field has been added to the H5P libraries to let
admins decide whether a library should be used or not in the site.
2021-04-15 09:03:56 +02:00
Sara Arjona
51cdc0e874 MDL-69415 core_h5p: prepend H5P libraries in autoloader
Core and mod_hvp are using the same namespace for some H5P
libraries. This is causing some random errors.
In order to get the expected behaviour in Moodle core, this patch
prepends H5P libraries in order to guarantee they are loaded first.
Plugins using same libraries will need to use a different namespace
if they overlap and a different version of these libraries should
be used.
2021-03-22 12:39:16 +01:00
Ilya Tregubov
bcdf87a877 MDL-70009 h5pactivity: Split get_pluginfile_hash in two methods. 2021-01-12 09:10:24 +02:00
cescobedo
7caad99f99 MDL-70327 core_h5p: Add preventredirect to the player 2020-11-25 16:30:04 +01:00
Sara Arjona
d06da02935 Merge branch 'MDL-69736-master' of git://github.com/ferranrecio/moodle into master 2020-10-19 09:03:42 +02:00
Sara Arjona
6171c4bbe8 MDL-69520 core_h5p: add example and tutorial links 2020-10-14 17:47:46 +02:00
Ferran Recio
dd4a089b1c MDL-69736 core_h5p: enable player reporting 2020-10-06 13:02:45 +02:00
Amaia Anabitarte
46b9e12a27 MDL-69712 core_h5p: Remove 'whitelist' key uses 2020-10-05 10:27:48 +02:00
Sara Arjona
c68897b7e6 MDL-69087 core_h5p: add renderer to let personalize styles
Existing mod_hvp pluging has a renderer to let Moodle instances
alter styles, Javascript, semantics (fields in the editor) and
content: https://github.com/h5p/moodle-mod_hvp/blob/stable/renderer.php

The approach for core_h5p is exactly the same, to let people
to reuse their existing code.
2020-09-24 19:56:12 +02:00
Sara Arjona
67a11150de MDL-68909 h5p: move temporary editor files to draft area 2020-09-10 13:42:16 +02:00
Sara Arjona
f5b4ac4d2e MDL-69174 h5p: add component to the embed H5P code
When the Moodle component is passed to the player, xAPI tracking
is enabled so, if the component implements required xAPI API methods
(for instance, mod_h5pactivity does), grades and responses are sent.
Adding this component to the embed code will help to add
the embed code from a mod_h5pactivity to any other place (such as label,
page or book), and being able to track the responses to the original
mod_h5pactivity.
2020-08-28 12:25:51 +02:00
Victor Deniz Falcon
9aa9efbfda MDL-68921 core_h5p: Add H5P libraries metadata settings 2020-08-25 00:48:02 +01:00
Jordan Tomkinson
ef8dff0565 MDL-69207 core_h5p: Add muc cache support for h5p library files 2020-08-06 02:40:24 +01:00
Sara Arjona
982a9a5919 MDL-68985 core_h5p: fix issue with composed code languages
Composed code languages, such as 'Spanish, Mexican' are different
in H5P and Moodle:
- In H5P, they use '-' to separate the language from the country.
For instance: es-mx.
- However, in Moodle, they have '_' instead of '-'. For example: es_mx.
2020-06-09 14:38:27 +02:00
Ferran Recio
346c51690c MDL-68873 core_h5p: fix editor H5P file update 2020-06-08 10:44:23 +08:00
Adrian Greeve
8d20e3c688 Merge branch 'MDL-68922-master' of git://github.com/sarjona/moodle 2020-06-08 10:16:53 +08:00
Jake Dallimore
5c361ed9af Merge branch 'MDL-68917-master' of git://github.com/sarjona/moodle 2020-06-08 09:41:27 +08:00
Sara Arjona
4c2cdbe261 MDL-68922 core_h5p: upgrade content with newer libraries
The H5P editor always uses the latest libraries version.
Besides, H5P has a mechanism for upgrading content created
using older libraries. So, in order to be able to edit
existing content created with older libraries, we can assume
the library may change (for instance, from
"Course presentation 1.20" to "Course presentation 1.22")
because the $content->h5plibrary contains both (machinename and
major/minor version).
2020-06-05 09:17:06 +02:00
Sara Arjona
9df9251c96 MDL-68917 core_h5p: use the correct libraryUrl
The libraryUrl was empty (because ->out was missing)
and pointing to the wrong URL (because 'core' is not required,
because it's added by the method).
2020-06-04 14:28:05 +02:00
Víctor Déniz Falcón
96a4d3f309 Merge branch 'MDL-68641-master' of git://github.com/aanabit/moodle 2020-06-04 12:46:11 +01:00
Amaia Anabitarte
6157f5930f MDL-68641 core_h5p: Fixing capability checks in ajax.php 2020-06-04 13:44:23 +02:00
Víctor Déniz Falcón
0e6d73245b Merge branch 'MDL-68904-master' of git://github.com/sarjona/moodle 2020-06-03 16:59:43 +01:00
Sara Arjona
881dca064d MDL-68904 core_h5p: order libraries by title 2020-06-03 12:01:59 +02:00
Amaia Anabitarte
3149defec1 MDL-68578 contenttype_h5p: Save content title from uploaded H5P file 2020-06-02 16:17:22 +02:00
cescobedo
14b463c92a MDL-68448 core_h5p: Add get export information to helper
Create a new method in the helper to use in the player,
in the external WS and in the API. Also, add a
new method in API to help to get export information
by other WS.
2020-05-25 09:12:06 +02:00
Víctor Déniz Falcón
296ae78885 MDL-68636 core_contentbank: added method to get H5P id from pathnamehash 2020-05-15 11:35:08 +02:00
Víctor Déniz Falcón
6b37b6a1ba Merge branch 'MDL-68227-master' of git://github.com/sarjona/moodle 2020-05-13 17:13:11 +01:00
Andrew Nicols
0e809762d4 MDL-68697 core_h5p: Store missing translations as null 2020-05-13 16:35:41 +08:00
Sara Arjona
a42a9ad997 MDL-68227 core_h5p: localize H5P editor strings
H5P editor has a folder with all supported languages in JS files.
A mechanish has been added to let users to translate them using AMOS.
That's how the translations are managed (the order how they are processed):

- If there a JS file for a language, it's loaded.
- If a string has been translated in Moodle (they are placed in
h5plib_vXXX), it will override strings loaded from the JS file.
2020-05-12 16:39:42 +02:00
Sara Arjona
36a3a259de Merge branch 'MDL-68571-master' of git://github.com/cescobedo/moodle 2020-05-11 16:52:48 +02:00
cescobedo
444b2282f1 MDL-68571 core_h5p: Return default handler if no it has been defined 2020-05-11 16:46:27 +02:00
Jun Pataleta
d1735204c0 Merge branch 'MDL-63580-master' of git://github.com/cescobedo/moodle 2020-05-11 22:32:34 +08:00
cescobedo
db15746c2d MDL-63580 core_task: Deprecation cron_run_single_task and run_from_cli
Also we have move the functions in \tool_task\run_from_cli to \core\task\manager
and we have deprecated that class.
2020-05-11 10:53:23 +02:00
Sara Arjona
f635915137 MDL-68271 core_h5p: implement localization methods for editor
The following methods have been implemented for supporting
content-type translations:
- H5PEditorAjaxInterface.getTranslations. This method is used for
loading the "Text overrides and translations" section.
- H5peditorStorage.getLanguage. This method is used for displaying
the specific fields and messages for each content-type library.
- H5peditorStorage.getAvailableLanguages. This method is used to
get the language list displayed into the "Text overrides and
translations" section.
2020-05-08 18:18:24 +02:00
Sara Arjona
58f85a6c6e MDL-67795 contentbank: clean all the content when uninstalling plugin 2020-04-23 13:09:40 +02:00
Sara Arjona
153c45625d MDL-67795 h5p: move methods from player to helper 2020-04-23 13:09:40 +02:00
cescobedo
e84ce938d9 MDL-67095 core_h5p: Prevent synchronous access to save the same h5p
When deploying a new H5P resource we need to ensure that
we don't start deploying the same H5P in another thread
(e.g. for another session/user).
2020-04-17 09:14:18 +02:00
Sara Arjona
0a05ca3604 MDL-67788 h5p: fix issue for non logged-in users 2020-04-16 15:50:10 +02:00
Sara Arjona
2ac1d9aedf MDL-67814 h5p: recover missed xAPI settings 2020-04-16 09:36:05 +01:00
Víctor Déniz Falcón
eeb90e7e70 MDL-67814 core_h5p: added renderer and editor classes 2020-04-16 11:29:35 +08:00
Víctor Déniz Falcón
8c325d3feb MDL-67814 core_h5p: modifications to interact with the Hub selector
The HUB selector allows you to install/update H5P content types from
the H5P editor. We have moved these features to the Content Bank, so we
will not show the HUB selector in the H5P editor.
2020-04-16 11:29:35 +08:00