AutorÃa | Ultima modificación | Ver Log |
@core @core_course @core_customfield @javascriptFeature: The visibility of fields control where they are displayedIn order to display custom fields on course listingAs a managerI can change the visibility of the fieldsBackground:Given the following "custom field categories" exist:| name | component | area | itemid || Category for test | core_course | course | 0 |Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com || student1 | Student | 1 | student@example.com |And the following "courses" exist:| fullname | shortname | format || Course 1 | C1 | topics |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher |Scenario: Display course custom fields on homepageWhen I log in as "admin"And I navigate to "Courses > Default settings > Course custom fields" in site administrationAnd I click on "Add a new custom field" "link"And I click on "Short text" "link"And I set the following fields to these values:| Name | Test field || Short name | testfield || Visible to | Everyone |And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"And I log outThen 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:| Test field | testcontent |And I press "Save and display"And I am on site homepageThen I should see "Test field: testcontent"Scenario: Do not display course custom fields on homepageWhen I log in as "admin"And I navigate to "Courses > Default settings > Course custom fields" in site administrationAnd I click on "Add a new custom field" "link"And I click on "Short text" "link"And I set the following fields to these values:| Name | Test field || Short name | testfield || Visible to | Nobody |And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"And I log outWhen 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:| Test field | testcontent |And I press "Save and display"And I am on site homepageAnd I should not see "Test field: testcontent"Scenario: Display course custom fields on homepage only to course editorsWhen I log in as "admin"And I navigate to "Courses > Default settings > Course custom fields" in site administrationAnd I click on "Add a new custom field" "link"And I click on "Short text" "link"And I set the following fields to these values:| Name | Test field || Short name | testfield || Visible to | Teachers |And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"And I log outWhen 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:| Test field | testcontent |And I press "Save and display"When I am on site homepageAnd I should see "Test field: testcontent"And I log outWhen I log in as "student"When I am on site homepageAnd I should not see "Test field: testcontent"