AutorÃa | Ultima modificación | Ver Log |
@mod @mod_subcourseFeature: Completing the referenced course can lead to completing the subcourse activityIn order to complete to Subcourse activityAs a studentI need to complete the referenced course, given such a rule is enabledBackground:Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com || student1 | Student | 1 | student1@example.com |And the following "courses" exist:| fullname | shortname | category | enablecompletion || MainCourse | M | 0 | 1 || RefCourse | R | 0 | 1 |And the following "course enrolments" exist:| user | course | role || teacher1 | M | editingteacher || student1 | M | student || teacher1 | R | editingteacher || student1 | R | student |And I enable "selfcompletion" "block" plugin# Create the subcourse instance.When I am on the "MainCourse" course page logged in as "teacher1"And I turn editing mode onAnd I add a "Subcourse" to section "1" and I fill the form with:| Subcourse name | Unit course 1 || Fetch grades from | RefCourse (R) || Redirect to the referenced course | 0 || Completion tracking | Show activity as complete when conditions are met || Require view | 0 || Require course completed | 1 || id_completionexpected_enabled | 1 |# Add the block to a the referenced course to allow students to manually complete itAnd I am on "RefCourse" course homepage with editing mode onAnd I add the "Self completion" blockAnd I navigate to "Course completion" in current page administrationAnd I expand all fieldsetsAnd I set the following fields to these values:| id_criteria_self | 1 |And I press "Save changes"And I log out@javascriptScenario: Student is informed about a subcourse to be completedWhen I log in as "student1"Then I should see "Unit course 1 should be completed"@javascriptScenario: Completing the referenced course leads to completing the subcourseGiven I am on the "RefCourse" course page logged in as "student1"And I follow "Complete course"And I should see "Confirm self completion"And I press "Yes"# Running completion task just after clicking sometimes fail, as record should be created before the task runs.And I wait "1" secondsWhen I run the scheduled task "core\task\completion_regular_task"And I am on "MainCourse" course homepageThen the "Complete the activity" completion condition of "Unit course 1" is displayed as "done"And I log outAnd I log in as "teacher1"And I am on "MainCourse" course homepageAnd I navigate to "Reports > Activity completion" in current page administrationAnd "//img[contains(@title, 'Unit course 1') and contains(@title, 'Completed')]" "xpath_element" should exist in the "Student 1" "table_row"