Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]
(no description)
File Size: | 1053 lines (42 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
manager_test:: (26 methods):
test_create()
test_is_tracking_enabled()
is_tracking_enabled_data()
test_get_users_scaled_score()
get_users_scaled_score_data()
test_get_grading_methods()
test_get_selected_attempt()
get_selected_attempt_data()
test_get_review_modes()
test_get_grader()
test_can_view_all_attempts()
can_view_all_attempts_data()
test_can_view_own_attempts()
can_view_own_attempts_data()
test_count_attempts()
test_count_attempts_all()
count_attempts_all_data()
test_get_active_users_join()
get_active_users_join_data()
test_get_active_users_join_groupmode()
test_count_users_attempts()
test_get_report()
get_report_data()
test_get_attempt()
get_attempt_data()
generate_fake_attempts()
Class: manager_test - X-Ref
Manager tests class for mod_h5pactivity.test_create() X-Ref |
Test for static create methods. |
test_is_tracking_enabled(bool $login, string $role, int $enabletracking, bool $expected) X-Ref |
Test for is_tracking_enabled. param: bool $login if the user is logged in param: string $role user role in course param: int $enabletracking if tracking is enabled param: bool $expected expected result |
is_tracking_enabled_data() X-Ref |
Data provider for is_tracking_enabled. return: array |
test_get_users_scaled_score(int $enabletracking, int $gradingmethod, array $result1, array $result2) X-Ref |
Test for get_users_scaled_score. param: int $enabletracking if tracking is enabled param: int $gradingmethod new grading method param: array $result1 student 1 results (scaled, timemodified, attempt number) param: array $result2 student 2 results (scaled, timemodified, attempt number) |
get_users_scaled_score_data() X-Ref |
Data provider for get_users_scaled_score. return: array |
test_get_grading_methods() X-Ref |
Test static get_grading_methods. |
test_get_selected_attempt(int $enabletracking, int $gradingmethod, int $result) X-Ref |
Test static get_selected_attempt. param: int $enabletracking if tracking is enabled param: int $gradingmethod new grading method param: int $result the expected result |
get_selected_attempt_data() X-Ref |
Data provider for get_users_scaled_score. return: array |
test_get_review_modes() X-Ref |
Test static get_review_modes. |
test_get_grader() X-Ref |
Test get_grader method. |
test_can_view_all_attempts(int $enabletracking, bool $usestudent, bool $useloggedin, bool $result) X-Ref |
Test static can_view_all_attempts. param: int $enabletracking if tracking is enabled param: bool $usestudent if test must be done with a user role param: bool $useloggedin if test must be done with the loggedin user param: bool $result the expected result |
can_view_all_attempts_data() X-Ref |
Data provider for test_can_view_all_attempts. return: array |
test_can_view_own_attempts(int $enabletracking, int $reviewmode,bool $useloggedin, bool $hasattempts, bool $result) X-Ref |
Test static can_view_own_attempts. param: int $enabletracking if tracking is enabled param: int $reviewmode the attempt review mode param: bool $useloggedin if test must be done with the loggedin user param: bool $hasattempts if the student have attempts param: bool $result the expected result |
can_view_own_attempts_data() X-Ref |
Data provider for test_can_view_own_attempts. return: array |
test_count_attempts() X-Ref |
Test static count_attempts of one user. |
test_count_attempts_all(bool $canview, bool $cansubmit, bool $extrarole, int $result) X-Ref |
Test static count_attempts of all active participants. param: bool $canview if the student role has mod_h5pactivity/view capability param: bool $cansubmit if the student role has mod_h5pactivity/submit capability param: bool $extrarole if an extra role without submit capability is required param: int $result the expected result |
count_attempts_all_data() X-Ref |
Data provider for test_count_attempts_all. return: array |
test_get_active_users_join(bool $allpotentialusers, int $result) X-Ref |
Test static test_get_active_users_join of all active participants. Most method scenarios are tested in test_count_attempts_all so we only need to test the with $allpotentialusers true and false. param: bool $allpotentialusers if the join should return all potential users or only the submitted ones. param: int $result the expected result |
get_active_users_join_data() X-Ref |
Data provider for test_get_active_users_join. return: array |
test_get_active_users_join_groupmode() X-Ref |
Test active users joins returns appropriate results for groups |
test_count_users_attempts() X-Ref |
Test static count_attempts. |
test_get_report(int $enabletracking, int $reviewmode, bool $createattempts,string $role, array $results) X-Ref |
Test static get_report. param: int $enabletracking if tracking is enabled param: int $reviewmode the attempt review mode param: bool $createattempts if the student have attempts param: string $role the user role (student or editingteacher) param: array $results the expected classname (or null) |
get_report_data() X-Ref |
Data provider for test_get_report. return: array |
test_get_attempt(string $attemptname, ?string $result) X-Ref |
Test get_attempt method. param: string $attemptname the attempt to use param: string|null $result the expected attempt ID or null for none |
get_attempt_data() X-Ref |
Data provider for test_get_attempt. return: array |
generate_fake_attempts(stdClass $activity, stdClass $user, int $basescore) X-Ref |
Insert fake attempt data into h5pactiviyt_attempts. This function insert 4 attempts. 3 of them finished with different gradings and timestamps and 1 unfinished. param: stdClass $activity the activity record param: stdClass $user user record param: int $basescore a score to be used to generate all attempts |