Differences Between: [Versions 310 and 311] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]
mod_h5pactivity attempt tests
Copyright: | 2020 Ferran Recio <ferran@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 462 lines (18 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
attempt_test:: (14 methods):
generate_testing_scenario()
test_create_attempt()
test_last_attempt()
test_save_statement()
save_statement_data()
test_delete_results()
test_delete_attempt()
test_delete_all_attempts()
delete_all_attempts_data()
test_set_score()
test_basic_setters()
basic_setters_data()
generate_full_attempt()
generate_statement()
Class: attempt_test - X-Ref
Attempt tests class for mod_h5pactivity.generate_testing_scenario() X-Ref |
Generate a scenario to run all tests. return: array course_modules, user record, course record |
test_create_attempt() X-Ref |
Test for create_attempt method. |
test_last_attempt() X-Ref |
Test for last_attempt method |
test_save_statement(string $subcontent, bool $hasdefinition, bool $hasresult, array $results) X-Ref |
Test saving statements. param: string $subcontent subcontent identifier param: bool $hasdefinition generate definition param: bool $hasresult generate result param: array $results 0 => insert ok, 1 => maxscore, 2 => rawscore, 3 => count |
save_statement_data() X-Ref |
Data provider for data request creation tests. return: array |
test_delete_results() X-Ref |
Test delete results from attempt. |
test_delete_attempt() X-Ref |
Test delete attempt. |
test_delete_all_attempts(bool $hasstudent, array $results) X-Ref |
Test delete all attempts. param: bool $hasstudent if user is specificed param: int[] 0-3 => statements count results, 4-5 => totals |
delete_all_attempts_data() X-Ref |
Data provider for data request creation tests. return: array |
test_set_score() X-Ref |
Test set_score method. |
test_basic_setters(string $attribute, int $oldvalue, int $newvalue) X-Ref |
Test set_duration method. param: string $attribute the stribute to test param: int $oldvalue attribute old value param: int $newvalue attribute new expected value |
basic_setters_data() X-Ref |
Data provider for testing basic setters. return: array |
generate_full_attempt($student, $cm) X-Ref |
Generate a fake attempt with two results. param: stdClass $student a user record param: stdClass $cm a course_module record return: attempt |
generate_statement(bool $hasdefinition, bool $hasresult) X-Ref |
Return a xAPI partial statement with object defined. param: bool $hasdefinition if has to include definition param: bool $hasresult if has to include results return: statement |