AutorÃa | Ultima modificación | Ver Log |
@mod @mod_subcourseFeature: Clicking the subcourse instance in the course outline may or may not redirect to the referenced courseIn order to visit the referenced courseAs a userI need to visit the subcourse activity and either click a link or there is no need to do soBackground: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 || MainCourse | M | 0 || RefCourse | R | 0 |And the following "course enrolments" exist:| user | course | role || teacher1 | M | editingteacher || student1 | M | student || teacher1 | R | editingteacher || student1 | R | student |And I log in as "teacher1"And I am on "MainCourse" course homepageAnd I turn editing mode on@javascriptScenario: Student has to click the link to the referenced course manuallyAnd 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 |And I log outWhen I log in as "student1"And I am on "MainCourse" course homepageAnd I follow "Unit course 1"Then I should see "Go to RefCourse"And I follow "RefCourse"And I should see "RefCourse" in the "page-header" "region"@javascriptScenario: Student is instantly redirected to the referenced courseAnd 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 | 1 |And I log outWhen I log in as "student1"And I am on "MainCourse" course homepageAnd I follow "Unit course 1"Then I should see "RefCourse" in the "page-header" "region"@javascriptScenario: Teacher is not redirected instantly even if that is enabledAnd 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 | 1 |And I am on the "Unit course 1" "subcourse activity" page logged in as teacher1Then I should see "Go to RefCourse"And I follow "RefCourse"And I should see "RefCourse" in the "page-header" "region"@javascriptScenario: Teacher is redirected instantly if unable to fetch grades manuallyAnd 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 | 1 || ID number | subcourse1 |And the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || mod/subcourse:fetchgrades | Prevent | teacher | Activity module | subcourse1 || mod/subcourse:fetchgrades | Prevent | editingteacher | Activity module | subcourse1 |And I am on "MainCourse" course homepageAnd I am on the "Unit course 1" "subcourse activity" page logged in as teacher1And I am on "RefCourse" course homepageThen I should see "RefCourse" in the "page-header" "region"