mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-40241 completion: Default roles unable to manually complete course
Thanks to Jon Sharp for authoring the original patch!
This commit is contained in:
parent
ca0e301c7b
commit
37ee40f3e0
6 changed files with 83 additions and 7 deletions
|
@ -105,4 +105,20 @@ class behat_completion extends behat_base {
|
|||
return $steps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles completion tracking for course
|
||||
*
|
||||
* @When /^completion tracking is "(?P<completion_status_string>([Ee]nabled|[Dd]isabled)*)" in current course$/
|
||||
* @param string $completionstatus
|
||||
*/
|
||||
public function completion_is_toggled_in_course($completionstatus) {
|
||||
|
||||
$toggle = strtolower($completionstatus) == 'enabled' ? 'Yes' : 'No';
|
||||
|
||||
return array(
|
||||
new Given('I follow "'.get_string('editsettings').'"'),
|
||||
new Given('I select "'.$toggle.'" from "'.get_string('enablecompletion', 'completion').'"'),
|
||||
new Given('I press "'.get_string('savechanges').'"')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue