AutorÃa | Ultima modificación | Ver Log |
@mod @mod_lessonFeature: link to gradebook on the end of lesson pageIn order to allow students to see their lesson gradesAs a teacherI need to provide a link to gradebook on the end of lesson 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 || Course 1 | C1 | 0 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || student1 | C1 | student |And the following "activities" exist:| activity | name | course | idnumber || lesson | Test lesson | C1 | lesson1 |And the following "mod_lesson > pages" exist:| lesson | qtype | title | content || Test lesson | content | First page name | First page contents || Test lesson | content | Second page name | Second page contents |And the following "mod_lesson > answers" exist:| page | answer | jumpto || First page name | Next page | Next page || Second page name | Previous page | Previous page || Second page name | Next page | Next page |Scenario: Link to gradebook for non practice lessonWhen I am on the "Test lesson" "lesson activity" page logged in as student1And I press "Next page"And I press "Next page"Then I should see "Congratulations - end of lesson reached"And I should see "View grades"And I follow "View grades"And I should see "Student 1" in the "region-main" "region"And I should see "Test lesson"Scenario: No link to gradebook for non graded lessonGiven I am on the "Test lesson" "lesson activity editing" page logged in as teacher1And I set the following fields to these values:| Type | None |And I press "Save and display"When I am on the "Test lesson" "lesson activity" page logged in as student1And I press "Next page"And I press "Next page"Then I should see "Congratulations - end of lesson reached"And I should not see "View grades"Scenario: No link to gradebook for practice lessonGiven I am on the "Test lesson" "lesson activity editing" page logged in as teacher1And I set the following fields to these values:| Practice lesson | Yes |And I press "Save and display"When I am on the "Test lesson" "lesson activity" page logged in as student1And I press "Next page"And I press "Next page"Then I should see "Congratulations - end of lesson reached"And I should not see "View grades"Scenario: No link if Show gradebook to student disabledGiven I log in as "teacher1"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administrationAnd I set the following fields to these values:| Show gradebook to students | No |And I press "Save and display"When I am on the "Test lesson" "lesson activity" page logged in as student1And I press "Next page"And I press "Next page"Then I should see "Congratulations - end of lesson reached"And I should not see "View grades"Scenario: No link to gradebook if no gradereport/user:view capabilityGiven the following "role capability" exists:| role | student || gradereport/user:view | prevent |When I am on the "Test lesson" "lesson activity" page logged in as student1And I press "Next page"And I press "Next page"Then I should see "Congratulations - end of lesson reached"And I should not see "View grades"