277 Commits

Author SHA1 Message Date
Sara Arjona
8e622fba87 MDL-71970 h5plib_v124: Add namespace to H5P core library
The joubel/core is a third-party library. A namespace has been added to
avoid collision with other plugins using it (such as mod_hvp).
That way, they will be able to have a different version without
side effects.
2021-09-27 11:41:48 +02:00
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
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Eloy Lafuente (stronk7)
9d6aa39985 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:11:07 +02:00
Eloy Lafuente (stronk7)
3a0397658e NOBUG: Fixed SVG browser compatibility 2021-05-07 16:54:23 +02:00
Eloy Lafuente (stronk7)
e9f457e3c3 Merge branch 'MDL-71343-master' of https://github.com/rjnl/moodle 2021-05-06 23:07:29 +02:00
Sara Arjona
4cb908690e MDL-71408 h5plib_v124: Add required changes after lib upgrade
- The mbstring extension is required since Moodle 3.9 onwards so
the upgrading steps have been removed because they are not
required any more.
- The pull-request for fixing some minor PHP7.4 problems has been
integrated so this patch is not required.
2021-05-04 17:23:11 +02:00
Sara Arjona
6a1e3c5c7e MDL-71408 h5plib_v124: Upgrade H5P core library to 1.24.02 2021-05-04 17:23:11 +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
4ff86720bf MDL-71343 core_h5p: Add unit test for helper::parse_js_array
Signed-off-by: Rajneel Totaram <rjnlfj@yahoo.com>
2021-05-01 00:09:40 +12:00
Mikel Martín
a2a41ae5e6 MDL-70903 mod_h5p: Fix PHP8.0 warning 2021-04-20 15:17:12 +02: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
Eloy Lafuente (stronk7)
9fd6ac7c9d MDL-71036 phpunit: xml config - switch coverage info to new includes
This applies the "whitelist" => "include" changes to all the core
phpunit_coverage_info occurrences, so core won't emit any deprecation
warning (see previous commit).

At the same time, modified a bunch of comments in coverage files
to be more readable/understandable.
2021-03-11 23:04:32 +01:00
Ferran Recio
f6a1a529a6 MDL-70806 h5p: fix resize glitch 2021-02-11 13:10:10 +01:00
Ferran Recio
bc8f4118ac MDL-70634 h5p: minimizing height glitch 2021-01-25 13:54:23 +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
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02: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
Jun Pataleta
8252b24f95 Merge branch 'MDL-69520-master' of git://github.com/sarjona/moodle 2020-10-15 13:53:26 +08:00
Eloy Lafuente (stronk7)
7a478c3211 Merge branch 'MDL-69813' of https://github.com/paulholden/moodle into master 2020-10-14 22:47:02 +02:00
Sara Arjona
0c69575cc4 MDL-69520 core_h5p: unit tests for covering example and tutorial 2020-10-14 17:47:48 +02:00
Sara Arjona
6171c4bbe8 MDL-69520 core_h5p: add example and tutorial links 2020-10-14 17:47:46 +02:00
Jun Pataleta
fac0b05ed5 Merge branch 'MDL-69257-master' of git://github.com/mihailges/moodle 2020-10-09 11:12:23 +08:00
Mihail Geshoski
2212df5dd8 MDL-69257 core_h5p: Move $maxsize outside the foreach loop
There is no reason to repeatedly obtain the maximum size for uploading
files as a part of foreach loop.
2020-10-09 10:23:28 +08:00
Ferran Recio
dd4a089b1c MDL-69736 core_h5p: enable player reporting 2020-10-06 13:02:45 +02:00
Paul Holden
27f8784204 MDL-69813 h5p: fix undefined addon ordering in framework test. 2020-10-06 10:45:21 +01:00
Amaia Anabitarte
46b9e12a27 MDL-69712 core_h5p: Remove 'whitelist' key uses 2020-10-05 10:27:48 +02:00
Martin Gauk
2355205ad8 MDL-69257 H5P: Check size of uploaded files and virus scan 2020-09-29 10:09:47 +00: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
Adrian Greeve
134cdddfc4 Merge branch 'MDL-69479-master' of git://github.com/mihailges/moodle 2020-08-27 11:41:10 +08:00
Victor Deniz Falcon
9aa9efbfda MDL-68921 core_h5p: Add H5P libraries metadata settings 2020-08-25 00:48:02 +01:00
Eloy Lafuente (stronk7)
9a79c34eb6 MDL-69479 upgrade: Change all 4.0 occurrences to 3.10
Under parallel development, when something is worth being commented
in upgrade.txt notes, it will be applied to all the development branches
using the "earliest" one to be released. So, if something changes
in 3.10 (and also is applied to master), the upgrade.txt notes will
show 3.10 in both branches.

Of course, if something only goes to one dev branch (say master), then the
master version will be used in the notes (4.0 in this case).
2020-08-21 23:57:17 +02:00
Eloy Lafuente (stronk7)
fbb0767536 MDL-69475 versions: bump all versions and requires in master
version = 2021052500 release version
requires= 2021052500 same than version

Why 20210525? (25th May 2021) ?

Because master is going to be Moodle 4.0, to be released
on November 2021. And, until then, we are going to have
a couple of "intermediate" releases:

- Moodle 3.10 to be released 9th November 2020. (2020110900)

  This version will be using versions from today to 2020110900
  (once it's released the YYYYMMDD part stops advancing).

- Moodle 3.11 to be released 10th May 2021. (2021051000)

  This version will be using versions from 3.10 release to 2021051000
  (once it's released the YYYYMMDD part stops advancing).

That means that all versions from today to 2021051000 are going
to be used by those 2 "intermediate" releases (3.10 and 3.11).

And we cannot use them in master, because it's forbidden to have
any overlapping of versions between branches (or different upgrade
paths will fail).

So, get that 2021051000, let's add it a couple of weeks to cover
the on-sync period (or a 2 weeks delay max!) and, the first version
that master can "own" in exclusive (without any overlap) is, exactly,
25th May 2021, hence our 20210525.
2020-08-18 00:47:15 +02: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
1826ac971a Merge branch 'MDL-68902-master' of git://github.com/ferranrecio/moodle 2020-06-10 17:57:40 +02:00
Jake Dallimore
337e2e2b23 Merge branch 'MDL-68973' of https://github.com/stronk7/moodle 2020-06-10 16:13:57 +08:00
Adrian Greeve
fc9be99323 Merge branch 'MDL-68985-master' of git://github.com/sarjona/moodle 2020-06-10 09:39:45 +08:00
Helen Foster
1ab405f4a2 MDL-68972 lang: Import fixed English strings (en_fix) 2020-06-09 20:56:34 +02:00