Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: behat_completion  - X-Ref

Steps definitions to deal with course and activities completion.

user_has_completed_activity($userfullname, $activityname)   X-Ref
Checks that the specified user has completed the specified activity of the current course.

param: string $userfullname
param: string $activityname

user_has_not_completed_activity($userfullname, $activityname)   X-Ref
Checks that the specified user has not completed the specified activity of the current course.

param: string $userfullname
param: string $activityname

go_to_the_current_course_activity_completion_report()   X-Ref
Goes to the current course activity completion report.


completion_is_toggled_in_course($completionstatus)   X-Ref
Toggles completion tracking for course being in the course page.

param: string $completionstatus The status, enabled or disabled.

activity_marked_as_complete($activityname, $activitytype, $completiontype)   X-Ref
Checks if the activity with specified name is maked as complete.


activity_marked_as_not_complete($activityname, $activitytype, $completiontype)   X-Ref
Checks if the activity with specified name is maked as complete.


activity_completion_condition_displayed_as(string $conditionname, string $activityname,string $completionstatus)   X-Ref
Checks if the activity with specified name is maked as complete.

param: string $conditionname The completion condition text.
param: string $activityname The activity name.
param: string $completionstatus The completion status. Must be either of the following: 'todo', 'done', 'failed'.

overridden_activity_completion_condition_displayed_as(string $conditionname, string $activityname,string $username, string $completionstatus)   X-Ref
Checks if the activity with specified name is maked as complete.

param: string $conditionname The completion condition text.
param: string $activityname The activity name.
param: string $username The full name of the user overriding the student's activity completion.
param: string $completionstatus The override completion status. Must be either of the following: 'todo', 'done'.

manual_completion_button_displayed_as(string $activityname, string $completionstatus)   X-Ref
Checks the manual completion state of an activity.

param: string $activityname The activity name.
param: string $completionstatus The completion status shown on the manual completion button.

overridden_manual_completion_button_displayed_as(string $activityname, string $username,string $completionstatus)   X-Ref
Checks the manual completion state of an activity.

param: string $activityname The activity name.
param: string $username The full name of the user overriding the student's activity completion.
param: string $completionstatus The completion status shown on the manual completion button.

toggle_the_manual_completion_state(string $activityname)   X-Ref
Toggles the manual completion button for a given activity.

param: string $activityname The activity name.

there_should_be_no_completion_for_activity(string $activityname)   X-Ref
Check that the activity does show completion information.

param: string $activityname The activity name.

the_manual_completion_button_for_activity_should_be_disabled(string $activityname)   X-Ref
Check that the manual completion button for the activity is disabled.

param: string $activityname The activity name.

the_manual_completion_button_for_activity_should_not_exist(string $activityname)   X-Ref
Check that the manual completion button for the activity does not exist.

param: string $activityname The activity name.

the_manual_completion_button_for_activity_should_exist(string $activityname)   X-Ref
Check that the manual completion button for the activity exists.

param: string $activityname The activity name.

activity_should_have_the_completion_condition(string $activityname, string $conditionname)   X-Ref
Check that the activity has the given automatic completion condition.

param: string $activityname The activity name.
param: string $conditionname The automatic condition name.

activity_has_configuration_completion_checkbox($activityname, $activitytype, $completiontype)   X-Ref
Checks if the activity with specified name shows a information completion checkbox (i.e. showing the completion tracking
configuration).

param: string $activityname The activity name.
param: string $activitytype The activity type.
param: string $completiontype The completion type.

activity_has_status_completion_checkbox($activityname, $activitytype, $completiontype)   X-Ref
Checks if the activity with specified name shows a tracking completion checkbox (i.e. showing my completion tracking status)

param: string $activityname The activity name.
param: string $activitytype The activity type.
param: string $completiontype The completion type.

activity_has_not_any_completion_checkbox($activityname, $activitytype)   X-Ref
Checks if the activity with specified name does not show any completion checkbox.

param: string $activityname The activity name.
param: string $activitytype The activity type.