first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+258
View File
@@ -0,0 +1,258 @@
@mod @mod_feedback
Feature: Anonymous feedback
In order to collect feedbacks
As an admin
I need to be able to allow anonymous feedbacks
Background:
Given the following "users" exist:
| username | firstname | lastname |
| user1 | Username | 1 |
| user2 | Username | 2 |
| teacher | Teacher | 3 |
| manager | Manager | 4 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | student |
| user2 | C1 | student |
| teacher | C1 | editingteacher |
And the following "system role assigns" exist:
| user | course | role |
| manager | Acceptance test site | manager |
And the following "activities" exist:
| activity | name | course | idnumber | anonymous | publish_stats | section |
| feedback | Site feedback | Acceptance test site | feedback0 | 1 | 1 | 1 |
| feedback | Course feedback | C1 | feedback1 | 1 | 1 | 0 |
When I log in as "manager"
And I am on site homepage
And I follow "Site feedback"
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like our site? |
| Label | multichoice2 |
| Multiple choice type | Multiple choice - single answer |
| Hide the "Not selected" option | Yes |
| Multiple choice values | Yes\nNo\nI don't know |
And I log out
Scenario: Guests can see anonymous feedback on front page but can not complete
When I follow "Site feedback"
Then I should not see "Answer the questions"
And I should not see "Preview questions"
Scenario: Complete anonymous feedback on the front page as an authenticated user
And I log in as "user1"
And I am on site homepage
When I follow "Site feedback"
And I should not see "Preview questions"
And I follow "Answer the questions"
And I should see "Do you like our site?"
And I set the following fields to these values:
| Yes | 1 |
And I press "Submit your answers"
And I should not see "Analysis"
And I press "Continue"
@javascript
Scenario: Complete anonymous feedback and view analysis on the front page as an authenticated user
Given the following "role capability" exists:
| role | frontpage |
| mod/feedback:viewanalysepage | allow |
And I log in as "user1"
And I am on site homepage
When I follow "Site feedback"
And I should not see "Preview questions"
And I follow "Answer the questions"
And I should see "Do you like our site?"
And I set the following fields to these values:
| Yes | 1 |
And I press "Submit your answers"
And I log out
And I log in as "user2"
And I am on site homepage
And I follow "Site feedback"
And I should not see "Preview questions"
And I follow "Answer the questions"
And I set the following fields to these values:
| No | 1 |
And I press "Submit your answers"
And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
And I show chart data for the "multichoice2" feedback
And I should see "Do you like our site?"
And I should see "1 (50.00 %)" in the "Yes" "table_row"
And I should see "1 (50.00 %)" in the "No" "table_row"
And I log out
And I log in as "manager"
And I am on site homepage
And I follow "Site feedback"
And I navigate to "Responses" in current page administration
And I should not see "Username"
And I should see "Anonymous entries (2)"
And I follow "Response number: 1"
And I should not see "Username"
And I should see "Response number: 1 (Anonymous)"
And I log out
Scenario: Complete fully anonymous feedback on the front page as a guest
Given the following config values are set as admin:
| feedback_allowfullanonymous | 1 |
When I follow "Site feedback"
And I should not see "Preview questions"
And I follow "Answer the questions"
And I should see "Do you like our site?"
And I set the following fields to these values:
| Yes | 1 |
And I press "Submit your answers"
And I should not see "Analysis"
And I press "Continue"
@javascript
Scenario: Complete fully anonymous feedback and view analyze on the front page as a guest
Given the following config values are set as admin:
| feedback_allowfullanonymous | 1 |
And the following "role capability" exists:
| role | guest |
| mod/feedback:viewanalysepage | allow |
When I follow "Site feedback"
And I should not see "Preview questions"
And I follow "Answer the questions"
And I should see "Do you like our site?"
And I set the following fields to these values:
| Yes | 1 |
And I press "Submit your answers"
And I press "Continue"
# Starting new feedback
When I follow "Site feedback"
And I should not see "Preview questions"
And I follow "Answer the questions"
And I should see "Do you like our site?"
And I set the following fields to these values:
| No | 1 |
And I press "Submit your answers"
And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303
And I show chart data for the "multichoice2" feedback
And I should see "Do you like our site?"
And I should see "1 (50.00 %)" in the "Yes" "table_row"
And I should see "1 (50.00 %)" in the "No" "table_row"
And I log in as "manager"
And I am on site homepage
And I follow "Site feedback"
And I navigate to "Responses" in current page administration
And I should see "Anonymous entries (2)"
And I follow "Response number: 1"
And I should see "Response number: 1 (Anonymous)"
And I log out
@javascript
Scenario: Anonymous feedback in a course
# Teacher can not
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - single answer |
| Hide the "Not selected" option | Yes |
| Multiple choice values | Yes\nNo\nI don't know |
And I log out
And I am on the "Course feedback" "feedback activity" page logged in as user1
And I should not see "Preview questions"
And I follow "Answer the questions"
And I should see "Do you like this course?"
And I set the following fields to these values:
| Yes | 1 |
And I press "Submit your answers"
And I log out
And I am on the "Course feedback" "feedback activity" page logged in as user2
And I should not see "Preview questions"
And I follow "Answer the questions"
And I should see "Do you like this course?"
And I set the following fields to these values:
| No | 1 |
And I press "Submit your answers"
And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303
And I show chart data for the "multichoice1" feedback
And I should see "Do you like this course?"
And I should see "1 (50.00 %)" in the "Yes" "table_row"
And I should see "1 (50.00 %)" in the "No" "table_row"
And I log out
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Preview"
And I should see "Do you like this course?"
And I press "Continue"
And I should not see "Answer the questions"
And I navigate to "Responses" in current page administration
And I should not see "Username"
And I should see "Anonymous entries (2)"
And I follow "Response number: 1"
And I should not see "Username"
And I should see "Response number: 1 (Anonymous)"
And I should not see "Prev"
And I follow "Next"
And I should see "Response number: 2 (Anonymous)"
And I should see "Prev"
And I should not see "Next"
And I click on "Back" "link" in the "[role=main]" "css_element"
# Delete anonymous response
And I click on "Delete entry" "link" in the "Response number: 1" "table_row"
And I press "Yes"
And I should see "Anonymous entries (1)"
And I should not see "Response number: 1"
And I should see "Response number: 2"
Scenario: Collecting new non-anonymous feedback from a previously anonymous feedback activity
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Allow multiple submissions | Yes |
And I press "Save and display"
And I follow "Edit questions"
And I add a "Short text answer" question to the feedback with:
| Question | this is a short text answer |
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
When I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a short text answer | anontext |
And I press "Submit your answers"
And I log out
# Switch to non-anon responses.
And I am on the "Course feedback" "feedback activity editing" page logged in as teacher
And I set the following fields to these values:
| Record user names | User's name will be logged and shown with answers |
And I press "Save and display"
And I log out
# Now leave a non-anon feedback as user1
And I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a short text answer | usertext |
And I press "Submit your answers"
And I log out
# Now check the responses are correct.
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Responses"
And I should see "Anonymous entries (1)"
And I should see "Non anonymous entries (1)"
And I click on "," "link" in the "Username 1" "table_row"
And I should see "(Username 1)"
Then the field "this is a short text answer" matches value "usertext"
And I navigate to "Responses" in current page administration
And I follow "Response number: 1"
And I should see "Response number: 1 (Anonymous)"
And the field "this is a short text answer" matches value "anontext"
@@ -0,0 +1,229 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Steps definitions related to mod_feedback.
*
* @package mod_feedback
* @category test
* @copyright 2016 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/../../../../lib/behat/behat_base.php');
use Behat\Gherkin\Node\TableNode as TableNode,
Behat\Mink\Exception\ExpectationException as ExpectationException;
/**
* Steps definitions related to mod_feedback.
*
* @copyright 2016 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_mod_feedback extends behat_base {
/**
* Adds a question to the existing feedback with filling the form.
*
* The form for creating a question should be on one page.
*
* @When /^I add a "(?P<question_type_string>(?:[^"]|\\")*)" question to the feedback with:$/
* @param string $questiontype
* @param TableNode $questiondata with data for filling the add question form
*/
public function i_add_question_to_the_feedback_with($questiontype, TableNode $questiondata) {
$questiontype = $this->escape($questiontype);
$this->execute('behat_forms::i_select_from_the_singleselect', array($questiontype, 'typ'));
// Wait again, for page to reloaded.
$this->execute('behat_general::i_wait_to_be_redirected');
$rows = $questiondata->getRows();
$modifiedrows = array();
foreach ($rows as $row) {
foreach ($row as $key => $value) {
$row[$key] = preg_replace('|\\\\n|', "\n", $value);
}
$modifiedrows[] = $row;
}
$newdata = new TableNode($modifiedrows);
$this->execute("behat_forms::i_set_the_following_fields_to_these_values", $newdata);
$saveitem = $this->escape(get_string('save'));
$this->execute("behat_forms::press_button", $saveitem);
}
/**
* Adds a question to the existing feedback with filling the form.
*
* The form for creating a question should be on one page.
*
* @When /^I add a page break to the feedback$/
*/
public function i_add_a_page_break_to_the_feedback() {
$questiontype = $this->escape(get_string('add_pagebreak', 'feedback'));
$this->execute('behat_forms::i_select_from_the_singleselect', array($questiontype, 'typ'));
// Wait again, for page to reloaded.
$this->execute('behat_general::i_wait_to_be_redirected');
}
/**
* Quick way to generate answers to a one-page feedback.
*
* @When /^I log in as "(?P<user_name_string>(?:[^"]|\\")*)" and complete feedback "(?P<feedback_name_string>(?:[^"]|\\")*)" in course "(?P<course_name_string>(?:[^"]|\\")*)" with:$/
* @param string $questiontype
* @param TableNode $questiondata with data for filling the add question form
*/
public function i_log_in_as_and_complete_feedback_in_course($username, $feedbackname, $coursename, TableNode $answers) {
$username = $this->escape($username);
$coursename = $this->escape($coursename);
$feedbackname = $this->escape($feedbackname);
$completeform = $this->escape(get_string('complete_the_form', 'feedback'));
// Log in as user.
$this->execute('behat_auth::i_log_in_as', $username);
// Navigate to feedback complete form.
$this->execute('behat_navigation::i_am_on_page_instance', [$feedbackname, 'feedback activity']);
$this->execute('behat_general::click_link', $completeform);
// Fill form and submit.
$this->execute("behat_forms::i_set_the_following_fields_to_these_values", $answers);
$this->execute("behat_forms::press_button", 'Submit your answers');
// Log out.
$this->execute('behat_auth::i_log_out');
}
/**
* Exports feedback and makes sure the export file is the same as in the fixture
*
* @Then /^following "(?P<link_string>(?:[^"]|\\")*)" should export feedback identical to "(?P<filename_string>(?:[^"]|\\")*)"$/
* @param string $link
* @param string $filename
*/
public function following_should_export_feedback_identical_to($link, $filename) {
global $CFG;
$exception = new ExpectationException('Error while downloading data from ' . $link, $this->getSession());
// It will stop spinning once file is downloaded or time out.
$behatgeneralcontext = behat_context_helper::get('behat_general');
$result = $this->spin(
function($context, $args) use ($behatgeneralcontext) {
$link = $args['link'];
return $behatgeneralcontext->download_file_from_link($link);
},
array('link' => $link),
behat_base::get_extended_timeout(),
$exception
);
$this->compare_exports(file_get_contents($CFG->dirroot . '/' . $filename), $result);
}
/**
* Clicks on Show chart data to display chart data if not visible.
*
* @Then /^I show chart data for the "(?P<feedback_name_string>(?:[^"]|\\")*)" feedback$/
* @param string $feedbackname name of the feedback for which chart data needs to be shown.
*/
public function i_show_chart_data_for_the_feedback($feedbackname) {
$feedbackxpath = "//th[contains(normalize-space(string(.)), \"" . $feedbackname . "\")]/ancestor::table//" .
"div[contains(concat(' ', normalize-space(@class), ' '), ' chart-table ')]" .
"//p[contains(concat(' ', normalize-space(@class), ' '), ' chart-table-expand ') and ".
"//a[contains(normalize-space(string(.)), '".get_string('showchartdata')."')]]";
$charttabledataxpath = $feedbackxpath .
"/following-sibling::div[contains(concat(' ', normalize-space(@class), ' '), ' chart-table-data ')][1]";
// If chart data is not visible then expand.
$node = $this->get_selected_node("xpath_element", $charttabledataxpath);
if ($node) {
if ($node->getAttribute('aria-expanded') === 'false') {
$this->execute('behat_general::i_click_on_in_the', array(
get_string('showchartdata'),
'link',
$feedbackxpath,
'xpath_element'
));
}
}
}
/**
* Ensures two feedback export files are identical
*
* Maps the itemids and converts DEPENDITEM if necessary
*
* Throws ExpectationException if exports are different
*
* @param string $expected
* @param string $actual
* @throws ExpectationException
*/
protected function compare_exports($expected, $actual) {
$dataexpected = xmlize($expected, 1, 'UTF-8');
$dataexpected = $dataexpected['FEEDBACK']['#']['ITEMS'][0]['#']['ITEM'];
$dataactual = xmlize($actual, 1, 'UTF-8');
$dataactual = $dataactual['FEEDBACK']['#']['ITEMS'][0]['#']['ITEM'];
if (count($dataexpected) != count($dataactual)) {
throw new ExpectationException('Expected ' . count($dataexpected) .
' items in the export file, found ' . count($dataactual), $this->getSession());
}
$itemmapping = array();
$itemactual = reset($dataactual);
foreach ($dataexpected as $idx => $itemexpected) {
// Map ITEMID and DEPENDITEM.
$itemmapping[intval($itemactual['#']['ITEMID'][0]['#'])] = intval($itemexpected['#']['ITEMID'][0]['#']);
$itemactual['#']['ITEMID'][0]['#'] = $itemexpected['#']['ITEMID'][0]['#'];
$expecteddependitem = $actualdependitem = 0;
if (isset($itemexpected['#']['DEPENDITEM'][0]['#'])) {
$expecteddependitem = intval($itemexpected['#']['DEPENDITEM'][0]['#']);
}
if (isset($itemactual['#']['DEPENDITEM'][0]['#'])) {
$actualdependitem = intval($itemactual['#']['DEPENDITEM'][0]['#']);
}
if ($expecteddependitem && !$actualdependitem) {
throw new ExpectationException('Expected DEPENDITEM in ' . ($idx + 1) . 'th item', $this->getSession());
}
if (!$expecteddependitem && $actualdependitem) {
throw new ExpectationException('Unexpected DEPENDITEM in ' . ($idx + 1) . 'th item', $this->getSession());
}
if ($expecteddependitem && $actualdependitem) {
if (!isset($itemmapping[$actualdependitem]) || $itemmapping[$actualdependitem] != $expecteddependitem) {
throw new ExpectationException('Unknown DEPENDITEM in ' . ($idx + 1) . 'th item', $this->getSession());
}
$itemactual['#']['DEPENDITEM'][0]['#'] = $itemexpected['#']['DEPENDITEM'][0]['#'];
}
// Now, after mapping, $itemexpected should be exactly the same as $itemactual.
if (json_encode($itemexpected) !== json_encode($itemactual)) {
throw new ExpectationException('Actual ' . ($idx + 1) . 'th item does not match expected', $this->getSession());
}
// Get the next itemactual.
$itemactual = next($dataactual);
}
}
}
@@ -0,0 +1,236 @@
@mod @mod_feedback
Feature: Mapping courses in a feedback
In order to collect the same feedback about multiple courses
As a manager
I need to be able to map site feedback to courses
Background:
Given the following "users" exist:
| username | firstname | lastname |
| user1 | Username | 1 |
| user2 | Username | 2 |
| user3 | Username | 3 |
| teacher | Teacher | 4 |
| manager | Manager | 5 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
| Course 3 | C3 |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | student |
| user1 | C2 | student |
| user2 | C1 | student |
| user2 | C2 | student |
| user3 | C3 | student |
| teacher | C1 | editingteacher |
| teacher | C2 | editingteacher |
| teacher | C3 | editingteacher |
And the following "system role assigns" exist:
| user | course | role |
| manager | Acceptance test site | manager |
And the following "activities" exist:
| activity | name | course | idnumber | anonymous | publish_stats | section |
| feedback | Course feedback | Acceptance test site | feedback0 | 1 | 1 | 1 |
| feedback | Another feedback | C1 | feedback1 | 1 | 1 | 0 |
And I enable "feedback" "block" plugin
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| feedback | Course | C1 | course-view-* | side-pre |
| feedback | Course | C2 | course-view-* | side-pre |
| feedback | Course | C3 | course-view-* | side-pre |
When I log in as "manager"
And I am on site homepage
And I follow "Course feedback"
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
| Label | info |
| Information type | Course |
And I add a "Multiple choice (rated)" question to the feedback with:
| Question | this is a multiple choice rated |
| Label | multichoicerated |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | 0/option a\n1/option b\n5/option c |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a simple multiple choice |
| Label | multichoicesimple |
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
| Multiple choice values | option d\noption e\noption f |
And I log out
Scenario: Course feedback can not be mapped
And I log in as "manager"
And I am on "Course 1" course homepage
And I follow "Another feedback"
And I should not see "Mapped courses"
@javascript
Scenario: Site feedback is not mapped to any course
And I log in as "user1"
And I am on site homepage
And I follow "Course feedback"
And I follow "Answer the questions"
And I should see "Acceptance test site" in the ".feedback_form" "css_element"
And I set the following fields to these values:
| option a | 1 |
| this is a simple multiple choice | option d |
And I press "Submit your answers"
And I press "Continue"
And I am on "Course 1" course homepage
And I click on "Course feedback" "link" in the "Feedback" "block"
And I follow "Answer the questions"
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
And I should see "C1" in the ".feedback_form" "css_element"
And I set the following fields to these values:
| option b | 1 |
| this is a simple multiple choice | option e |
And I press "Submit your answers"
And I press "Continue"
And I click on "Course feedback" "link" in the "Feedback" "block"
And I should not see "Answer the questions"
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And I click on "Course feedback" "link" in the "Feedback" "block"
And I follow "Answer the questions"
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
And I should see "C1" in the ".feedback_form" "css_element"
And I set the following fields to these values:
| option c | 1 |
| this is a simple multiple choice | option e |
And I press "Submit your answers"
And I press "Continue"
And I log out
And I log in as "manager"
And I am on site homepage
And I follow "Course feedback"
And I navigate to "Analysis" in current page administration
And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=option]" "css_element"
And I show chart data for the "multichoicerated" feedback
And I should see "1 (33.33 %)" in the "option a" "table_row"
And I should see "1 (33.33 %)" in the "option b" "table_row"
And I should see "1 (33.33 %)" in the "option c" "table_row"
And I should see "Average: 2.00"
And I follow "Sort by course"
And I should see "2.50" in the "C1" "table_row"
And I should see "1.00" in the "Acceptance test site" "table_row"
And I click on "Back" "link" in the "region-main" "region"
And I set the field "Filter by course" to "Course 1"
And I press "Filter"
And I should see "Course 1" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=option]" "css_element"
And I show chart data for the "multichoicerated" feedback
And I should see "0" in the "option a" "table_row"
And I should see "1 (50.00 %)" in the "option b" "table_row"
And I should see "1 (50.00 %)" in the "option c" "table_row"
And I log out
@javascript
Scenario: Site feedback is mapped to courses
And I log in as "manager"
And I am on site homepage
And I follow "Course feedback"
And I follow "Mapped courses"
And I set the field "Courses" to "Course 2, Course 3"
And I press "Save changes"
And I should see "Course mapping has been changed"
And I log out
And I log in as "user1"
And I am on site homepage
And I follow "Course feedback"
And I should see "You can only access this feedback from a course"
And I should not see "Answer the questions"
And I am on "Course 1" course homepage
And "Feedback" "block" should not exist
And I should not see "Course feedback"
And I am on "Course 2" course homepage
And I click on "Course feedback" "link" in the "Feedback" "block"
And I follow "Answer the questions"
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
And I should see "C2" in the ".feedback_form" "css_element"
And I set the following fields to these values:
| option b | 1 |
| this is a simple multiple choice | option e |
And I press "Submit your answers"
And I press "Continue"
And I click on "Course feedback" "link" in the "Feedback" "block"
And I should not see "Answer the questions"
And I log out
And I log in as "user2"
And I am on "Course 2" course homepage
And I click on "Course feedback" "link" in the "Feedback" "block"
And I follow "Answer the questions"
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
And I should see "C2" in the ".feedback_form" "css_element"
And I set the following fields to these values:
| option c | 1 |
| this is a simple multiple choice | option e |
And I press "Submit your answers"
And I press "Continue"
And I log out
And I log in as "user3"
And I am on "Course 3" course homepage
And I click on "Course feedback" "link" in the "Feedback" "block"
And I follow "Answer the questions"
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
And I should see "C3" in the ".feedback_form" "css_element"
And I set the following fields to these values:
| option c | 1 |
| this is a simple multiple choice | option d |
And I press "Submit your answers"
And I press "Continue"
And I log out
And I log in as "manager"
And I am on site homepage
And I follow "Course feedback"
And I navigate to "Analysis" in current page administration
And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=option]" "css_element"
And I show chart data for the "multichoicerated" feedback
And I should see "0" in the "option a" "table_row"
And I should see "1 (33.33 %)" in the "option b" "table_row"
And I should see "2 (66.67 %)" in the "option c" "table_row"
And I should see "Average: 3.67"
And I click on "Sort by course" "link"
And I should see "3.00" in the "C3" "table_row"
And I should see "2.50" in the "C2" "table_row"
And I click on "Back" "link" in the "region-main" "region"
And I set the field "Filter by course" to "Course 2"
And I press "Filter"
And I show chart data for the "multichoicerated" feedback
And I should see "0" in the "option a" "table_row"
And I should see "1 (50.00 %)" in the "option b" "table_row"
And I should see "1 (50.00 %)" in the "option c" "table_row"
And I show chart data for the "multichoicesimple" feedback
And I should see "2 (100.00 %)" in the "option e" "table_row"
And I set the field "Filter by course" to "Course 3"
And I press "Filter"
And I show chart data for the "multichoicerated" feedback
And I should see "0" in the "option a" "table_row"
And I should see "0" in the "option b" "table_row"
And I should see "1 (100.00 %)" in the "option c" "table_row"
And I show chart data for the "multichoicesimple" feedback
And I should see "1 (100.00 %)" in the "option d" "table_row"
And I follow "Show all"
And I show chart data for the "multichoicesimple" feedback
And I should see "1 (33.33 %)" in the "option d" "table_row"
And I should see "2 (66.67 %)" in the "option e" "table_row"
And I should see "0" in the "option f" "table_row"
Scenario: Site feedback deletion hides feedback block completely
When I log in as "manager"
And I am on site homepage
And I turn editing mode on
And I add the "Feedback" block
And I add the "Main menu" block
And I click on "Delete" "link" in the "Course feedback" activity
And I press "Yes"
And I turn editing mode off
And I am on site homepage
Then "Feedback" "block" should not exist
And I am on "Course 1" course homepage
And "Feedback" "block" should not exist
@@ -0,0 +1,119 @@
@mod @mod_feedback
Feature: Exporting and importing feedbacks
In order to quickly copy feedbacks across courses and sites
As a teacher
I need to be able to export and import feedbacks
Background:
Given the following "users" exist:
| username | firstname | lastname |
| teacher | Teacher | 1 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C1 | editingteacher |
| teacher | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience | C1 | feedback0 |
And I change window size to "large"
Scenario: Export sample feedback and compare with the fixture
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And "Export questions" "link" should not exist in the ".tertiary-navigation" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
| Label | info |
| Information type | Course |
And I add a "Text and media area" question to the feedback with:
| Contents | label text |
And I add a "Longer text answer" question to the feedback with:
| Question | this is a longer text answer |
| Label | longertext |
| Required | 1 |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | option a\noption b\noption c |
And I select "Add a page break" from the "typ" singleselect
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 2 |
| Label | multichoice2 |
| Multiple choice type | Multiple choice - multiple answers |
| Hide the "Not selected" option | Yes |
| Multiple choice values | option d\noption e\noption f |
| Dependence item | multichoice1 |
| Dependence value | option a |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 3 |
| Label | multichoice3 |
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
| Multiple choice values | option g\noption h\noption i |
And I add a "Multiple choice (rated)" question to the feedback with:
| Question | this is a multiple choice rated |
| Label | multichoice4 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | 0/option k\n1/option l\n5/option m |
And I add a "Numeric answer" question to the feedback with:
| Question | this is a numeric answer |
| Label | numeric |
| Range to | 100 |
And I add a "Short text answer" question to the feedback with:
| Question | this is a short text answer |
| Label | shorttext |
| Maximum characters accepted | 200 |
Then following "Export questions" should export feedback identical to "mod/feedback/tests/fixtures/testexport.xml"
And I log out
@javascript @_file_upload
Scenario: Import feedback deleting old items
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Numeric answer" question to the feedback with:
| Question | Existing question |
| Label | numeric |
| Range to | 100 |
And I select "Import questions" from the "jump" singleselect
And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager
And I press "Save"
And I select "Add question" from the "jump" singleselect
Then I should not see "Existing question"
And I should see "this is an information question"
And I should see "label text"
And I should see "this is a longer text answer"
And I should see "this is a multiple choice 1"
And I should see "this is a multiple choice 2"
And I should see "this is a multiple choice 3"
And I should see "this is a multiple choice rated"
And I should see "this is a numeric answer"
And I should see "this is a short text answer"
@javascript @_file_upload
Scenario: Import feedback appending new items
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Numeric answer" question to the feedback with:
| Question | Existing question |
| Label | numeric |
| Range to | 100 |
And I select "Import questions" from the "jump" singleselect
And I set the field "Append new items" to "1"
And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager
And I press "Save"
And I select "Add question" from the "jump" singleselect
Then I should see "Existing question"
And "Existing question" "text" should appear before "this is an information question" "text"
And I should see "this is an information question"
And I should see "label text"
And I should see "this is a longer text answer"
And I should see "this is a multiple choice 1"
And I should see "this is a multiple choice 2"
And I should see "this is a multiple choice 3"
And I should see "this is a multiple choice rated"
And I should see "this is a numeric answer"
And I should see "this is a short text answer"
@@ -0,0 +1,67 @@
@mod @mod_feedback @core_completion
Feature: View activity completion in the feedback activity
In order to have visibility of feedback completion requirements
As a student
I need to be able to view my feedback completion progress
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activity" exists:
| activity | feedback |
| course | C1 |
| idnumber | mh1 |
| name | Music history |
| section | 1 |
| completion | 2 |
| completionview | 1 |
| completionsubmit | 1 |
And I am on the "Music history" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | What is your favourite instrument |
| Label | instrument1 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | drums\guitar\hurdygurdy |
And I log out
Scenario: View automatic completion items as a teacher
When I am on the "Music history" "feedback activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Submit feedback" completion condition
Scenario: View automatic completion items as a student
Given I am on the "Music history" "feedback activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "todo"
And the "Submit feedback" completion condition of "Music history" is displayed as "todo"
When I follow "Answer the questions"
And I set the field "drums" to "1"
And I press "Submit your answers"
And I press "Continue"
And I am on the "Music history" "feedback activity" page
Then the "View" completion condition of "Music history" is displayed as "done"
And the "Submit feedback" completion condition of "Music history" is displayed as "done"
@javascript
Scenario: Use manual completion
Given I am on the "Music history" "feedback activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Students must manually mark the activity as done" to "1"
And I press "Save and display"
# Teacher view.
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I am on the "Music history" "feedback activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
@@ -0,0 +1,51 @@
@mod @mod_feedback
Feature: Feedback with no calendar capabilites
In order to allow work effectively
As a teacher
I need to be able to create feedbacks even when I cannot edit calendar events
Background:
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I am on the "Course 1" "permissions" page
And I override the system permissions of "Teacher" role with:
| capability | permission |
| moodle/calendar:manageentries | Prohibit |
And I log out
Scenario: Editing a feedback
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| feedback | Test feedback name | Test feedback description | C1 | feedback1 |
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Test feedback name"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_timeopen_enabled | 1 |
| id_timeopen_day | 1 |
| id_timeopen_month | 1 |
| id_timeopen_year | 2017 |
| id_timeclose_enabled | 1 |
| id_timeclose_day | 1 |
| id_timeclose_month | 2 |
| id_timeclose_year | 2017 |
And I press "Save and return to course"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test feedback name"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_timeopen_year | 2018 |
| id_timeclose_year | 2018 |
And I press "Save and return to course"
Then I should see "Test feedback name"
+267
View File
@@ -0,0 +1,267 @@
@mod @mod_feedback
Feature: Feedbacks in courses with groups
In order to collect feedbacks per group
As an teacher
I need to be able to filter feedback replies by groups
Background:
Given the following "users" exist:
| username | firstname | lastname |
| user1 | Username | 1 |
| user2 | Username | 2 |
| user3 | Username | 3 |
| user4 | Username | 4 |
| user5 | Username | 5 |
| user6 | Username | 6 |
| user7 | Username | 7 |
| user8 | Username | 8 |
| teacher | Teacher | T |
| manager | Manager | M |
And the following "courses" exist:
| fullname | shortname | groupmode |
| Course 1 | C1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | student |
| user2 | C1 | student |
| user3 | C1 | student |
| user4 | C1 | student |
| user5 | C1 | student |
| user6 | C1 | student |
| user7 | C1 | student |
| user8 | C1 | student |
| teacher | C1 | editingteacher |
And the following "groups" exist:
| name | course | idnumber | participation |
| Group 1 | C1 | G1 | 1 |
| Group 2 | C1 | G2 | 1 |
| Group 3 | C1 | G3 | 0 |
And the following "group members" exist:
| user | group |
| user1 | G1 |
| user2 | G1 |
| user2 | G2 |
| user3 | G2 |
| user4 | G1 |
| user5 | G1 |
| user6 | G2 |
| user8 | G3 |
And the following "system role assigns" exist:
| user | course | role |
| manager | Acceptance test site | manager |
And the following "activities" exist:
| activity | name | course | idnumber | anonymous | publish_stats | groupmode | section |
| feedback | Site feedback | Acceptance test site | feedback0 | 2 | 1 | 1 | 1 |
| feedback | Course feedback | C1 | feedback1 | 2 | 1 | 1 | 0 |
| feedback | Course anon feedback | C1 | feedback2 | 1 | 1 | 1 | 0 |
@javascript
Scenario: Non anonymous feedback with groups in a course
Given the following "mod_feedback > question" exists:
| activity | feedback1 |
| name | Do you like this course? |
| questiontype | multichoice |
| label | multichoice1 |
| subtype | r |
| hidenoselect | 1 |
| values | Yes of course\nNot at all\nI don't know |
And the following "mod_feedback > responses" exist:
| activity | user | Do you like this course? |
| feedback1 | user1 | Not at all |
| feedback1 | user2 | I don't know |
| feedback1 | user3 | Not at all |
| feedback1 | user4 | Yes of course |
| feedback1 | user5 | Yes of course |
| feedback1 | user6 | Not at all |
| feedback1 | user7 | I don't know |
| feedback1 | user8 | Yes of course |
# View analysis, user1 should only see one group - group 1
When I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Analysis"
And I should see "Separate groups: Group 1"
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user3 should only see one group - group 2
And I am on the "Course feedback" "feedback activity" page logged in as user3
And I follow "Analysis"
And I should see "Separate groups: Group 2"
And I show chart data for the "multichoice1" feedback
And I should see "0" in the "Yes of course" "table_row"
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user2 should see a group selector and be able to change the group but not view all.
And I am on the "Course feedback" "feedback activity" page logged in as user2
And I follow "Analysis"
And the field "Separate groups" matches value "Group 1"
And I should not see "Group 3" in the "Separate groups" "select"
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I select "Group 2" from the "Separate groups" singleselect
And I show chart data for the "multichoice1" feedback
And I should see "0" in the "Yes of course" "table_row"
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
And the "Separate groups" select box should not contain "All participants"
And I log out
# User without group can see all participants only
And I am on the "Course feedback" "feedback activity" page logged in as user7
And I follow "Analysis"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
And I log out
# User in non-participation group sees the same as no groups
And I am on the "Course feedback" "feedback activity" page logged in as user8
And I follow "Analysis"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
And I log out
# Teacher can browse everybody
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I navigate to "Analysis" in current page administration
And the field "Separate groups" matches value "All participants"
And I should not see "Group 3" in the "Separate groups" "select"
And I show chart data for the "multichoice1" feedback
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
And I select "Group 1" from the "Separate groups" singleselect
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I select "Group 2" from the "Separate groups" singleselect
And I show chart data for the "multichoice1" feedback
And I should see "0" in the "Yes of course" "table_row"
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
And I am on the "Course feedback" "feedback activity" page
And I navigate to "Responses" in current page administration
And the field "Separate groups" matches value "Group 2"
And I should not see "Username 1"
And I should see "Username 3"
And I select "Group 1" from the "Separate groups" singleselect
And I should see "Username 1"
And I should not see "Username 3"
And I select "All participants" from the "Separate groups" singleselect
And I should see "Username 1"
And I should see "Username 3"
@javascript
Scenario: Anonymous feedback with groups in a course - insufficient responses
Given the following "mod_feedback > question" exists:
| activity | feedback2 |
| name | Do you like this course? |
| questiontype | multichoice |
| label | multichoice1 |
| subtype | r |
| hidenoselect | 1 |
| values | Yes of course\nNot at all\nI don't know |
And the following "mod_feedback > responses" exist:
| activity | user | Do you like this course? |
| feedback2 | user1 | Not at all |
When I am on the "Course anon feedback" "feedback activity" page logged in as user1
And I follow "Analysis"
Then I should not see "Yes of course"
And I should see "There are insufficient responses for this group"
@javascript
Scenario: Anonymous feedback with groups in a course
Given the following "mod_feedback > question" exists:
| activity | feedback2 |
| name | Do you like this course? |
| questiontype | multichoice |
| label | multichoice1 |
| subtype | r |
| hidenoselect | 1 |
| values | Yes of course\nNot at all\nI don't know |
And the following "mod_feedback > responses" exist:
| activity | user | Do you like this course? |
| feedback2 | user1 | Not at all |
| feedback2 | user2 | I don't know |
| feedback2 | user3 | Not at all |
| feedback2 | user4 | Yes of course |
| feedback2 | user5 | Yes of course |
| feedback2 | user6 | Not at all |
| feedback2 | user7 | I don't know |
| feedback2 | user8 | Yes of course |
# View analysis, user1 should only see one group - group 1
When I am on the "Course anon feedback" "feedback activity" page logged in as user1
And I follow "Analysis"
And I should see "Separate groups: Group 1"
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user3 should only see one group - group 2
And I am on the "Course anon feedback" "feedback activity" page logged in as user3
And I follow "Analysis"
And I should see "Separate groups: Group 2"
And I show chart data for the "multichoice1" feedback
And I should see "0" in the "Yes of course" "table_row"
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user2 should see a group selector and be able to change the group but not view all.
And I am on the "Course anon feedback" "feedback activity" page logged in as user2
And I follow "Analysis"
And the field "Separate groups" matches value "Group 1"
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I select "Group 2" from the "Separate groups" singleselect
And I show chart data for the "multichoice1" feedback
And I should see "0" in the "Yes of course" "table_row"
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
And the "Separate groups" select box should not contain "All participants"
And I log out
# User without group can see all participants only
And I am on the "Course anon feedback" "feedback activity" page logged in as user7
And I follow "Analysis"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
And I log out
# User in non-participation group is the same as no groups.
And I am on the "Course anon feedback" "feedback activity" page logged in as user8
And I follow "Analysis"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
And I log out
# Teacher can browse everybody
And I am on the "Course anon feedback" "feedback activity" page logged in as teacher
And I navigate to "Analysis" in current page administration
And the field "Separate groups" matches value "All participants"
And I show chart data for the "multichoice1" feedback
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
And I select "Group 1" from the "Separate groups" singleselect
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I select "Group 2" from the "Separate groups" singleselect
And I show chart data for the "multichoice1" feedback
And I should see "0" in the "Yes of course" "table_row"
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
And I am on the "Course anon feedback" "feedback activity" page
And I navigate to "Responses" in current page administration
# The response numbers were randomly allocated, we only can assert the number of visible responses here:
And the field "Separate groups" matches value "Group 2"
And "//tr[contains(@id,'_r2') and contains(.,'Response number')]" "xpath_element" should exist
And "//tr[contains(@id,'_r3') and contains(@class,'emptyrow')]" "xpath_element" should exist
And I select "Group 1" from the "Separate groups" singleselect
And "//tr[contains(@id,'_r3') and contains(.,'Response number')]" "xpath_element" should exist
And "//tr[contains(@id,'_r4') and contains(@class,'emptyrow')]" "xpath_element" should exist
And I select "All participants" from the "Separate groups" singleselect
And "//tr[contains(@id,'_r7') and contains(.,'Response number')]" "xpath_element" should exist
And "//tr[contains(@id,'_r8') and contains(@class,'emptyrow')]" "xpath_element" should exist
@@ -0,0 +1,422 @@
@mod @mod_feedback
Feature: Testing multichoice questions in feedback
In order to create feedbacks
As a teacher
I need to be able to create different types of multichoice questions
Background:
Given the following "users" exist:
| username | firstname | lastname |
| teacher1 | Teacher | 1 |
| student1 | Student | 1 |
| student2 | Student | 2 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience | C1 | feedback0 |
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
@javascript
Scenario: Non-rated single-answer multiple choice questions in feedback
When I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | option a\noption b\noption c |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the first page of the feedback |
And I select "Add a page break" from the "typ" singleselect
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 2 |
| Label | multichoice2 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | option d\noption e\noption f |
| Required | 1 |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the second page of the feedback |
And I select "Add a page break" from the "typ" singleselect
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 3 |
| Label | multichoice3 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | option g\noption h\noption i |
| Hide the "Not selected" option | Yes |
| Dependence item | multichoice2 |
| Dependence value | option d |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the third page of the feedback |
And I log out
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
Then the following fields match these values:
| Not selected | 1 |
| option a | 0 |
| option b | 0 |
| option c | 0 |
And "Previous page" "button" should not exist
And "Submit your answers" "button" should not exist
And I should see "this is the first page of the feedback"
And I should not see "this is the second page of the feedback"
And I should not see "this is the third page of the feedback"
And I press "Next page"
# Examine the second page, select nothing, try to go to the next page
And I should see "Not selected"
And the following fields match these values:
| Not selected | 1 |
| option d | 0 |
| option e | 0 |
| option f | 0 |
And "Previous page" "button" should exist
And "Submit your answers" "button" should not exist
And I should not see "this is the first page of the feedback"
And I should see "this is the second page of the feedback"
And I should not see "this is the third page of the feedback"
And I press "Next page"
# We are still on the second page because the field is required
And I should see "Required" in the "form" "css_element"
And I should see "this is the second page of the feedback"
And I set the field "option e" to "1"
And the following fields match these values:
| Not selected | 0 |
| option d | 0 |
| option e | 1 |
| option f | 0 |
And I press "Next page"
# Now we are on the third page, element is not shown because of wrong dependency.
And I should see "this is the third page of the feedback"
And I should not see "this is a multiple choice 3"
# Go back, check that values are preserved and change the option to enable dependency.
And I press "Previous page"
And the following fields match these values:
| Not selected | 0 |
| option d | 0 |
| option e | 1 |
| option f | 0 |
And I set the field "option d" to "1"
And I press "Next page"
# Now third page contains all items.
And I should see "this is a multiple choice 3"
And I should see "this is the third page of the feedback"
And I should not see "Not selected"
And the following fields match these values:
| option g | 0 |
| option h | 0 |
| option i | 0 |
And "Previous page" "button" should exist
And "Next page" "button" should not exist
And "Submit your answers" "button" should exist
And I set the field "option i" to "1"
And I press "Submit your answers"
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "option a" to "1"
And I press "Next page"
And I set the field "option d" to "1"
And I press "Next page"
And I set the field "option g" to "1"
And I press "Previous page"
And I set the field "option f" to "1"
And I press "Next page"
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
And I show chart data for the "multichoice1" feedback
And I should see "1 (50.00 %)" in the "option a" "table_row"
And I should not see "%" in the "option b" "table_row"
And I should not see "%" in the "option c" "table_row"
And I show chart data for the "multichoice2" feedback
And I should see "1 (50.00 %)" in the "option d" "table_row"
And I should not see "%" in the "option e" "table_row"
And I should see "1 (50.00 %)" in the "option f" "table_row"
And I show chart data for the "multichoice3" feedback
And I should not see "%" in the "option g" "table_row"
And I should not see "%" in the "option h" "table_row"
And I should see "1 (100.00 %)" in the "option i" "table_row"
# Change the settings so we don't analyse empty submits
And I am on the "Learning experience" "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I choose "Edit question" in the open action menu
And I set the field "Omit empty submits in analysis" to "Yes"
And I press "Save changes to question"
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Analysis" in current page administration
And I show chart data for the "multichoice1" feedback
And I should see "1 (100.00 %)" in the "option a" "table_row"
And I should not see "%" in the "option b" "table_row"
And I should not see "%" in the "option c" "table_row"
And I log out
@javascript
Scenario: Non-rated multiple-answers multiple choice questions in feedback
# Create a feedback with three pages, required and dependent questions.
When I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - multiple answers |
| Multiple choice values | option a\noption b\noption c |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the first page of the feedback |
And I select "Add a page break" from the "typ" singleselect
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 2 |
| Label | multichoice2 |
| Multiple choice type | Multiple choice - multiple answers |
| Multiple choice values | option d\noption e\noption f |
| Required | 1 |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the second page of the feedback |
And I select "Add a page break" from the "typ" singleselect
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 3 |
| Label | multichoice3 |
| Multiple choice type | Multiple choice - multiple answers |
| Multiple choice values | option g\noption h\noption i |
| Dependence item | multichoice2 |
| Dependence value | option d |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the third page of the feedback |
And I log out
# Login as the first student.
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
And I should not see "Not selected"
And the following fields match these values:
| option a | 0 |
| option b | 0 |
| option c | 0 |
And "Previous page" "button" should not exist
And "Submit your answers" "button" should not exist
And I should see "this is the first page of the feedback"
And I should not see "this is the second page of the feedback"
And I should not see "this is the third page of the feedback"
And I press "Next page"
# Examine the second page, select nothing, try to go to the next page
Then I should not see "Not selected"
And the following fields match these values:
| option d | 0 |
| option e | 0 |
| option f | 0 |
And "Previous page" "button" should exist
And "Submit your answers" "button" should not exist
And I should not see "this is the first page of the feedback"
And I should see "this is the second page of the feedback"
And I should not see "this is the third page of the feedback"
And I press "Next page"
# We are still on the second page because the field is required
And I should see "Required" in the "form" "css_element"
And I should see "this is the second page of the feedback"
And I set the field "option e" to "1"
And I set the field "option f" to "1"
And the following fields match these values:
| option d | 0 |
| option e | 1 |
| option f | 1 |
And I press "Next page"
# Now we are on the third page, element is not shown because of wrong dependency.
And I should see "this is the third page of the feedback"
And I should not see "this is a multiple choice 3"
# Go back, check that values are preserved and change the option to enable dependency.
And I press "Previous page"
And the following fields match these values:
| option d | 0 |
| option e | 1 |
| option f | 1 |
And I set the field "option d" to "1"
And I set the field "option e" to "0"
And I press "Next page"
# Now third page contains all items.
And I should see "this is a multiple choice 3"
And I should see "this is the third page of the feedback"
And the following fields match these values:
| option g | 0 |
| option h | 0 |
| option i | 0 |
And "Previous page" "button" should exist
And "Next page" "button" should not exist
And "Submit your answers" "button" should exist
And I set the field "option i" to "1"
And I press "Submit your answers"
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "option a" to "1"
And I set the field "option b" to "1"
And I press "Next page"
And I set the field "option d" to "1"
And I press "Next page"
And I set the field "option g" to "1"
And I press "Previous page"
And I set the field "option d" to "0"
And I set the field "option f" to "1"
And I press "Next page"
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
And I show chart data for the "multichoice1" feedback
And I should see "1 (50.00 %)" in the "option a" "table_row"
And I should see "1 (50.00 %)" in the "option b" "table_row"
And I should not see "%" in the "option c" "table_row"
And I show chart data for the "multichoice2" feedback
And I should see "1 (50.00 %)" in the "option d" "table_row"
And I should not see "%" in the "option e" "table_row"
And I should see "2 (100.00 %)" in the "option f" "table_row"
And I show chart data for the "multichoice3" feedback
And I should not see "%" in the "option g" "table_row"
And I should not see "%" in the "option h" "table_row"
And I should see "1 (100.00 %)" in the "option i" "table_row"
# Change the settings so we don't analyse empty submits
And I am on the "Learning experience" "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I choose "Edit question" in the open action menu
And I set the field "Omit empty submits in analysis" to "Yes"
And I press "Save changes to question"
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Analysis" in current page administration
And I show chart data for the "multichoice1" feedback
And I should see "1 (100.00 %)" in the "option a" "table_row"
And I should see "1 (100.00 %)" in the "option b" "table_row"
And I should not see "%" in the "option c" "table_row"
And I log out
@javascript
Scenario: Non-rated single-answer dropdown multiple choice questions in feedback
When I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
| Multiple choice values | option a\noption b\noption c |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the first page of the feedback |
And I select "Add a page break" from the "typ" singleselect
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 2 |
| Label | multichoice2 |
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
| Multiple choice values | option d\noption e\noption f |
| Required | 1 |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the second page of the feedback |
And I select "Add a page break" from the "typ" singleselect
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 3 |
| Label | multichoice3 |
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
| Multiple choice values | option g\noption h\noption i |
| Dependence item | multichoice2 |
| Dependence value | option d |
And I add a "Text and media area" question to the feedback with:
| Contents | this is the third page of the feedback |
And I log out
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
Then the following fields match these values:
| this is a multiple choice 1 | 0 |
And "Previous page" "button" should not exist
And "Submit your answers" "button" should not exist
And I should see "this is the first page of the feedback"
And I should not see "this is the second page of the feedback"
And I should not see "this is the third page of the feedback"
And I press "Next page"
# Examine the second page, select nothing, try to go to the next page
And the following fields match these values:
| this is a multiple choice 2 | 0 |
And "Previous page" "button" should exist
And "Submit your answers" "button" should not exist
And I should not see "this is the first page of the feedback"
And I should see "this is the second page of the feedback"
And I should not see "this is the third page of the feedback"
And I press "Next page"
# We are still on the second page because the field is required
And I should see "Required" in the "form" "css_element"
And I should see "this is the second page of the feedback"
And I set the field "this is a multiple choice 2" to "option e"
And I press "Next page"
# Now we are on the third page, element is not shown because of wrong dependency.
And I should see "this is the third page of the feedback"
And I should not see "this is a multiple choice 3"
# Go back, check that values are preserved and change the option to enable dependency.
And I press "Previous page"
And the following fields match these values:
| this is a multiple choice 2 | option e |
And I set the field "this is a multiple choice 2" to "option d"
And I press "Next page"
# Now third page contains all items.
And I should see "this is the third page of the feedback"
And the following fields match these values:
| this is a multiple choice 3 | 0 |
And "Previous page" "button" should exist
And "Next page" "button" should not exist
And "Submit your answers" "button" should exist
And I set the field "this is a multiple choice 3" to "option i"
And I press "Submit your answers"
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "this is a multiple choice 1" to "option a"
And I press "Next page"
And I set the field "this is a multiple choice 2" to "option d"
And I press "Next page"
And I set the field "this is a multiple choice 3" to "option g"
And I press "Previous page"
And I set the field "this is a multiple choice 2" to "option f"
And I press "Next page"
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
And I show chart data for the "multichoice1" feedback
And I should see "1 (50.00 %)" in the "option a" "table_row"
And I should not see "%" in the "option b" "table_row"
And I should not see "%" in the "option c" "table_row"
And I show chart data for the "multichoice2" feedback
And I should see "1 (50.00 %)" in the "option d" "table_row"
And I should not see "%" in the "option e" "table_row"
And I should see "1 (50.00 %)" in the "option f" "table_row"
And I show chart data for the "multichoice3" feedback
And I should not see "%" in the "option g" "table_row"
And I should not see "%" in the "option h" "table_row"
And I should see "1 (100.00 %)" in the "option i" "table_row"
# Change the settings so we don't analyse empty submits
And I am on the "Learning experience" "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I choose "Edit question" in the open action menu
And I set the field "Omit empty submits in analysis" to "Yes"
And I press "Save changes to question"
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Analysis" in current page administration
And I show chart data for the "multichoice1" feedback
And I should see "1 (100.00 %)" in the "option a" "table_row"
And I should not see "%" in the "option b" "table_row"
And I should not see "%" in the "option c" "table_row"
@@ -0,0 +1,61 @@
@mod @mod_feedback
Feature: Non anonymous feedback with multiple submissions
In order to modify feedback response
As a student
I need to be able to see previous response when I re-submit feedback
Background:
Given the following "users" exist:
| username | firstname | lastname |
| user1 | Username | 1 |
| user2 | Username | 2 |
| teacher | Teacher | 3 |
| manager | Manager | 4 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | student |
| user2 | C1 | student |
| teacher | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | anonymous | publish_stats | multiple_submit | section |
| feedback | Course feedback | C1 | feedback1 | 2 | 1 | 1 | 0 |
Scenario: Completing a feedback second time
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Short text answer" question to the feedback with:
| Question | first |
| Label | shorttext1 |
| Maximum characters accepted | 200 |
And I add a page break to the feedback
And I add a "Short text answer" question to the feedback with:
| Question | second |
| Label | shorttext2 |
| Maximum characters accepted | 200 |
And I log out
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I follow "Answer the questions"
And I set the following fields to these values:
| first | 111 |
And I press "Next"
And I set the following fields to these values:
| second | 222 |
And I press "Submit your answers"
And I log out
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I follow "Answer the questions"
Then the field "first" matches value "111"
And I press "Next"
And the field "second" matches value "222"
And I set the following fields to these values:
| second | 333 |
And I press "Submit your answers"
@@ -0,0 +1,152 @@
@mod @mod_feedback
Feature: Non anonymous feedback
In order to collect feedbacks
As an teacher
I need to be able to create and collect feedbacks
Background:
Given the following "users" exist:
| username | firstname | lastname |
| user1 | Username | 1 |
| user2 | Username | 2 |
| teacher | Teacher | 3 |
| manager | Manager | 4 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | student |
| user2 | C1 | student |
| teacher | C1 | editingteacher |
And the following "system role assigns" exist:
| user | course | role |
| manager | Acceptance test site | manager |
And the following "activities" exist:
| activity | name | course | idnumber | anonymous | publish_stats | section |
| feedback | Site feedback | Acceptance test site | feedback0 | 2 | 1 | 1 |
| feedback | Course feedback | C1 | feedback1 | 2 | 1 | 0 |
When I am on the "Site feedback" "feedback activity" page logged in as manager
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like our site? |
| Label | multichoice2 |
| Multiple choice type | Multiple choice - single answer |
| Hide the "Not selected" option | Yes |
| Multiple choice values | Yes of course\nNot at all\nI don't know |
And I log out
Scenario: Guests can see non anonymous feedback on front page but can not complete
When I am on the "Site feedback" "feedback activity" page
Then I should not see "Answer the questions"
And I should not see "Preview questions"
Scenario: Complete non anonymous feedback on the front page as an authenticated user
When I am on the "Site feedback" "feedback activity" page logged in as user1
And I should not see "Preview questions"
And I follow "Answer the questions"
And I should see "Do you like our site?"
And I set the following fields to these values:
| Yes of course | 1 |
And I press "Submit your answers"
And I should not see "Analysis"
And I press "Continue"
@javascript
Scenario: Complete non anonymous feedback and view analysis on the front page as an authenticated user
Given the following "role capability" exists:
| role | frontpage |
| mod/feedback:viewanalysepage | allow |
When I am on the "Site feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I should see "Do you like our site?"
And I set the following fields to these values:
| Yes of course | 1 |
And I press "Submit your answers"
And I log out
And I am on the "Site feedback" "feedback activity" page logged in as user2
And I follow "Answer the questions"
And I set the following fields to these values:
| Not at all | 1 |
And I press "Submit your answers"
And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
And I show chart data for the "multichoice2" feedback
And I should see "Do you like our site?"
And I should see "1 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (50.00 %)" in the "Not at all" "table_row"
And I log out
And I am on the "Site feedback" "feedback activity" page logged in as manager
And I navigate to "Responses" in current page administration
And I should see "Username"
And I should see "Non anonymous entries (2)"
And I should not see "Anonymous entries"
And I click on "," "link" in the "Username 1" "table_row"
And I should see "(Username 1)"
And I should see "Yes of course"
And I log out
@javascript
Scenario: Non anonymous feedback in a course
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - single answer |
| Hide the "Not selected" option | Yes |
| Multiple choice values | Yes of course\nNot at all\nI don't know |
And I log out
When I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I should see "Do you like this course?"
And I set the following fields to these values:
| Yes of course | 1 |
And I press "Submit your answers"
And I log out
When I am on the "Course feedback" "feedback activity" page logged in as user2
And I follow "Answer the questions"
And I should see "Do you like this course?"
And I set the following fields to these values:
| Not at all | 1 |
And I press "Submit your answers"
And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303
And I show chart data for the "multichoice1" feedback
And I should see "Do you like this course?"
And I should see "1 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (50.00 %)" in the "Not at all" "table_row"
And I log out
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Preview"
And I should see "Do you like this course?"
And I press "Continue"
And I should not see "Answer the questions"
And I navigate to "Responses" in current page administration
And I should see "Non anonymous entries (2)"
And I should not see "Anonymous"
And I click on "," "link" in the "Username 1" "table_row"
And I should see "(Username 1)"
And I should see "Yes of course"
And I should not see "Prev"
And I follow "Next"
And I should see "(Username 2)"
And I should not see "Next"
And I should see "Prev"
And I click on "Back" "link" in the "region-main" "region"
# Sort the feedback responses.
And I click on "Do you like this course?" "link" in the "generaltable" "table"
And "Username 1" "table_row" should appear before "Username 2" "table_row"
# Now sort descending.
And I click on "Do you like this course?" "link" in the "generaltable" "table"
And "Username 2" "table_row" should appear before "Username 1" "table_row"
# Delete non anonymous response
And I click on "Delete entry" "link" in the "Username 1" "table_row"
And I press "Yes"
And I should see "Non anonymous entries (1)"
And I should not see "Username 1"
And I should see "Username 2"
@@ -0,0 +1,47 @@
@mod @mod_feedback
Feature: Preview feedback questions
In order to view the feedback questions
As a teacher
I need to be able to preview them
Background:
Given the following "users" exist:
| username | firstname | lastname |
| student | Student | User |
| editingteacher | Editing | Teacher |
| teacher | NonEditing | Teacher |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| student | C1 | student |
| editingteacher | C1 | editingteacher |
| teacher | C1 | teacher |
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Music history | C1 | feedback0 |
And I am on the "Music history" "feedback activity" page logged in as editingteacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | What is your favourite instrument |
| Label | instrument1 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | drums\guitar\hurdygurdy |
And I log out
Scenario: Students cannot see the Preview questions button
When I am on the "Music history" "feedback activity" page logged in as student
Then I should not see "Preview questions"
Scenario: Non-editing teachers can see the Preview questions button
When I am on the "Music history" "feedback activity" page logged in as teacher
Then I should see "Preview questions"
And I follow "Preview questions"
And I should see "What is your favourite instrument"
Scenario: Editing teachers can see the Preview questions button
When I am on the "Music history" "feedback activity" page logged in as editingteacher
Then I should see "Preview questions"
And I follow "Preview questions"
And I should see "What is your favourite instrument"
@@ -0,0 +1,124 @@
@mod @mod_feedback
Feature: Test creating different types of feedback questions for anonymous feedback
In order to create feedbacks
As a teacher
I need to be able to add different question types
@javascript
Scenario: Create different types of questions in anonymous feedback with javascript enabled
Given the following "users" exist:
| username | firstname | lastname |
| teacher1 | Teacher | 1 |
| student1 | Student | 1 |
| student2 | Student | 2 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience | C1 | feedback0 |
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
| Label | info |
| Information type | Course |
And I add a "Text and media area" question to the feedback with:
| Contents | label text |
And I add a "Longer text answer" question to the feedback with:
| Question | this is a longer text answer |
| Label | longertext |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | option a\noption b\noption c |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 2 |
| Label | multichoice2 |
| Multiple choice type | Multiple choice - multiple answers |
| Multiple choice values | option d\noption e\noption f |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 3 |
| Label | multichoice3 |
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
| Multiple choice values | option g\noption h\noption i |
And I add a "Multiple choice (rated)" question to the feedback with:
| Question | this is a multiple choice rated |
| Label | multichoice4 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | 0/option k\n1/option l\n5/option m |
And I add a "Numeric answer" question to the feedback with:
| Question | this is a numeric answer |
| Label | numeric |
| Range from | 0 |
| Range to | 100 |
And I add a "Short text answer" question to the feedback with:
| Question | this is a short text answer |
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | my long answer |
| option b | 1 |
| option d | 1 |
| option f | 1 |
| this is a multiple choice 3 | option h |
| option l | 1 |
| this is a numeric answer (0 - 100) | 35 |
| this is a short text answer | hello |
And I press "Submit your answers"
And I log out
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | lots of feedbacks |
| option a | 1 |
| option d | 1 |
| option e | 1 |
| this is a multiple choice 3 | option i |
| option m | 1 |
| this is a numeric answer (0 - 100) | 71 |
| this is a short text answer | no way |
And I press "Submit your answers"
And I log out
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 8"
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Analysis" in current page administration
And I should see "C1" in the "(info)" "table"
And I should see "my long answer" in the "(longertext)" "table"
And I should see "lots of feedbacks" in the "(longertext)" "table"
And I show chart data for the "multichoice2" feedback
And I should see "2 (100.00 %)" in the "option d" "table_row"
And I should see "1 (50.00 %)" in the "option e" "table_row"
And I should see "1 (50.00 %)" in the "option f" "table_row"
And I show chart data for the "multichoice3" feedback
And I should see "0" in the "option g" "table_row"
And I should not see "%" in the "option g" "table_row"
And I should see "1 (50.00 %)" in the "option h" "table_row"
And I should see "1 (50.00 %)" in the "option i" "table_row"
And I show chart data for the "multichoice4" feedback
And I should see "0" in the "option k" "table_row"
And I should not see "%" in the "(0) option k" "table_row"
And I should see "1 (50.00 %)" in the "(1) option l" "table_row"
And I should see "1 (50.00 %)" in the "(5) option m" "table_row"
And I should see "Average: 3.00"
And I should see "35" in the "(numeric)" "table"
And I should see "71" in the "(numeric)" "table"
And I should see "Average: 53.00" in the "(numeric)" "table"
And I should see "no way" in the "(shorttext)" "table"
And I should see "hello" in the "(shorttext)" "table"
And I show chart data for the "multichoice1" feedback
And I should see "1 (50.00 %)" in the "option a" "table_row"
And I should see "1 (50.00 %)" in the "option b" "table_row"
And I log out
@@ -0,0 +1,129 @@
@mod @mod_feedback
Feature: Test creating different types of feedback questions for non-anonymous feedback
In order to create feedbacks
As a teacher
I need to be able to add different question types
@javascript
Scenario: Create different types of questions in non-anonymous feedback with javascript enabled
Given the following "users" exist:
| username | firstname | lastname |
| teacher1 | Teacher | 1 |
| student1 | Student | 1 |
| student2 | Student | 2 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | name | course | idnumber | anonymous |
| feedback | Learning experience | C1 | feedback0 | 2 |
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
| Label | info |
| Information type | Course |
And I add a "Information" question to the feedback with:
| Question | this is a response time question |
| Label | curtime |
| Information type | Responses time |
And I add a "Text and media area" question to the feedback with:
| Contents | label text |
And I add a "Longer text answer" question to the feedback with:
| Question | this is a longer text answer |
| Label | longertext |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | option a\noption b\noption c |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 2 |
| Label | multichoice2 |
| Multiple choice type | Multiple choice - multiple answers |
| Multiple choice values | option d\noption e\noption f |
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 3 |
| Label | multichoice3 |
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
| Multiple choice values | option g\noption h\noption i |
And I add a "Multiple choice (rated)" question to the feedback with:
| Question | this is a multiple choice rated |
| Label | multichoice4 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | 0/option k\n1/option l\n5/option m |
And I add a "Numeric answer" question to the feedback with:
| Question | this is a numeric answer |
| Label | numeric |
| Range from | 0 |
| Range to | 100 |
And I add a "Short text answer" question to the feedback with:
| Question | this is a short text answer |
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
When I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | my long answer |
| option b | 1 |
| option d | 1 |
| option f | 1 |
| this is a multiple choice 3 | option h |
| option l | 1 |
| this is a numeric answer (0 - 100) | 35 |
| this is a short text answer | hello |
And I press "Submit your answers"
And I log out
When I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | lots of feedbacks |
| option a | 1 |
| option d | 1 |
| option e | 1 |
| this is a multiple choice 3 | option i |
| option m | 1 |
| this is a numeric answer (0 - 100) | 71 |
| this is a short text answer | no way |
And I press "Submit your answers"
And I log out
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 9"
And I log out
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "C1" in the "(info)" "table"
And I should see "my long answer" in the "(longertext)" "table"
And I should see "lots of feedbacks" in the "(longertext)" "table"
And I show chart data for the "multichoice2" feedback
And I should see "2 (100.00 %)" in the "option d" "table_row"
And I should see "1 (50.00 %)" in the "option e" "table_row"
And I should see "1 (50.00 %)" in the "option f" "table_row"
And I show chart data for the "multichoice3" feedback
And I should see "0" in the "option g" "table_row"
And I should not see "%" in the "option g" "table_row"
And I should see "1 (50.00 %)" in the "option h" "table_row"
And I should see "1 (50.00 %)" in the "option i" "table_row"
And I show chart data for the "multichoice4" feedback
And I should see "0" in the "(0) option k" "table_row"
And I should not see "%" in the "(0) option k" "table_row"
And I should see "1 (50.00 %)" in the "(1) option l" "table_row"
And I should see "1 (50.00 %)" in the "(5) option m" "table_row"
And I should see "Average: 3.00"
And I should see "35" in the "(numeric)" "table"
And I should see "71" in the "(numeric)" "table"
And I should see "Average: 53.00" in the "(numeric)" "table"
And I should see "no way" in the "(shorttext)" "table"
And I should see "hello" in the "(shorttext)" "table"
And I show chart data for the "multichoice1" feedback
And I should see "1 (50.00 %)" in the "option a" "table_row"
And I should see "1 (50.00 %)" in the "option b" "table_row"
And I log out
@@ -0,0 +1,65 @@
@mod @mod_feedback
Feature: Show users who have not responded to the feedback survey
In order to harass students about completing the feedback
As a teacher
I need to see which students haven't responded
Background:
Given the following "users" exist:
| username | firstname | lastname |
| teacher1 | Teacher | 1 |
| student1 | Student | 1 |
| student2 | Student | 2 |
| student3 | Student | 3 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
And the following "groups" exist:
| course | name | idnumber |
| C1 | G1 | GI1 |
And the following "group members" exist:
| user | group |
| student1 | GI1 |
| student2 | GI1 |
And the following "groupings" exist:
| name | course | idnumber |
| GX1 | C1 | GXI1 |
And the following "grouping groups" exist:
| grouping | group |
| GXI1 | GI1 |
Scenario: See users who have not responded
# Set up a feedback.
When I log in as "teacher1"
And I add a feedback activity to course "Course 1" section "1" and I fill the form with:
| Name | Frogs |
| Description | x |
| Record user names | User's name will be logged and shown with answers |
| Access restrictions | Grouping: GX1 |
And I am on the Frogs "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Short text answer" question to the feedback with:
| Question | Y/N? |
And I log out
# Go in as student 1 and do the feedback.
And I am on the Frogs "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the field "Y/N?" to "Y"
And I press "Submit your answers"
And I log out
# Go in as teacher and check the users who haven't completed it.
And I am on the Frogs "feedback activity" page logged in as teacher1
And I navigate to "Responses" in current page administration
And I select "Show non-respondents" from the "jump" singleselect
# Should only show student 2; not student 1 (they did it) or 3 (not in grouping).
Then I should see "Student 2"
And I should not see "Student 1"
And I should not see "Student 3"
+189
View File
@@ -0,0 +1,189 @@
@mod @mod_feedback
Feature: Saving, using and deleting feedback templates
In order to quickly create feedbacks
As a manager
I need to be able to create feedback templates
Background:
Given the following "users" exist:
| username | firstname | lastname |
| teacher | Teacher | 1 |
| manager | Manager | 1 |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C1 | editingteacher |
| teacher | C2 | editingteacher |
And the following "system role assigns" exist:
| user | course | role |
| manager | Acceptance test site | manager |
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience course 1 | C1 | feedback1 |
| feedback | Another feedback in course 1 | C1 | feedback2 |
| feedback | Learning experience course 2 | C2 | feedback3 |
And I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
| Label | multichoice1 |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | option a\noption b\noption c |
And I log out
@javascript
Scenario: Teacher can save template and re-use it in the same course only
# Go to feedback templates and make sure none exist yet
When I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I select "Use a template" from the "jump" singleselect
Then I should see "No templates available yet"
And "Use a template" "field" should not exist
And "Public" "field" should not exist
And I select "Add question" from the "jump" singleselect
# Save as a course template
And I press "Save as new template"
And I should see "Save as new template" in the ".modal-title" "css_element"
And I should see "Name" in the ".modal-body" "css_element"
And I set the field "Name" to "My first template"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And I should see "Template saved"
And I select "Use a template" from the "jump" singleselect
And I should see "My first template"
# Create a feedback from this template in the same course
And I am on the "Another feedback in course 1" "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I select "Use a template" from the "jump" singleselect
And I follow "My first template"
And I should see "this is a multiple choice 1"
And I press "Use this template"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And I should see "this is a multiple choice 1"
# Make sure this template is not available in another course
And I am on the "Learning experience course 2" "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I select "Use a template" from the "jump" singleselect
And I should see "No templates available yet"
And I log out
@javascript
Scenario: Teacher can append template to existing questions or remove them
# Save feedback as a course template
When I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I press "Save as new template"
And I should see "Save as new template" in the ".modal-title" "css_element"
And I should see "Name" in the ".modal-body" "css_element"
And I set the field "Name" to "My first template"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And I press "Save as new template"
# Add questions to another feedback
And I am on the "Another feedback in course 1" "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | What is your favourite subject |
| Label | subjectchoice |
| Multiple choice type | Multiple choice - single answer |
| Multiple choice values | Maths\bScience\nEnglish\nOther |
# Import template appending items
And I select "Use a template" from the "jump" singleselect
And I follow "My first template"
And I press "Use this template"
And I set the field "Append new items" to "1"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
Then "What is your favourite subject" "text" should appear before "this is a multiple choice 1" "text"
# Import template replacing items
And I select "Use a template" from the "jump" singleselect
And I follow "My first template"
And I press "Use this template"
And I set the field "Delete old items" to "1"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And I should see "this is a multiple choice 1"
And I should not see "What is your favourite subject"
And I should see "this is a multiple choice 1"
@javascript
Scenario: Manager can save template as public and it will be available in any course
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I press "Save as new template"
And I set the field "Name" to "My first template"
And I set the field "Public" to "1"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And I log out
And I am on the "Learning experience course 2" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I select "Use a template" from the "jump" singleselect
And I follow "My first template"
And I should see "this is a multiple choice 1"
And I press "Use this template"
And I set the field "Delete old items" to "1"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
Then I should see "this is a multiple choice 1"
And I log out
@javascript
Scenario: Teacher can delete course templates but can not delete public templates
# Save feedback as both public and course template
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I press "Save as new template"
And I set the field "Name" to "My public template"
And I set the field "Public" to "1"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And I press "Save as new template"
And I set the field "Name" to "My course template"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And I log out
# Login as teacher and try to delete templates
And I am on the "Another feedback in course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I select "Use a template" from the "jump" singleselect
And I follow "My public template"
Then I should not see "Delete"
And I click on "Back" "link" in the ".tertiary-navigation" "css_element"
And "My course template" "text" should exist in the ".coursetemplates" "css_element"
And I follow "My course template"
And I click on "Delete" "link"
And I click on "Yes" "button"
And I should see "Template deleted"
And "My course template" "text" should not exist in the ".coursetemplates" "css_element"
And "No templates available yet" "text" should exist in the ".coursetemplates" "css_element"
And I log out
@javascript
Scenario: Manager can delete both course and public templates
# Save feedback as both public and course template
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I press "Save as new template"
And I set the field "Name" to "My public template"
And I set the field "Public" to "1"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And I press "Save as new template"
And I set the field "Name" to "My course template"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
# Delete course template
And I select "Use a template" from the "jump" singleselect
Then "My public template" "text" should exist in the ".publictemplates" "css_element"
And "My course template" "text" should exist in the ".coursetemplates" "css_element"
And I follow "My course template"
And I click on "Delete" "link"
And I should see "Are you sure you want to delete this template?"
And I press "Yes"
And I should see "Template deleted"
And "My course template" "text" should not exist in the ".coursetemplates" "css_element"
And "No templates available yet" "text" should exist in the ".coursetemplates" "css_element"
And "My public template" "text" should exist in the ".publictemplates" "css_element"
And I follow "My public template"
And I click on "Delete" "link"
And I should see "Are you sure you want to delete this template?"
And I press "Yes"
And I should see "Template deleted"
And "My public template" "text" should not exist in the ".publictemplates" "css_element"
And "No templates available yet" "text" should exist in the ".publictemplates" "css_element"
And I should see "No templates available yet"
And I log out