AutorÃa | Ultima modificación | Ver Log |
@mod @mod_subcourseFeature: Progress and grade in referenced course can be displayed on the course main pageIn order to control the look and feel of my course outline pageAs a teacherI need to be able to configure whether progress and grade in the referenced course is displayed on my course main pageBackground: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 |## Set grades in the referenced course.#And I log in as "teacher1"And I am on "RefCourse" course homepageAnd I navigate to "Settings" in current page administrationAnd I set the following fields to these values:| Enable completion tracking | Yes |And I press "Save and display"And I turn editing mode onAnd I add a "Text and media area" to section "1" and I fill the form with:| Text | Just a simple module to activate progress tracking |And I turn editing mode offAnd I navigate to "Setup > Gradebook setup" in the course gradebookAnd I press "Add grade item"And I set the following fields to these values:| Item name | Manual item 1 || Maximum grade | 10 |And I press "Save changes"And I navigate to "View > Grader report" in the course gradebookAnd I turn editing mode onAnd I give the grade "5" to the user "Student 1" for the grade item "Manual item 1"And I press "Save"And I turn editing mode off@javascriptScenario: Progress and grade displayed on both course main page and subcourse view page.Given I am on "MainCourse" course homepageAnd 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 || Display progress from referenced course on course page | 1 || Display grade from referenced course on course page | 1 |And I turn editing mode offAnd I am on "MainCourse" course homepageAnd I am on the "Unit course 1" "subcourse activity" page logged in as teacher1And I follow "Fetch grades now"And I log outWhen I log in as "student1"And I am on "MainCourse" course homepageThen I should see "Progress:" in the "[data-activityname='Unit course 1']" "css_element"And I should see "Current grade:" in the "[data-activityname='Unit course 1']" "css_element"And I am on the "Unit course 1" "subcourse activity" page logged in as student1And I should see "Progress:" in the ".subcourseinfo-progress" "css_element"And I should see "Current grade:" in the ".subcourseinfo-grade" "css_element"@javascriptScenario: Progress and grade displayed on subcourse view page only.Given I am on "MainCourse" course homepageAnd 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 || Display progress from referenced course on course page | 0 || Display grade from referenced course on course page | 0 |And I turn editing mode offAnd I am on "MainCourse" course homepageAnd I am on the "Unit course 1" "subcourse activity" page logged in as teacher1And I follow "Fetch grades now"And I log outWhen I log in as "student1"And I am on "MainCourse" course homepageThen I should not see "Progress:" in the "[data-activityname='Unit course 1']" "css_element"And I should not see "Current grade:" in the "[data-activityname='Unit course 1']" "css_element"And I am on the "Unit course 1" "subcourse activity" page logged in as student1And I should see "Progress:" in the ".subcourseinfo-progress" "css_element"And I should see "Current grade:" in the ".subcourseinfo-grade" "css_element"