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').'"')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
45
completion/tests/behat/teacher_manual_completion.feature
Normal file
45
completion/tests/behat/teacher_manual_completion.feature
Normal file
|
@ -0,0 +1,45 @@
|
|||
@core @core_completion
|
||||
Feature: Allow teachers to manually mark users as complete when configured
|
||||
In order for teachers to mark students as complete
|
||||
As a teacher
|
||||
I need to be able to use the completion report mark complete functionality
|
||||
|
||||
Scenario: Mark a student as complete using the completion report
|
||||
Given the following "courses" exists:
|
||||
| fullname | shortname | category |
|
||||
| Completion course | CC1 | 0 |
|
||||
And the following "users" exists:
|
||||
| username | firstname | lastname | email |
|
||||
| student1 | Student | First | student1@example.com |
|
||||
| teacher1 | Teacher | First | teacher1@example.com |
|
||||
And the following "course enrolments" exists:
|
||||
| user | course | role |
|
||||
| student1 | CC1 | student |
|
||||
| teacher1 | CC1 | editingteacher |
|
||||
And I log in as "admin"
|
||||
And I set the following administration settings values:
|
||||
| Enable completion tracking | 1 |
|
||||
And I am on homepage
|
||||
And I follow "Completion course"
|
||||
And completion tracking is "enabled" in current course
|
||||
And I follow "Course completion"
|
||||
And I check "Teacher"
|
||||
And I press "Save changes"
|
||||
And I turn editing mode on
|
||||
And I add the "Course completion status" block
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Completion course"
|
||||
And I should see "Status: Not yet started"
|
||||
And I log out
|
||||
When I log in as "teacher1"
|
||||
And I follow "Completion course"
|
||||
And I follow "View course report"
|
||||
And I should see "Student First"
|
||||
And I follow "Click to mark user complete"
|
||||
And I run the cron
|
||||
And I am on homepage
|
||||
And I log out
|
||||
Then I log in as "student1"
|
||||
And I follow "Completion course"
|
||||
And I should see "Status: Complete"
|
Loading…
Add table
Add a link
Reference in a new issue