|
| create_content_types (array $typestonotinstall, core $core) |
| Create H5P content type records in the h5p_libraries database table. More...
|
|
| create_contents_libraries_record (string $h5pid, int $libid, string $dependencytype='preloaded') |
| Create a record in the h5p_contents_libraries database table. More...
|
|
| create_file (string $file, string $content='') |
| Convenience function to create a file. More...
|
|
| create_h5p_record (int $mainlibid, string $jsoncontent=null, string $filtered=null) |
| Create a record in the h5p database table. More...
|
|
| create_library (string $uploaddirectory, int $libraryid, string $machinename, int $majorversion, int $minorversion) |
| Create the necessary files and return an array structure for a library. More...
|
|
| create_library_dependency_record (int $libid, int $requiredlibid, string $dependencytype='preloaded') |
| Create a record in the h5p_library_dependencies database table. More...
|
|
| create_library_record (string $machinename, string $title, int $majorversion=1, int $minorversion=0, int $patchversion=1, string $semantics='', string $addto=null) |
| Create a record in the h5p_libraries database table. More...
|
|
| generate_h5p_data (bool $createlibraryfiles=false) |
| Populate H5P database tables with relevant data to simulate the process of adding H5P content. More...
|
|
| reset () |
| To be called from data reset code only, do not use in tests. More...
|
|
◆ add_libfile_to_array()
core_h5p_generator::add_libfile_to_array |
( |
string |
$type, |
|
|
string |
$path, |
|
|
string |
$version, |
|
|
& |
$files |
|
) |
| |
|
protected |
Creates the file record.
Currently used for the cache tests.
- Parameters
-
string | $type | Either 'scripts' or 'styles'. |
string | $path | Path to the file in the file system. |
string | $version | Not really needed at the moment. |
◆ create_content_types()
core_h5p_generator::create_content_types |
( |
array |
$typestonotinstall, |
|
|
core |
$core |
|
) |
| |
Create H5P content type records in the h5p_libraries database table.
- Parameters
-
array | $typestonotinstall | H5P content types that should not be installed |
core | $core | h5p_test_core instance required to use the exttests URL |
- Return values
-
array | Data of the content types not installed. |
◆ create_contents_libraries_record()
core_h5p_generator::create_contents_libraries_record |
( |
string |
$h5pid, |
|
|
int |
$libid, |
|
|
string |
$dependencytype = 'preloaded' |
|
) |
| |
Create a record in the h5p_contents_libraries database table.
- Parameters
-
string | $h5pid | The ID of the H5P content |
int | $libid | The ID of the library |
string | $dependencytype | The dependency type |
- Return values
-
int | The ID of the added record |
◆ create_file()
core_h5p_generator::create_file |
( |
string |
$file, |
|
|
string |
$content = '' |
|
) |
| |
Convenience function to create a file.
- Parameters
-
string | $file | path to a file. |
string | $content | file content. |
◆ create_h5p_record()
core_h5p_generator::create_h5p_record |
( |
int |
$mainlibid, |
|
|
string |
$jsoncontent = null , |
|
|
string |
$filtered = null |
|
) |
| |
Create a record in the h5p database table.
- Parameters
-
int | $mainlibid | The ID of the content's main library |
string | $jsoncontent | The content in json format |
string | $filtered | The filtered content parameters |
- Return values
-
int | The ID of the added record |
◆ create_library()
core_h5p_generator::create_library |
( |
string |
$uploaddirectory, |
|
|
int |
$libraryid, |
|
|
string |
$machinename, |
|
|
int |
$majorversion, |
|
|
int |
$minorversion |
|
) |
| |
Create the necessary files and return an array structure for a library.
- Parameters
-
string | $uploaddirectory | Base directory for the library. |
int | $libraryid | Library id. |
string | $machinename | Name for this library. |
int | $majorversion | Major version (any number will do). |
int | $minorversion | Minor version (any number will do). |
- Return values
-
array | A list of library data and files that the core API will understand. |
◆ create_library_dependency_record()
core_h5p_generator::create_library_dependency_record |
( |
int |
$libid, |
|
|
int |
$requiredlibid, |
|
|
string |
$dependencytype = 'preloaded' |
|
) |
| |
Create a record in the h5p_library_dependencies database table.
- Parameters
-
int | $libid | The ID of the library |
int | $requiredlibid | The ID of the required library |
string | $dependencytype | The dependency type |
- Return values
-
int | The ID of the added record |
◆ create_library_record()
core_h5p_generator::create_library_record |
( |
string |
$machinename, |
|
|
string |
$title, |
|
|
int |
$majorversion = 1 , |
|
|
int |
$minorversion = 0 , |
|
|
int |
$patchversion = 1 , |
|
|
string |
$semantics = '' , |
|
|
string |
$addto = null |
|
) |
| |
Create a record in the h5p_libraries database table.
- Parameters
-
string | $machinename | The library machine name |
string | $title | The library's name |
int | $majorversion | The library's major version |
int | $minorversion | The library's minor version |
int | $patchversion | The library's patch version |
string | $semantics | Json describing the content structure for the library |
string | $addto | The plugin configuration data |
- Return values
-
stdClass | An object representing the added library record |
◆ generate_h5p_data()
core_h5p_generator::generate_h5p_data |
( |
bool |
$createlibraryfiles = false | ) |
|
Populate H5P database tables with relevant data to simulate the process of adding H5P content.
- Parameters
-
bool | $createlibraryfiles | Whether to create and store library files on the filesystem |
- Return values
-
stdClass | An object representing the added H5P records |
◆ reset()
component_generator_base::reset |
( |
| ) |
|
|
inherited |
To be called from data reset code only, do not use in tests.
- Return values
-
Reimplemented in core_question_generator, core_notes_generator, mod_wiki_generator, mod_survey_generator, mod_lesson_generator, mod_glossary_generator, mod_forum_generator, mod_data_generator, mod_chat_generator, mod_book_generator, testing_repository_generator, testing_module_generator, testing_block_generator, core_competency_generator, and tool_dataprivacy_generator.
The documentation for this class was generated from the following file: