Differences Between: [Versions 310 and 403] [Versions 400 and 403]
Data generator.
Copyright: | 2020 Ferran Recio <ferran@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 586 lines (22 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
mod_h5pactivity_generator:: (14 methods):
create_instance()
create_content()
create_attempt()
get_attempt_object()
new_user_attempt()
insert_statement()
get_attempt_result_compound()
get_attempt_result_choice()
get_attempt_result_matching()
get_attempt_result_fillin()
get_attempt_result_truefalse()
get_attempt_result_longfillin()
get_attempt_result_sequencing()
get_attempt_result_other()
Class: mod_h5pactivity_generator - X-Ref
h5pactivity module data generator class.create_instance($record = null, array $options = null) X-Ref |
Creates new h5pactivity module instance. By default it contains a short text file. param: array|stdClass $record data for module being generated. Requires 'course' key param: null|array $options general options for course module. Since 2.6 it is return: stdClass record from module-defined table with additional field |
create_content($instance, $record = []) X-Ref |
Creata a fake attempt param: stdClass $instance object returned from create_instance() call param: stdClass|array $record return: stdClass generated object |
create_attempt(array $data) X-Ref |
Create a H5P attempt. This method is user by behat generator. param: array $data the attempts data array |
get_attempt_object($attemptinfo) X-Ref |
Get or create an H5P attempt using the data array. param: array $attemptinfo the generator provided data return: int the attempt id |
new_user_attempt(array $attemptinfo) X-Ref |
Creates a user attempt. param: array $attemptinfo the current attempt information. return: int the h5pactivity_attempt ID |
insert_statement(array $attemptinfo, array $statement) X-Ref |
Insert a new statement into an attempt. If the interaction type is "compound" it will also update the attempt general result. param: array $attemptinfo the current attempt information param: array $statement the statement tracking information return: int the h5pactivity_attempt_result ID |
get_attempt_result_compound(array $attemptinfo) X-Ref |
Generates a valid compound tracking result. param: array $attemptinfo the current attempt information. return: array with the required statement data |
get_attempt_result_choice(array $attemptinfo) X-Ref |
Generates a valid choice tracking result. param: array $attemptinfo the current attempt information. return: array with the required statement data |
get_attempt_result_matching(array $attemptinfo) X-Ref |
Generates a valid matching tracking result. param: array $attemptinfo the current attempt information. return: array with the required statement data |
get_attempt_result_fillin(array $attemptinfo) X-Ref |
Generates a valid fill-in tracking result. param: array $attemptinfo the current attempt information. return: array with the required statement data |
get_attempt_result_truefalse(array $attemptinfo) X-Ref |
Generates a valid true-false tracking result. param: array $attemptinfo the current attempt information. return: array with the required statement data |
get_attempt_result_longfillin(array $attemptinfo) X-Ref |
Generates a valid long-fill-in tracking result. param: array $attemptinfo the current attempt information. return: array with the required statement data |
get_attempt_result_sequencing(array $attemptinfo) X-Ref |
Generates a valid sequencing tracking result. param: array $attemptinfo the current attempt information. return: array with the required statement data |
get_attempt_result_other(array $attemptinfo) X-Ref |
Generates a valid other tracking result. param: array $attemptinfo the current attempt information. return: array with the required statement data |