AutorÃa | Ultima modificación | Ver Log |
@mod @mod_questionnaireFeature: Questionnaires can be public, private or templateIn order to view a questionnaireAs a userThe type of the questionnaire affects how it is displayed.@javascriptScenario: Add a template questionnaireGiven the following "users" exist:| username | firstname | lastname | email || manager1 | Manager | 1 | manager1@example.com || 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 || manager1 | C1 | manager |And the following "activities" exist:| activity | name | description | course | idnumber || questionnaire | Test questionnaire | Test questionnaire description | C1 | questionnaire0 |And I am on the "Test questionnaire" "mod_questionnaire > advsettings" page logged in as "manager1"And I should see "Content options"And I set the field "id_realm" to "template"And I press "Save and display"Then I should see "Template questionnaires are not viewable"@javascriptScenario: Add a questionnaire from a public questionnaireGiven the following "users" exist:| username | firstname | lastname | email || manager1 | Manager | 1 | manager1@example.com || teacher1 | Teacher | 1 | teacher1@example.com || student1 | Student | 1 | student1@example.com |And the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | 0 || Course 2 | C2 | 0 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || student1 | C1 | student || manager1 | C1 | manager || manager1 | C2 | manager || student1 | C2 | student |And the following "activities" exist:| activity | name | description | course | idnumber || questionnaire | Test questionnaire | Test questionnaire description | C1 | questionnaire0 |And the following config values are set as admin:| coursebinenable | 0 | tool_recyclebin |And I log in as "manager1"And I am on site homepageAnd I am on "Course 1" course homepageAnd I follow "Test questionnaire"And I follow "Test questionnaire"And I navigate to "Questions" in current page administrationAnd I add a "Check Boxes" question and I fill the form with:| Question Name | Q1 || Yes | y || Min. forced responses | 1 || Max. forced responses | 2 || Question Text | Select one or two choices only || Possible answers | One,Two,Three,Four |# Neither of the following steps work in 3.2, since the admin options are not available on any page but "view".And I am on the "Test questionnaire" "mod_questionnaire > advsettings" pageAnd I should see "Content options"And I set the field "id_realm" to "public"And I press "Save and return to course"# Verify that a public questionnaire cannot be used in the same course.And I am on "Course 1" course homepage with editing mode onAnd I add a "Questionnaire" to section "1"And I expand all fieldsetsThen I should see "(No public questionnaires.)"And I press "Cancel"# Verify that a public questionnaire can be used in a different course.And I am on site homepageAnd I am on "Course 2" course homepageAnd I add a "Questionnaire" to section "1"And I expand all fieldsetsAnd I set the field "name" to "Questionnaire from public"And I click on "Test questionnaire [Course 1]" "radio"And I press "Save and return to course"And I log outAnd I log in as "student1"And I am on "Course 2" course homepageAnd I follow "Questionnaire from public"Then I should see "Answer the questions..."# Verify message for public questionnaire that has been deleted.And I log outAnd I log in as "manager1"And I am on site homepageAnd I am on "Course 1" course homepageAnd I turn editing mode onAnd I delete "Test questionnaire" activityAnd I am on site homepageAnd I am on the "Questionnaire from public" "mod_questionnaire > view" pageThen I should see "This questionnaire used to depend on a Public questionnaire which has been deleted."And I should see "It can no longer be used and should be deleted."And I log outAnd I am on the "Questionnaire from public" "mod_questionnaire > view" page logged in as "student1"Then I should see "This questionnaire is no longer available. Ask your teacher to delete it."