mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-76169-master' of https://github.com/andrewnicols/moodle
This commit is contained in:
commit
add46e3112
42 changed files with 462 additions and 395 deletions
|
@ -224,6 +224,22 @@ trait behat_session_trait {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a description of the selector and locator to use in an exception message.
|
||||||
|
*
|
||||||
|
* @param string $selector The type of locator
|
||||||
|
* @param mixed $locator The locator text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function get_selector_description(string $selector, $locator): string {
|
||||||
|
if ($selector === 'NodeElement') {
|
||||||
|
$description = $locator->getText();
|
||||||
|
return "'{$description}' {$selector}";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "'{$locator}' {$selector}";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send key presses straight to the currently active element.
|
* Send key presses straight to the currently active element.
|
||||||
*
|
*
|
||||||
|
|
|
@ -86,6 +86,7 @@ class behat_partial_named_selector extends \Behat\Mink\Selector\PartialNamedSele
|
||||||
*/
|
*/
|
||||||
protected static $allowedselectors = array(
|
protected static $allowedselectors = array(
|
||||||
'activity' => 'activity',
|
'activity' => 'activity',
|
||||||
|
'actionmenu' => 'actionmenu',
|
||||||
'badge' => 'badge',
|
'badge' => 'badge',
|
||||||
'block' => 'block',
|
'block' => 'block',
|
||||||
'button' => 'button',
|
'button' => 'button',
|
||||||
|
@ -138,6 +139,17 @@ class behat_partial_named_selector extends \Behat\Mink\Selector\PartialNamedSele
|
||||||
protected static $moodleselectors = array(
|
protected static $moodleselectors = array(
|
||||||
'activity' => <<<XPATH
|
'activity' => <<<XPATH
|
||||||
.//li[contains(concat(' ', normalize-space(@class), ' '), ' activity ')][descendant::*[contains(normalize-space(.), %locator%)]]
|
.//li[contains(concat(' ', normalize-space(@class), ' '), ' activity ')][descendant::*[contains(normalize-space(.), %locator%)]]
|
||||||
|
XPATH
|
||||||
|
, 'actionmenu' => <<<XPATH
|
||||||
|
.//*[
|
||||||
|
contains(concat(' ', normalize-space(@class), ' '), ' action-menu ')
|
||||||
|
and
|
||||||
|
descendant::*[
|
||||||
|
contains(concat(' ', normalize-space(@class), ' '), ' dropdown-toggle ')
|
||||||
|
and
|
||||||
|
contains(normalize-space(.), %locator%)
|
||||||
|
]
|
||||||
|
]
|
||||||
XPATH
|
XPATH
|
||||||
, 'badge' => <<<XPATH
|
, 'badge' => <<<XPATH
|
||||||
.//span[(contains(@class, 'badge')) and text()[contains(., %locator%)]]
|
.//span[(contains(@class, 'badge')) and text()[contains(., %locator%)]]
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
|
|
||||||
require_once(__DIR__ . '/../../behat/behat_base.php');
|
require_once(__DIR__ . '/../../behat/behat_base.php');
|
||||||
|
|
||||||
use Behat\Mink\Exception\ExpectationException as ExpectationException;
|
use Behat\Mink\Element\NodeElement;
|
||||||
use Behat\Mink\Exception\DriverException as DriverException;
|
use Behat\Mink\Exception\DriverException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Steps definitions to open and close action menus.
|
* Steps definitions to open and close action menus.
|
||||||
|
@ -83,4 +83,122 @@ class behat_action_menu extends behat_base {
|
||||||
$this->ensure_node_is_visible($node);
|
$this->ensure_node_is_visible($node);
|
||||||
$node->click();
|
$node->click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select a specific item in an action menu.
|
||||||
|
*
|
||||||
|
* @When /^I choose the "(?P<item_string>(?:[^"]|\\")*)" item in the "(?P<actionmenu_string>(?:[^"]|\\")*)" action menu$/
|
||||||
|
* @param string $item The item to choose
|
||||||
|
* @param string $actionmenu The text used in the description of the action menu
|
||||||
|
*/
|
||||||
|
public function i_choose_in_the_named_menu(string $item, string $actionmenu): void {
|
||||||
|
$menu = $this->find('actionmenu', $actionmenu);
|
||||||
|
$this->select_item_in_action_menu($item, $menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select a specific item in an action menu within a container.
|
||||||
|
*
|
||||||
|
* @When /^I choose the "(?P<item_string>(?:[^"]|\\")*)" item in the "(?P<actionmenu_string>(?:[^"]|\\")*)" action menu of the "(?P<locator_string>(?:[^"]|\\")*)" "(?P<type_string>(?:[^"]|\\")*)"$/
|
||||||
|
* @param string $item The item to choose
|
||||||
|
* @param string $actionmenu The text used in the description of the action menu
|
||||||
|
* @param string|NodeElement $locator The identifer used for the container
|
||||||
|
* @param string $selector The type of container to locate
|
||||||
|
*/
|
||||||
|
public function i_choose_in_the_named_menu_in_container(string $item, string $actionmenu, $locator, $selector): void {
|
||||||
|
$container = $this->find($selector, $locator);
|
||||||
|
$menu = $this->find('actionmenu', $actionmenu, false, $container);
|
||||||
|
$this->select_item_in_action_menu($item, $menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select an item in the specified menu.
|
||||||
|
*
|
||||||
|
* Note: This step does work both with, and without, JavaScript.
|
||||||
|
*
|
||||||
|
* @param string $item Item string value
|
||||||
|
* @param NodeElement $menu The menu NodeElement to select from
|
||||||
|
*/
|
||||||
|
protected function select_item_in_action_menu(string $item, NodeElement $menu): void {
|
||||||
|
if ($this->running_javascript()) {
|
||||||
|
// Open the menu by clicking on the trigger.
|
||||||
|
$this->execute(
|
||||||
|
'behat_general::i_click_on',
|
||||||
|
[$menu, "NodeElement"]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select the menu item.
|
||||||
|
$this->execute(
|
||||||
|
'behat_general::i_click_on_in_the',
|
||||||
|
[$item, "link", $menu, "NodeElement"]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The action menu item should not exist.
|
||||||
|
*
|
||||||
|
* @Then /^the "(?P<item_string>(?:[^"]|\\")*)" item should not exist in the "(?P<actionmenu_string>(?:[^"]|\\")*)" action menu$/
|
||||||
|
* @param string $item The item to check
|
||||||
|
* @param string $actionmenu The text used in the description of the action menu
|
||||||
|
*/
|
||||||
|
public function item_should_not_exist(string $item, string $actionmenu): void {
|
||||||
|
$menu = $this->find('actionmenu', $actionmenu);
|
||||||
|
$this->execute('behat_general::should_not_exist_in_the', [
|
||||||
|
$item, 'link',
|
||||||
|
$menu, 'NodeElement'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The action menu item should not exist within a container.
|
||||||
|
*
|
||||||
|
* @Then /^the "(?P<item_string>(?:[^"]|\\")*)" item should not exist in the "(?P<actionmenu_string>(?:[^"]|\\")*)" action menu of the "(?P<locator_string>(?:[^"]|\\")*)" "(?P<type_string>(?:[^"]|\\")*)"$/
|
||||||
|
* @param string $item The item to check
|
||||||
|
* @param string $actionmenu The text used in the description of the action menu
|
||||||
|
* @param string|NodeElement $locator The identifer used for the container
|
||||||
|
* @param string $selector The type of container to locate
|
||||||
|
*/
|
||||||
|
public function item_should_not_exist_in_the(string $item, string $actionmenu, $locator, $selector): void {
|
||||||
|
$container = $this->find($selector, $locator);
|
||||||
|
$menu = $this->find('actionmenu', $actionmenu, false, $container);
|
||||||
|
$this->execute('behat_general::should_not_exist_in_the', [
|
||||||
|
$item, 'link',
|
||||||
|
$menu, 'NodeElement'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The action menu item should exist.
|
||||||
|
*
|
||||||
|
* @Then /^the "(?P<item_string>(?:[^"]|\\")*)" item should exist in the "(?P<actionmenu_string>(?:[^"]|\\")*)" action menu$/
|
||||||
|
* @param string $item The item to check
|
||||||
|
* @param string $actionmenu The text used in the description of the action menu
|
||||||
|
*/
|
||||||
|
public function item_should_exist(string $item, string $actionmenu): void {
|
||||||
|
$menu = $this->find('actionmenu', $actionmenu);
|
||||||
|
$this->execute('behat_general::should_exist_in_the', [
|
||||||
|
$item, 'link',
|
||||||
|
$menu, 'NodeElement'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The action menu item should exist within a container.
|
||||||
|
*
|
||||||
|
* @Then /^the "(?P<item_string>(?:[^"]|\\")*)" item should exist in the "(?P<actionmenu_string>(?:[^"]|\\")*)" action menu of the "(?P<locator_string>(?:[^"]|\\")*)" "(?P<type_string>(?:[^"]|\\")*)"$/
|
||||||
|
* @param string $item The item to check
|
||||||
|
* @param string $actionmenu The text used in the description of the action menu
|
||||||
|
* @param string|NodeElement $locator The identifer used for the container
|
||||||
|
* @param string $selector The type of container to locate
|
||||||
|
*/
|
||||||
|
public function item_should_exist_in_the(string $item, string $actionmenu, $locator, $selector): void {
|
||||||
|
$container = $this->find($selector, $locator);
|
||||||
|
$menu = $this->find('actionmenu', $actionmenu, false, $container);
|
||||||
|
$this->execute('behat_general::should_exist_in_the', [
|
||||||
|
$item, 'link',
|
||||||
|
$menu, 'NodeElement'
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1225,7 +1225,8 @@ EOF;
|
||||||
$containernode = $this->find($containerselectortype, $containerelement);
|
$containernode = $this->find($containerselectortype, $containerelement);
|
||||||
|
|
||||||
// Specific exception giving info about where can't we find the element.
|
// Specific exception giving info about where can't we find the element.
|
||||||
$locatorexceptionmsg = "{$element} in the {$containerelement} {$containerselectortype}";
|
$containerdescription = $this->get_selector_description($containerselectortype, $containerelement);
|
||||||
|
$locatorexceptionmsg = "{$element} not found in the {$containerdescription}}";
|
||||||
$exception = new ElementNotFoundException($this->getSession(), $selectortype, null, $locatorexceptionmsg);
|
$exception = new ElementNotFoundException($this->getSession(), $selectortype, null, $locatorexceptionmsg);
|
||||||
|
|
||||||
// Looks for the requested node inside the container node.
|
// Looks for the requested node inside the container node.
|
||||||
|
@ -1259,8 +1260,10 @@ EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The element was found and should not have been. Throw an exception.
|
// The element was found and should not have been. Throw an exception.
|
||||||
|
$elementdescription = $this->get_selector_description($selectortype, $element);
|
||||||
|
$containerdescription = $this->get_selector_description($containerselectortype, $containerelement);
|
||||||
throw new ExpectationException(
|
throw new ExpectationException(
|
||||||
"The '{$element}' '{$selectortype}' exists in the '{$containerelement}' '{$containerselectortype}'",
|
"The {$elementdescription} exists in the {$containerdescription}",
|
||||||
$this->getSession()
|
$this->getSession()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,8 +76,7 @@ Feature: Regrading quiz attempts using the Grades report
|
||||||
And I should see "Overall number of students achieving grade ranges"
|
And I should see "Overall number of students achieving grade ranges"
|
||||||
|
|
||||||
Scenario: Dry-run a full regrade, then regrade the attempts that will need it.
|
Scenario: Dry-run a full regrade, then regrade the attempts that will need it.
|
||||||
Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
|
Given I am on the "Quiz for testing regrading" "mod_quiz > edit" page logged in as teacher
|
||||||
When I navigate to "Questions" in current page administration
|
|
||||||
And I follow "Edit question SA"
|
And I follow "Edit question SA"
|
||||||
And I set the field "id_fraction_1" to "50%"
|
And I set the field "id_fraction_1" to "50%"
|
||||||
And I press "id_submitbutton"
|
And I press "id_submitbutton"
|
||||||
|
@ -123,11 +122,11 @@ Feature: Regrading quiz attempts using the Grades report
|
||||||
And I should see "Quiz for testing regrading"
|
And I should see "Quiz for testing regrading"
|
||||||
And I should see "Overall number of students achieving grade ranges"
|
And I should see "Overall number of students achieving grade ranges"
|
||||||
And "Student One" row "Regrade" column of "attempts" table should not contain "Needed"
|
And "Student One" row "Regrade" column of "attempts" table should not contain "Needed"
|
||||||
And I navigate to "Question bank" in current page administration
|
And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
|
||||||
And I choose "Edit question" action for "TF" in the question bank
|
And I choose "Edit question" action for "TF" in the question bank
|
||||||
And I set the field "Correct answer" to "False"
|
And I set the field "Correct answer" to "False"
|
||||||
And I press "id_submitbutton"
|
And I press "id_submitbutton"
|
||||||
And I navigate to "Questions" in current page administration
|
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
||||||
And I set the field "version" in the "TF" "list_item" to "v2 (latest)"
|
And I set the field "version" in the "TF" "list_item" to "v2 (latest)"
|
||||||
And I navigate to "Results" in current page administration
|
And I navigate to "Results" in current page administration
|
||||||
And I press "Dry run a full regrade"
|
And I press "Dry run a full regrade"
|
||||||
|
@ -148,10 +147,10 @@ Feature: Regrading quiz attempts using the Grades report
|
||||||
And I click on "mod-quiz-report-overview-report-selectall-attempts" "checkbox"
|
And I click on "mod-quiz-report-overview-report-selectall-attempts" "checkbox"
|
||||||
And I click on "Delete selected attempts" "button"
|
And I click on "Delete selected attempts" "button"
|
||||||
And I click on "Yes" "button"
|
And I click on "Yes" "button"
|
||||||
And I navigate to "Questions" in current page administration
|
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
||||||
And I should see "(latest)" in the "TF" "list_item"
|
And I should see "(latest)" in the "TF" "list_item"
|
||||||
# Create multiple question versions.
|
# Create multiple question versions.
|
||||||
And I navigate to "Question bank" in current page administration
|
And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
|
||||||
And I choose "Edit question" action for "TF" in the question bank
|
And I choose "Edit question" action for "TF" in the question bank
|
||||||
And I set the field "Correct answer" to "True"
|
And I set the field "Correct answer" to "True"
|
||||||
And I press "id_submitbutton"
|
And I press "id_submitbutton"
|
||||||
|
@ -159,7 +158,7 @@ Feature: Regrading quiz attempts using the Grades report
|
||||||
And I set the field "Question name" to "New version of TF"
|
And I set the field "Question name" to "New version of TF"
|
||||||
And I set the field "Correct answer" to "False"
|
And I set the field "Correct answer" to "False"
|
||||||
And I press "id_submitbutton"
|
And I press "id_submitbutton"
|
||||||
And I navigate to "Questions" in current page administration
|
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
||||||
And I should see "(latest)" in the "TF" "list_item"
|
And I should see "(latest)" in the "TF" "list_item"
|
||||||
And I click on "version" "select" in the "TF" "list_item"
|
And I click on "version" "select" in the "TF" "list_item"
|
||||||
And I should see "v1"
|
And I should see "v1"
|
||||||
|
@ -171,7 +170,7 @@ Feature: Regrading quiz attempts using the Grades report
|
||||||
| slot | response |
|
| slot | response |
|
||||||
| 1 | True |
|
| 1 | True |
|
||||||
| 2 | toad |
|
| 2 | toad |
|
||||||
And I navigate to "Questions" in current page administration
|
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
||||||
And I set the field "version" in the "TF" "list_item" to "Always latest"
|
And I set the field "version" in the "TF" "list_item" to "Always latest"
|
||||||
And I navigate to "Results" in current page administration
|
And I navigate to "Results" in current page administration
|
||||||
And I press "Regrade all"
|
And I press "Regrade all"
|
||||||
|
@ -188,10 +187,10 @@ Feature: Regrading quiz attempts using the Grades report
|
||||||
And I click on "Delete selected attempts" "button"
|
And I click on "Delete selected attempts" "button"
|
||||||
And I click on "Yes" "button"
|
And I click on "Yes" "button"
|
||||||
# Create multiple question versions.
|
# Create multiple question versions.
|
||||||
And I navigate to "Question bank" in current page administration
|
And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
|
||||||
And I choose "Delete" action for "SA" in the question bank
|
And I choose "Delete" action for "SA" in the question bank
|
||||||
And I press "Delete"
|
And I press "Delete"
|
||||||
And I navigate to "Questions" in current page administration
|
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
||||||
And I click on "Delete" "link" in the "TF" "list_item"
|
And I click on "Delete" "link" in the "TF" "list_item"
|
||||||
And I click on "Yes" "button" in the "Confirm" "dialogue"
|
And I click on "Yes" "button" in the "Confirm" "dialogue"
|
||||||
And I click on "Delete" "link" in the "SA" "list_item"
|
And I click on "Delete" "link" in the "SA" "list_item"
|
||||||
|
@ -207,8 +206,7 @@ Feature: Regrading quiz attempts using the Grades report
|
||||||
And I click on "Finish attempt ..." "button"
|
And I click on "Finish attempt ..." "button"
|
||||||
And I press "Submit all and finish"
|
And I press "Submit all and finish"
|
||||||
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
|
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
|
||||||
And I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
|
And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page logged in as teacher
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I choose "Edit question" action for "TF" in the question bank
|
And I choose "Edit question" action for "TF" in the question bank
|
||||||
And I set the field "Correct answer" to "False"
|
And I set the field "Correct answer" to "False"
|
||||||
And I press "id_submitbutton"
|
And I press "id_submitbutton"
|
||||||
|
|
|
@ -71,6 +71,7 @@ class behat_mod_quiz extends behat_question_base {
|
||||||
* | Manual grading report | Quiz name | The manual grading report for a quiz |
|
* | Manual grading report | Quiz name | The manual grading report for a quiz |
|
||||||
* | Statistics report | Quiz name | The statistics report for a quiz |
|
* | Statistics report | Quiz name | The statistics report for a quiz |
|
||||||
* | Attempt review | Quiz name > username > [Attempt] attempt no | Review page for a given attempt (review.php) |
|
* | Attempt review | Quiz name > username > [Attempt] attempt no | Review page for a given attempt (review.php) |
|
||||||
|
* | Question bank | Quiz name | The question bank page for a quiz |
|
||||||
*
|
*
|
||||||
* @param string $type identifies which type of page this is, e.g. 'Attempt review'.
|
* @param string $type identifies which type of page this is, e.g. 'Attempt review'.
|
||||||
* @param string $identifier identifies the particular page, e.g. 'Test quiz > student > Attempt 1'.
|
* @param string $identifier identifies the particular page, e.g. 'Test quiz > student > Attempt 1'.
|
||||||
|
@ -141,6 +142,12 @@ class behat_mod_quiz extends behat_question_base {
|
||||||
['quiz' => $quiz->id, 'userid' => $user->id, 'attempt' => $attemptno], '*', MUST_EXIST);
|
['quiz' => $quiz->id, 'userid' => $user->id, 'attempt' => $attemptno], '*', MUST_EXIST);
|
||||||
return new moodle_url('/mod/quiz/review.php', ['attempt' => $attempt->id]);
|
return new moodle_url('/mod/quiz/review.php', ['attempt' => $attempt->id]);
|
||||||
|
|
||||||
|
case 'question bank':
|
||||||
|
return new moodle_url('/question/edit.php', [
|
||||||
|
'cmid' => $this->get_cm_by_quiz_name($identifier)->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Exception('Unrecognised quiz page type "' . $type . '."');
|
throw new Exception('Unrecognised quiz page type "' . $type . '."');
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,15 +22,13 @@ Feature: Use the qbank plugin manager page for bulkmove
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Bulk move questions"
|
And I should see "Bulk move questions"
|
||||||
And I click on "Disable" "link" in the "Bulk move questions" "table_row"
|
And I click on "Disable" "link" in the "Bulk move questions" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I click on "First question" "checkbox"
|
And I click on "First question" "checkbox"
|
||||||
And I click on "With selected" "button"
|
And I click on "With selected" "button"
|
||||||
Then I should not see question bulk action "move"
|
Then I should not see question bulk action "move"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Bulk move questions" "table_row"
|
And I click on "Enable" "link" in the "Bulk move questions" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I click on "First question" "checkbox"
|
And I click on "First question" "checkbox"
|
||||||
And I click on "With selected" "button"
|
And I click on "With selected" "button"
|
||||||
And I should see question bulk action "move"
|
And I should see question bulk action "move"
|
||||||
|
|
|
@ -26,8 +26,7 @@ Feature: An plugin column can be reordered and displayed in the question bank vi
|
||||||
| Question category 1 | essay | Test question to be seen | teacher1 | Write about whatever you want | idnumber1 |
|
| Question category 1 | essay | Test question to be seen | teacher1 | Write about whatever you want | idnumber1 |
|
||||||
|
|
||||||
Scenario: Teacher can see proper view
|
Scenario: Teacher can see proper view
|
||||||
Given I am on the "Test quiz Q001" "quiz activity" page logged in as "teacher1"
|
Given I am on the "Test quiz Q001" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
When I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "category" to "Question category 1"
|
And I set the field "category" to "Question category 1"
|
||||||
And I should see "Test question to be seen"
|
And I should see "Test question to be seen"
|
||||||
Then I should see "Teacher 1"
|
Then I should see "Teacher 1"
|
||||||
|
@ -36,8 +35,7 @@ Feature: An plugin column can be reordered and displayed in the question bank vi
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
When I navigate to "Plugins > Question bank plugins > Column sort order" in site administration
|
When I navigate to "Plugins > Question bank plugins > Column sort order" in site administration
|
||||||
And I drag "Created by (creator_name_column)" "text" and I drop it in "T (question_type_column)" "text"
|
And I drag "Created by (creator_name_column)" "text" and I drop it in "T (question_type_column)" "text"
|
||||||
And I am on the "Test quiz Q001" "quiz activity" page logged in as "teacher1"
|
And I am on the "Test quiz Q001" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "category" to "Question category 1"
|
And I set the field "category" to "Question category 1"
|
||||||
Then ".creatorname" "css_element" should appear before ".qtype" "css_element"
|
Then ".creatorname" "css_element" should appear before ".qtype" "css_element"
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,7 @@ Feature: A Teacher can comment in a question
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Add a comment in question
|
Scenario: Add a comment in question
|
||||||
Given I log in as "teacher1"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "Select a category" to "Test questions"
|
And I set the field "Select a category" to "Test questions"
|
||||||
And I should see "0" on the comments column
|
And I should see "0" on the comments column
|
||||||
When I click "0" on the row on the comments column
|
When I click "0" on the row on the comments column
|
||||||
|
@ -39,9 +37,7 @@ Feature: A Teacher can comment in a question
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Delete a comment from question
|
Scenario: Delete a comment from question
|
||||||
Given I log in as "teacher1"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "Select a category" to "Test questions"
|
And I set the field "Select a category" to "Test questions"
|
||||||
And I should see "0" on the comments column
|
And I should see "0" on the comments column
|
||||||
When I click "0" on the row on the comments column
|
When I click "0" on the row on the comments column
|
||||||
|
@ -58,9 +54,7 @@ Feature: A Teacher can comment in a question
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Preview question with comments
|
Scenario: Preview question with comments
|
||||||
Given I log in as "teacher1"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "Select a category" to "Test questions"
|
And I set the field "Select a category" to "Test questions"
|
||||||
And I choose "Preview" action for "First question" in the question bank
|
And I choose "Preview" action for "First question" in the question bank
|
||||||
And I click on "Comments" "link"
|
And I click on "Comments" "link"
|
||||||
|
@ -86,9 +80,7 @@ Feature: A Teacher can comment in a question
|
||||||
| moodle/question:commentmine | Allow |
|
| moodle/question:commentmine | Allow |
|
||||||
| moodle/question:commentall | Prevent |
|
| moodle/question:commentall | Prevent |
|
||||||
And I log out
|
And I log out
|
||||||
Then I log in as "teacher1"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "Select a category" to "Test questions"
|
And I set the field "Select a category" to "Test questions"
|
||||||
And I choose "Preview" action for "First question" in the question bank
|
And I choose "Preview" action for "First question" in the question bank
|
||||||
Then I should not see "Save comment"
|
Then I should not see "Save comment"
|
||||||
|
@ -105,10 +97,7 @@ Feature: A Teacher can comment in a question
|
||||||
And I click on "Comments" "link"
|
And I click on "Comments" "link"
|
||||||
Then I should see "Save comment"
|
Then I should see "Save comment"
|
||||||
And I log out
|
And I log out
|
||||||
Then I log in as "teacher2"
|
And I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher2"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "Select a category" to "Test questions"
|
|
||||||
And I choose "Preview" action for "First question" in the question bank
|
And I choose "Preview" action for "First question" in the question bank
|
||||||
Then I should not see "Save comment"
|
Then I should not see "Save comment"
|
||||||
And I click on "Close preview" "button"
|
And I click on "Close preview" "button"
|
||||||
|
@ -118,9 +107,7 @@ Feature: A Teacher can comment in a question
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Comments added from the quiz page are visible
|
Scenario: Comments added from the quiz page are visible
|
||||||
Given I log in as "teacher1"
|
Given I am on the "Test quiz" "mod_quiz > edit" page logged in as "teacher1"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
When I navigate to "Questions" in current page administration
|
|
||||||
And I press "Add"
|
And I press "Add"
|
||||||
And I follow "from question bank"
|
And I follow "from question bank"
|
||||||
And I click on "Select" "checkbox" in the "First question" "table_row"
|
And I click on "Select" "checkbox" in the "First question" "table_row"
|
||||||
|
@ -132,16 +119,14 @@ Feature: A Teacher can comment in a question
|
||||||
And I click on "Save comment" "link"
|
And I click on "Save comment" "link"
|
||||||
And I should see "Some new comment"
|
And I should see "Some new comment"
|
||||||
And I switch to the main window
|
And I switch to the main window
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I choose "Preview" action for "First question" in the question bank
|
And I choose "Preview" action for "First question" in the question bank
|
||||||
And I click on "Comments" "link"
|
And I click on "Comments" "link"
|
||||||
And I should see "Some new comment"
|
And I should see "Some new comment"
|
||||||
And I should see "T1 Teacher1"
|
And I should see "T1 Teacher1"
|
||||||
And I delete "Some new comment" comment from question preview
|
And I delete "Some new comment" comment from question preview
|
||||||
And I should not see "Some new comment"
|
And I should not see "Some new comment"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > edit" page
|
||||||
And I navigate to "Questions" in current page administration
|
|
||||||
And I click on "Preview question" "link"
|
And I click on "Preview question" "link"
|
||||||
And I switch to "questionpreview" window
|
And I switch to "questionpreview" window
|
||||||
And I press "Comments"
|
And I press "Comments"
|
||||||
|
|
|
@ -22,11 +22,9 @@ Feature: Use the qbank plugin manager page for comment
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Question comments"
|
And I should see "Question comments"
|
||||||
And I click on "Disable" "link" in the "Question comments" "table_row"
|
And I click on "Disable" "link" in the "Question comments" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then "#categoryquestions .header.commentcount" "css_element" should not be visible
|
Then "#categoryquestions .header.commentcount" "css_element" should not be visible
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Question comments" "table_row"
|
And I click on "Enable" "link" in the "Question comments" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And "#categoryquestions .header.commentcount" "css_element" should be visible
|
And "#categoryquestions .header.commentcount" "css_element" should be visible
|
||||||
|
|
|
@ -37,8 +37,7 @@ Feature: A teacher can edit question with custom fields
|
||||||
| Correct answer | False |
|
| Correct answer | False |
|
||||||
| Feedback for the response 'True'. | So you think it is true |
|
| Feedback for the response 'True'. | So you think it is true |
|
||||||
| Feedback for the response 'False'. | So you think it is false |
|
| Feedback for the response 'False'. | So you think it is false |
|
||||||
And I am on the "Test quiz name" "quiz activity" page
|
And I am on the "Test quiz name" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
|
|
||||||
Scenario: Edit a previously created question and see the custom field in the overview table and in the question preview.
|
Scenario: Edit a previously created question and see the custom field in the overview table and in the question preview.
|
||||||
When I choose "Edit question" action for "First question" in the question bank
|
When I choose "Edit question" action for "First question" in the question bank
|
||||||
|
|
|
@ -37,8 +37,7 @@ Feature: The visibility of question custom fields control where they are display
|
||||||
| Correct answer | False |
|
| Correct answer | False |
|
||||||
| Feedback for the response 'True'. | So you think it is true |
|
| Feedback for the response 'True'. | So you think it is true |
|
||||||
| Feedback for the response 'False'. | So you think it is false |
|
| Feedback for the response 'False'. | So you think it is false |
|
||||||
And I am on the "Test quiz name" "quiz activity" page
|
And I am on the "Test quiz name" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Display custom question fields to teachers based on their visibility.
|
Scenario: Display custom question fields to teachers based on their visibility.
|
||||||
|
|
|
@ -22,16 +22,12 @@ Feature: Use the qbank plugin manager page for deletequestion
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Delete question"
|
And I should see "Delete question"
|
||||||
And I click on "Disable" "link" in the "Delete question" "table_row"
|
And I click on "Disable" "link" in the "Delete question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
Then the "Delete" action should not exist for the "First question" question in the question bank
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
|
||||||
Then I should not see "Delete" in the "region-main" "region"
|
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Delete question" "table_row"
|
And I click on "Enable" "link" in the "Delete question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
And the "Delete" action should exist for the "First question" question in the question bank
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
|
||||||
And I should see "Delete" in the "region-main" "region"
|
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Enable/disable delete questions bulk action from the base view
|
Scenario: Enable/disable delete questions bulk action from the base view
|
||||||
|
@ -39,22 +35,18 @@ Feature: Use the qbank plugin manager page for deletequestion
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Delete question"
|
And I should see "Delete question"
|
||||||
And I click on "Disable" "link" in the "Delete question" "table_row"
|
And I click on "Disable" "link" in the "Delete question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I click on "With selected" "button"
|
And I click on "With selected" "button"
|
||||||
Then I should not see question bulk action "deleteselected"
|
Then I should not see question bulk action "deleteselected"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Delete question" "table_row"
|
And I click on "Enable" "link" in the "Delete question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I click on "With selected" "button"
|
And I click on "With selected" "button"
|
||||||
And I should see question bulk action "deleteselected"
|
And I should see question bulk action "deleteselected"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: I should not see the deleted questions in the base view
|
Scenario: I should not see the deleted questions in the base view
|
||||||
Given I log in as "admin"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I click on "First question" "checkbox"
|
And I click on "First question" "checkbox"
|
||||||
And I click on "First question second" "checkbox"
|
And I click on "First question second" "checkbox"
|
||||||
And I click on "With selected" "button"
|
And I click on "With selected" "button"
|
||||||
|
|
|
@ -22,18 +22,13 @@ Feature: Use the qbank plugin manager page for editquestion
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Edit question"
|
And I should see "Edit question"
|
||||||
And I click on "Disable" "link" in the "Edit question" "table_row"
|
And I click on "Disable" "link" in the "Edit question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then I should not see "Status"
|
Then I should not see "Status"
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
And the "Edit question" action should not exist for the "First question" question in the question bank
|
||||||
And I should not see "Edit question" in the "region-main" "region"
|
And the "Duplicate" action should not exist for the "First question" question in the question bank
|
||||||
And I should not see "Duplicate" in the "region-main" "region"
|
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Edit question" "table_row"
|
And I click on "Enable" "link" in the "Edit question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
|
||||||
Then I should see "Status"
|
Then I should see "Status"
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
And the "Edit question" action should exist for the "First question" question in the question bank
|
||||||
And I should see "Edit question" in the "region-main" "region"
|
And the "Duplicate" action should exist for the "First question" question in the question bank
|
||||||
And I should see "Duplicate" in the "region-main" "region"
|
|
||||||
|
|
|
@ -19,9 +19,7 @@ Feature: Use the qbank base view to test the status change using
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Question status dropdown should change the status of the question
|
Scenario: Question status dropdown should change the status of the question
|
||||||
Given I log in as "admin"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "Select a category" to "Test questions"
|
And I set the field "Select a category" to "Test questions"
|
||||||
And I should see "Test questions"
|
And I should see "Test questions"
|
||||||
And the field "question_status_dropdown" in the "First question" "table_row" matches value "Ready"
|
And the field "question_status_dropdown" in the "First question" "table_row" matches value "Ready"
|
||||||
|
|
|
@ -21,13 +21,9 @@ Feature: Use the qbank plugin manager page for exporttoxml
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Export to XML"
|
And I should see "Export to XML"
|
||||||
And I click on "Disable" "link" in the "Export to XML" "table_row"
|
And I click on "Disable" "link" in the "Export to XML" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
Then the "Export as Moodle XML" action should not exist for the "First question" question in the question bank
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
|
||||||
Then I should not see "Export as Moodle XML"
|
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Export to XML" "table_row"
|
And I click on "Enable" "link" in the "Export to XML" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
And the "Export as Moodle XML" action should exist for the "First question" question in the question bank
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
|
||||||
And I should see "Export as Moodle XML"
|
|
||||||
|
|
|
@ -22,21 +22,15 @@ Feature: Use the qbank plugin manager page for question history
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Question history"
|
And I should see "Question history"
|
||||||
And I click on "Disable" "link" in the "Question history" "table_row"
|
And I click on "Disable" "link" in the "Question history" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
Then the "History" action should not exist for the "First question" question in the question bank
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
|
||||||
Then I should not see "History" in the "region-main" "region"
|
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Question history" "table_row"
|
And I click on "Enable" "link" in the "Question history" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
Then the "History" action should exist for the "First question" question in the question bank
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
|
||||||
And I should see "History" in the "region-main" "region"
|
|
||||||
|
|
||||||
Scenario: History page shows only the specified features and questions
|
Scenario: History page shows only the specified features and questions
|
||||||
Given I log in as "admin"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
When I navigate to "Question bank" in current page administration
|
|
||||||
And I choose "History" action for "First question" in the question bank
|
And I choose "History" action for "First question" in the question bank
|
||||||
Then I should not see "Select a category"
|
Then I should not see "Select a category"
|
||||||
And I should see "No tag filters applied"
|
And I should see "No tag filters applied"
|
||||||
|
@ -46,8 +40,6 @@ Feature: Use the qbank plugin manager page for question history
|
||||||
And I should see "Version"
|
And I should see "Version"
|
||||||
And I should see "Created by"
|
And I should see "Created by"
|
||||||
And I should see "First question"
|
And I should see "First question"
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
And the "History" action should not exist for the "First question" question in the question bank
|
||||||
But I should not see "History"
|
|
||||||
And I click on "#qbank-history-close" "css_element"
|
And I click on "#qbank-history-close" "css_element"
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
And the "History" action should exist for the "First question" question in the question bank
|
||||||
And I should see "History" in the "region-main" "region"
|
|
||||||
|
|
|
@ -21,11 +21,9 @@ Feature: Use the qbank plugin manager page for version column
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Question history"
|
And I should see "Question history"
|
||||||
When I click on "Disable" "link" in the "Question history" "table_row"
|
When I click on "Disable" "link" in the "Question history" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then I should not see "Version" in the "region-main" "region"
|
Then I should not see "Version" in the "region-main" "region"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Question history" "table_row"
|
And I click on "Enable" "link" in the "Question history" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I should see "Version" in the "region-main" "region"
|
And I should see "Version" in the "region-main" "region"
|
||||||
|
|
|
@ -17,12 +17,9 @@ Feature: A teacher can move question categories in the question bank
|
||||||
And the following "activities" exist:
|
And the following "activities" exist:
|
||||||
| activity | name | course | idnumber |
|
| activity | name | course | idnumber |
|
||||||
| quiz | Test quiz | C1 | quiz1 |
|
| quiz | Test quiz | C1 | quiz1 |
|
||||||
And I log in as "teacher1"
|
|
||||||
And I am on "Course 1" course homepage
|
|
||||||
|
|
||||||
Scenario: A question category can be moved to another context
|
Scenario: A question category can be moved to another context
|
||||||
When I follow "Test quiz"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I select "Categories" from the "Question bank tertiary navigation" singleselect
|
And I select "Categories" from the "Question bank tertiary navigation" singleselect
|
||||||
And I follow "Add category"
|
And I follow "Add category"
|
||||||
And I set the following fields to these values:
|
And I set the following fields to these values:
|
||||||
|
@ -33,8 +30,7 @@ Feature: A teacher can move question categories in the question bank
|
||||||
Then I should see "Test category" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' questioncategories ') and contains(concat(' ', normalize-space(@class), ' '), ' contextlevel50 ')]" "xpath_element"
|
Then I should see "Test category" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' questioncategories ') and contains(concat(' ', normalize-space(@class), ' '), ' contextlevel50 ')]" "xpath_element"
|
||||||
|
|
||||||
Scenario: A question category can be moved to top level
|
Scenario: A question category can be moved to top level
|
||||||
When I follow "Test quiz"
|
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I select "Categories" from the "Question bank tertiary navigation" singleselect
|
And I select "Categories" from the "Question bank tertiary navigation" singleselect
|
||||||
And I follow "Add category"
|
And I follow "Add category"
|
||||||
And I set the following fields to these values:
|
And I set the following fields to these values:
|
||||||
|
|
|
@ -25,8 +25,7 @@ Feature: Use the qbank plugin manager page for managecategories
|
||||||
Then "Categories" "link" should not exist in current page administration
|
Then "Categories" "link" should not exist in current page administration
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Manage categories" "table_row"
|
And I click on "Enable" "link" in the "Manage categories" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I should see "Categories" in the "//div[contains(@class, 'urlselect')]//option[contains(text(), 'Categories')]" "xpath_element"
|
And I should see "Categories" in the "//div[contains(@class, 'urlselect')]//option[contains(text(), 'Categories')]" "xpath_element"
|
||||||
|
|
||||||
Scenario: Enable/disable the tab New category when tyring to add a random question to a quiz
|
Scenario: Enable/disable the tab New category when tyring to add a random question to a quiz
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@qbank @qbank_previewquestion @javascript
|
@qbank @qbank_previewquestion
|
||||||
Feature: A teacher can preview questions in the question bank
|
Feature: A teacher can preview questions in the question bank
|
||||||
In order to ensure the questions are properly created
|
In order to ensure the questions are properly created
|
||||||
As a teacher
|
As a teacher
|
||||||
|
@ -23,9 +23,7 @@ Feature: A teacher can preview questions in the question bank
|
||||||
And the following "questions" exist:
|
And the following "questions" exist:
|
||||||
| questioncategory | qtype | name |
|
| questioncategory | qtype | name |
|
||||||
| Test questions | numerical | Test question to be previewed |
|
| Test questions | numerical | Test question to be previewed |
|
||||||
And I log in as "teacher1"
|
And I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
When I choose "Preview" action for "Test question to be previewed" in the question bank
|
When I choose "Preview" action for "Test question to be previewed" in the question bank
|
||||||
|
|
||||||
Scenario: Question preview shows the question and other information
|
Scenario: Question preview shows the question and other information
|
||||||
|
|
|
@ -16,37 +16,28 @@ Feature: Use the qbank plugin manager page for previewquestion
|
||||||
| questioncategory | qtype | name | questiontext |
|
| questioncategory | qtype | name | questiontext |
|
||||||
| Test questions | truefalse | First question | Answer the first question |
|
| Test questions | truefalse | First question | Answer the first question |
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Enable/disable previewquestion column from the base view
|
Scenario: Enable/disable previewquestion column from the base view
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Preview question"
|
And I should see "Preview question"
|
||||||
And I click on "Disable" "link" in the "Preview question" "table_row"
|
And I click on "Disable" "link" in the "Preview question" "table_row"
|
||||||
And I am on the "C1" "Course" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
Then the "Preview" item should not exist in the "Edit" action menu of the "First question" "table_row"
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I click on ".action-menu" "css_element" in the "First question" "table_row"
|
|
||||||
Then I should not see "Preview" in the "region-main" "region"
|
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Preview question" "table_row"
|
And I click on "Enable" "link" in the "Preview question" "table_row"
|
||||||
And I am on the "C1" "Course" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And the "Preview" item should exist in the "Edit" action menu of the "First question" "table_row"
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I click on ".action-menu" "css_element" in the "First question" "table_row"
|
|
||||||
And I should see "Preview" in the "region-main" "region"
|
|
||||||
|
|
||||||
Scenario: Enable/disable preview button from question edit form
|
Scenario: Enable/disable preview button from question edit form
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Preview question"
|
And I should see "Preview question"
|
||||||
And I click on "Disable" "link" in the "Preview question" "table_row"
|
And I click on "Disable" "link" in the "Preview question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I choose "Edit question" action for "First question" in the question bank
|
And I choose "Edit question" action for "First question" in the question bank
|
||||||
Then I should not see "Preview" in the "region-main" "region"
|
Then I should not see "Preview" in the "region-main" "region"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Preview question" "table_row"
|
And I click on "Enable" "link" in the "Preview question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I choose "Edit question" action for "First question" in the question bank
|
And I choose "Edit question" action for "First question" in the question bank
|
||||||
And I should see "Preview" in the "region-main" "region"
|
And I should see "Preview" in the "region-main" "region"
|
||||||
|
|
|
@ -21,15 +21,13 @@ Feature: Use the qbank plugin manager page for statistics
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Question statistics"
|
And I should see "Question statistics"
|
||||||
And I click on "Disable" "link" in the "Question statistics" "table_row"
|
And I click on "Disable" "link" in the "Question statistics" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then I should not see "Facility index"
|
Then I should not see "Facility index"
|
||||||
And I should not see "Discriminative efficiency"
|
And I should not see "Discriminative efficiency"
|
||||||
And I should not see "Needs checking?"
|
And I should not see "Needs checking?"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Question statistics" "table_row"
|
And I click on "Enable" "link" in the "Question statistics" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I should see "Facility index"
|
And I should see "Facility index"
|
||||||
And I should see "Discriminative efficiency"
|
And I should see "Discriminative efficiency"
|
||||||
And I should see "Needs checking?"
|
And I should see "Needs checking?"
|
||||||
|
|
|
@ -72,9 +72,8 @@ Feature: Show statistics in question bank
|
||||||
| slot | response |
|
| slot | response |
|
||||||
| 1 | True |
|
| 1 | True |
|
||||||
| 2 | True |
|
| 2 | True |
|
||||||
When I am on the "Course 1" course page logged in as admin
|
When I am on the "Course 1" "core_question > course question bank" page logged in as "admin"
|
||||||
And I navigate to "Question bank" in current page administration
|
Then I should see "50.00%" in the "TF1" "table_row"
|
||||||
And I should see "50.00%" in the "TF1" "table_row"
|
|
||||||
And I should see "75.00%" in the "TF2" "table_row"
|
And I should see "75.00%" in the "TF2" "table_row"
|
||||||
And I should see "75.00%" in the "TF3" "table_row"
|
And I should see "75.00%" in the "TF3" "table_row"
|
||||||
And I should see "50.00%" in the "TF4" "table_row"
|
And I should see "50.00%" in the "TF4" "table_row"
|
||||||
|
@ -88,9 +87,8 @@ Feature: Show statistics in question bank
|
||||||
| slot | response |
|
| slot | response |
|
||||||
| 1 | True |
|
| 1 | True |
|
||||||
| 2 | True |
|
| 2 | True |
|
||||||
When I am on the "Course 1" course page logged in as admin
|
When I am on the "Course 1" "core_question > course question bank" page logged in as "admin"
|
||||||
And I navigate to "Question bank" in current page administration
|
Then I should see "50.00%" in the "TF1" "table_row"
|
||||||
And I should see "50.00%" in the "TF1" "table_row"
|
|
||||||
And I should see "75.00%" in the "TF2" "table_row"
|
And I should see "75.00%" in the "TF2" "table_row"
|
||||||
And I should see "75.00%" in the "TF3" "table_row"
|
And I should see "75.00%" in the "TF3" "table_row"
|
||||||
And I should see "50.00%" in the "TF4" "table_row"
|
And I should see "50.00%" in the "TF4" "table_row"
|
||||||
|
@ -104,9 +102,8 @@ Feature: Show statistics in question bank
|
||||||
| slot | response |
|
| slot | response |
|
||||||
| 1 | True |
|
| 1 | True |
|
||||||
| 2 | True |
|
| 2 | True |
|
||||||
When I am on the "Course 1" course page logged in as admin
|
When I am on the "Course 1" "core_question > course question bank" page logged in as "admin"
|
||||||
And I navigate to "Question bank" in current page administration
|
Then I should see "Likely" in the "TF1" "table_row"
|
||||||
And I should see "Likely" in the "TF1" "table_row"
|
|
||||||
And I should see "Unlikely" in the "TF2" "table_row"
|
And I should see "Unlikely" in the "TF2" "table_row"
|
||||||
And I should see "Unlikely" in the "TF3" "table_row"
|
And I should see "Unlikely" in the "TF3" "table_row"
|
||||||
And I should see "Likely" in the "TF4" "table_row"
|
And I should see "Likely" in the "TF4" "table_row"
|
||||||
|
@ -126,9 +123,8 @@ Feature: Show statistics in question bank
|
||||||
| slot | response |
|
| slot | response |
|
||||||
| 1 | True |
|
| 1 | True |
|
||||||
| 2 | False |
|
| 2 | False |
|
||||||
When I am on the "Course 1" course page logged in as admin
|
When I am on the "Course 1" "core_question > course question bank" page logged in as "admin"
|
||||||
And I navigate to "Question bank" in current page administration
|
Then I should see "Likely" in the "TF1" "table_row"
|
||||||
And I should see "Likely" in the "TF1" "table_row"
|
|
||||||
And I should see "Very likely" in the "TF2" "table_row"
|
And I should see "Very likely" in the "TF2" "table_row"
|
||||||
And I should see "Very likely" in the "TF3" "table_row"
|
And I should see "Very likely" in the "TF3" "table_row"
|
||||||
And I should see "Likely" in the "TF4" "table_row"
|
And I should see "Likely" in the "TF4" "table_row"
|
||||||
|
|
|
@ -18,32 +18,26 @@ Feature: Use the qbank plugin manager page for tagquestion
|
||||||
|
|
||||||
Scenario: Enable/disable tagquestion column from the base view
|
Scenario: Enable/disable tagquestion column from the base view
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Tag question"
|
And I should see "Tag question"
|
||||||
And I click on "Disable" "link" in the "Tag question" "table_row"
|
And I click on "Disable" "link" in the "Tag question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
And the "Manage tags" action should not exist for the "First question" question in the question bank
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
Then I should not see "Manage tags"
|
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
|
||||||
And I click on "Enable" "link" in the "Tag question" "table_row"
|
And I click on "Enable" "link" in the "Tag question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
Then the "Manage tags" action should exist for the "First question" question in the question bank
|
||||||
And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row"
|
|
||||||
And I should see "Manage tags"
|
|
||||||
|
|
||||||
Scenario: Enable/disable tagquestion section from question edit form
|
Scenario: Enable/disable tagquestion section from question edit form
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Tag question"
|
And I should see "Tag question"
|
||||||
And I click on "Disable" "link" in the "Tag question" "table_row"
|
And I click on "Disable" "link" in the "Tag question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I choose "Edit question" action for "First question" in the question bank
|
And I choose "Edit question" action for "First question" in the question bank
|
||||||
Then I should not see "Tags" in the "region-main" "region"
|
Then I should not see "Tags" in the "region-main" "region"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Tag question" "table_row"
|
And I click on "Enable" "link" in the "Tag question" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I choose "Edit question" action for "First question" in the question bank
|
And I choose "Edit question" action for "First question" in the question bank
|
||||||
And I should see "Tags" in the "region-main" "region"
|
And I should see "Tags" in the "region-main" "region"
|
||||||
|
|
|
@ -21,20 +21,16 @@ Feature: Use the qbank plugin manager page for question usage
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "Question usage"
|
And I should see "Question usage"
|
||||||
When I click on "Disable" "link" in the "Question usage" "table_row"
|
When I click on "Disable" "link" in the "Question usage" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then I should not see "Usage"
|
Then I should not see "Usage"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "Question usage" "table_row"
|
And I click on "Enable" "link" in the "Question usage" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I should see "Usage"
|
And I should see "Usage"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Question usage modal should work without any usage data
|
Scenario: Question usage modal should work without any usage data
|
||||||
Given I log in as "admin"
|
And I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I set the field "Select a category" to "Test questions"
|
And I set the field "Select a category" to "Test questions"
|
||||||
And I should see "Test questions"
|
And I should see "Test questions"
|
||||||
And I should see "0" on the usage column
|
And I should see "0" on the usage column
|
||||||
|
|
|
@ -21,11 +21,9 @@ Feature: Use the qbank plugin manager page for viewcreator plugin
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "View creator"
|
And I should see "View creator"
|
||||||
When I click on "Disable" "link" in the "View creator" "table_row"
|
When I click on "Disable" "link" in the "View creator" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then I should not see "Created by"
|
Then I should not see "Created by"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "View creator" "table_row"
|
And I click on "Enable" "link" in the "View creator" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then I should see "Created by"
|
Then I should see "Created by"
|
||||||
|
|
|
@ -21,11 +21,9 @@ Feature: Use the qbank plugin manager page for viewquestionname
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "View question name"
|
And I should see "View question name"
|
||||||
When I click on "Disable" "link" in the "View question name" "table_row"
|
When I click on "Disable" "link" in the "View question name" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then I should not see "First question"
|
Then I should not see "First question"
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "View question name" "table_row"
|
And I click on "Enable" "link" in the "View question name" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I should see "First question"
|
And I should see "First question"
|
||||||
|
|
|
@ -22,14 +22,12 @@ Feature: Use the qbank plugin manager page for viewquestiontext
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "View question text"
|
And I should see "View question text"
|
||||||
When I click on "Disable" "link" in the "View question text" "table_row"
|
When I click on "Disable" "link" in the "View question text" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I should not see "Show question text in the question list"
|
And I should not see "Show question text in the question list"
|
||||||
Then "#categoryquestions .questiontext" "css_element" should not be visible
|
Then "#categoryquestions .questiontext" "css_element" should not be visible
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "View question text" "table_row"
|
And I click on "Enable" "link" in the "View question text" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I should see "Show question text in the question list"
|
And I should see "Show question text in the question list"
|
||||||
And I click on "qbshowtext" "checkbox"
|
And I click on "qbshowtext" "checkbox"
|
||||||
And I should see "Answer the first question"
|
And I should see "Answer the first question"
|
||||||
|
|
|
@ -22,11 +22,9 @@ Feature: Use the qbank plugin manager page for viewquestiontype
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I should see "View question type"
|
And I should see "View question type"
|
||||||
And I click on "Disable" "link" in the "View question type" "table_row"
|
And I click on "Disable" "link" in the "View question type" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
Then "#categoryquestions .header.qtype" "css_element" should not be visible
|
Then "#categoryquestions .header.qtype" "css_element" should not be visible
|
||||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||||
And I click on "Enable" "link" in the "View question type" "table_row"
|
And I click on "Enable" "link" in the "View question type" "table_row"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "mod_quiz > question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And "#categoryquestions .header.qtype" "css_element" should be visible
|
And "#categoryquestions .header.qtype" "css_element" should be visible
|
||||||
|
|
|
@ -28,9 +28,7 @@ Feature: Test importing questions from GIFT format.
|
||||||
Then I should see "colours"
|
Then I should see "colours"
|
||||||
|
|
||||||
# Now export again.
|
# Now export again.
|
||||||
And I am on "Course 1" course homepage
|
And I am on the "Course 1" "core_question > course question export" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I select "Export" from the "Question bank tertiary navigation" singleselect
|
|
||||||
And I set the field "id_format_gift" to "1"
|
And I set the field "id_format_gift" to "1"
|
||||||
And I press "Export questions to file"
|
And I press "Export questions to file"
|
||||||
And following "click here" should download between "1500" and "1800" bytes
|
And following "click here" should download between "1500" and "1800" bytes
|
||||||
|
|
|
@ -174,13 +174,44 @@ class behat_core_question extends behat_question_base {
|
||||||
* @param string $questionname the question name.
|
* @param string $questionname the question name.
|
||||||
*/
|
*/
|
||||||
public function i_action_the_question($action, $questionname) {
|
public function i_action_the_question($action, $questionname) {
|
||||||
// Open the menu.
|
$this->execute('behat_action_menu::i_choose_in_the_named_menu_in_container', [
|
||||||
$this->execute("behat_general::i_click_on_in_the",
|
$action,
|
||||||
[get_string('edit'), 'link', $questionname, 'table_row']);
|
get_string('edit', 'core'),
|
||||||
|
$questionname,
|
||||||
|
'table_row',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
// Click the action from the menu.
|
/**
|
||||||
$this->execute("behat_general::i_click_on_in_the",
|
* Checks that action does exist for a question.
|
||||||
[$action, 'link', $questionname, 'table_row']);
|
*
|
||||||
|
* @Then the :action action should exist for the :questionname question in the question bank
|
||||||
|
* @param string $action the label for the action you want to activate.
|
||||||
|
* @param string $questionname the question name.
|
||||||
|
*/
|
||||||
|
public function action_exists($action, $questionname) {
|
||||||
|
$this->execute('behat_action_menu::item_should_exist_in_the', [
|
||||||
|
$action,
|
||||||
|
get_string('edit', 'core'),
|
||||||
|
$questionname,
|
||||||
|
'table_row',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks that action does not exist for a question.
|
||||||
|
*
|
||||||
|
* @Then the :action action should not exist for the :questionname question in the question bank
|
||||||
|
* @param string $action the label for the action you want to activate.
|
||||||
|
* @param string $questionname the question name.
|
||||||
|
*/
|
||||||
|
public function action_not_exists($action, $questionname) {
|
||||||
|
$this->execute('behat_action_menu::item_should_not_exist_in_the', [
|
||||||
|
$action,
|
||||||
|
get_string('edit', 'core'),
|
||||||
|
$questionname,
|
||||||
|
'table_row',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,7 +15,6 @@ Feature: An activity module instance with questions in its context can be delete
|
||||||
| user | course | role |
|
| user | course | role |
|
||||||
| teacher1 | C1 | editingteacher |
|
| teacher1 | C1 | editingteacher |
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Synchronously deleting a quiz with existing questions in its context
|
Scenario: Synchronously deleting a quiz with existing questions in its context
|
||||||
Given the following config values are set as admin:
|
Given the following config values are set as admin:
|
||||||
| coursebinenable | 0 | tool_recyclebin |
|
| coursebinenable | 0 | tool_recyclebin |
|
||||||
|
|
|
@ -26,10 +26,9 @@ Feature: A teacher can delete questions in the question bank
|
||||||
Scenario: A question not used anywhere can really be deleted
|
Scenario: A question not used anywhere can really be deleted
|
||||||
When I choose "Delete" action for "Test question to be deleted" in the question bank
|
When I choose "Delete" action for "Test question to be deleted" in the question bank
|
||||||
And I press "Delete"
|
And I press "Delete"
|
||||||
And I click on "Also show old questions" "checkbox"
|
And I set the field "Also show old questions" to "1"
|
||||||
Then I should not see "Test question to be deleted"
|
Then I should not see "Test question to be deleted"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Deleting a question can be cancelled
|
Scenario: Deleting a question can be cancelled
|
||||||
When I choose "Delete" action for "Test question to be deleted" in the question bank
|
When I choose "Delete" action for "Test question to be deleted" in the question bank
|
||||||
And I press "Cancel"
|
And I press "Cancel"
|
||||||
|
@ -54,7 +53,7 @@ Feature: A teacher can delete questions in the question bank
|
||||||
And I choose "Delete" action for "Test used question to be deleted" in the question bank
|
And I choose "Delete" action for "Test used question to be deleted" in the question bank
|
||||||
And I press "Delete"
|
And I press "Delete"
|
||||||
Then I should not see "Test used question to be deleted"
|
Then I should not see "Test used question to be deleted"
|
||||||
And I click on "Also show old questions" "checkbox"
|
And I set the field "Also show old questions" to "1"
|
||||||
And I should see "Test used question to be deleted"
|
And I should see "Test used question to be deleted"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "quiz activity" page
|
||||||
And I click on "Preview quiz" "button"
|
And I click on "Preview quiz" "button"
|
||||||
|
@ -68,5 +67,5 @@ Feature: A teacher can delete questions in the question bank
|
||||||
And I reload the page
|
And I reload the page
|
||||||
When I choose "Delete" action for "Broken question" in the question bank
|
When I choose "Delete" action for "Broken question" in the question bank
|
||||||
And I press "Delete"
|
And I press "Delete"
|
||||||
And I click on "Also show old questions" "checkbox"
|
And I set the field "Also show old questions" to "1"
|
||||||
Then I should not see "Broken question"
|
Then I should not see "Broken question"
|
||||||
|
|
|
@ -26,30 +26,23 @@ Feature: Questions in the question bank have versions
|
||||||
And quiz "Quiz 1" contains the following questions:
|
And quiz "Quiz 1" contains the following questions:
|
||||||
| question | page |
|
| question | page |
|
||||||
| First question | 1 |
|
| First question | 1 |
|
||||||
And I log in as "teacher1"
|
|
||||||
And I am on "Course 1" course homepage
|
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Question version is displayed
|
Scenario: Question version is displayed
|
||||||
When I navigate to "Question bank" in current page administration
|
Given I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
||||||
And I should see "First question"
|
When I choose "Edit question" action for "First question" in the question bank
|
||||||
And I click on "Edit" "link" in the "First question" "table_row"
|
|
||||||
And I follow "Edit question"
|
|
||||||
Then I should see "Version 1"
|
Then I should see "Version 1"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Question version change when question is altered
|
Scenario: Question version change when question is altered
|
||||||
When I navigate to "Question bank" in current page administration
|
Given I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
||||||
And I should see "First question"
|
When I choose "Edit question" action for "First question" in the question bank
|
||||||
And I click on "Edit" "link" in the "First question" "table_row"
|
|
||||||
And I follow "Edit question"
|
|
||||||
And I should see "Version 1"
|
And I should see "Version 1"
|
||||||
And I set the field "id_name" to "Renamed question v2"
|
When I set the field "id_name" to "Renamed question v2"
|
||||||
And I set the field "id_questiontext" to "edited question"
|
And I set the field "id_questiontext" to "edited question"
|
||||||
And I press "id_submitbutton"
|
And I press "id_submitbutton"
|
||||||
And I should not see "First question"
|
Then I should not see "First question"
|
||||||
And I should see "Renamed question v2"
|
And I should see "Renamed question v2"
|
||||||
And I click on "Edit" "link" in the "Renamed question v2" "table_row"
|
When I choose "Edit question" action for "Renamed question v2" in the question bank
|
||||||
And I follow "Edit question"
|
|
||||||
Then I should see "Version 2"
|
Then I should see "Version 2"
|
||||||
And I should not see "Version 1"
|
And I should not see "Version 1"
|
||||||
|
|
|
@ -83,9 +83,9 @@ Feature: A teacher can edit questions in the question bank
|
||||||
| questioncategory | qtype | name | questiontext |
|
| questioncategory | qtype | name | questiontext |
|
||||||
| Test questions | missingtype | Broken question | Write something |
|
| Test questions | missingtype | Broken question | Write something |
|
||||||
When I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
When I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
||||||
Then "Edit question" "link" should not exist in the "Broken question" "table_row"
|
Then the "Edit question" item should not exist in the "Edit" action menu of the "Broken question" "table_row"
|
||||||
And "Duplicate" "link" should not exist in the "Broken question" "table_row"
|
And the "Duplicate" item should not exist in the "Edit" action menu of the "Broken question" "table_row"
|
||||||
And "Manage tags" "link" should exist in the "Broken question" "table_row"
|
And the "Preview" item should not exist in the "Edit" action menu of the "Broken question" "table_row"
|
||||||
And "Preview" "link" should not exist in the "Broken question" "table_row"
|
And the "Export as XML" item should not exist in the "Edit" action menu of the "Broken question" "table_row"
|
||||||
And "Delete" "link" should exist in the "Broken question" "table_row"
|
And the "Manage tags" item should exist in the "Edit" action menu of the "Broken question" "table_row"
|
||||||
And "Export as Moodle XML" "link" should not exist in the "Broken question" "table_row"
|
And the "Delete" item should exist in the "Edit" action menu of the "Broken question" "table_row"
|
||||||
|
|
|
@ -24,11 +24,9 @@ Feature: The questions in the question bank can be sorted in various ways
|
||||||
| Test questions | numerical | C question 3 name | teacher1 | Question 3 text | numidnum</c |
|
| Test questions | numerical | C question 3 name | teacher1 | Question 3 text | numidnum</c |
|
||||||
And I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
And I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions are sorted by type by default
|
Scenario: The questions are sorted by type by default
|
||||||
Then "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
|
Then "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted by idnumber
|
Scenario: The questions can be sorted by idnumber
|
||||||
When I change the window size to "large"
|
When I change the window size to "large"
|
||||||
And I follow "Sort by ID number ascending"
|
And I follow "Sort by ID number ascending"
|
||||||
|
@ -37,30 +35,25 @@ Feature: The questions in the question bank can be sorted in various ways
|
||||||
And I follow "Sort by ID number descending"
|
And I follow "Sort by ID number descending"
|
||||||
And "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
And "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted in reverse order by type
|
Scenario: The questions can be sorted in reverse order by type
|
||||||
When I follow "Sort by Question type descending"
|
When I follow "Sort by Question type descending"
|
||||||
Then "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
Then "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted by name
|
Scenario: The questions can be sorted by name
|
||||||
When I follow "Sort by Question name ascending"
|
When I follow "Sort by Question name ascending"
|
||||||
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
||||||
And "B question 2 name" "checkbox" should appear before "C question 3 name" "checkbox"
|
And "B question 2 name" "checkbox" should appear before "C question 3 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted in reverse order by name
|
Scenario: The questions can be sorted in reverse order by name
|
||||||
When I follow "Sort by Question name ascending"
|
When I follow "Sort by Question name ascending"
|
||||||
And I follow "Sort by Question name descending"
|
And I follow "Sort by Question name descending"
|
||||||
Then "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
Then "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
||||||
And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted by creator name
|
Scenario: The questions can be sorted by creator name
|
||||||
When I follow "Sort by First name ascending"
|
When I follow "Sort by First name ascending"
|
||||||
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted in reverse order by creator name
|
Scenario: The questions can be sorted in reverse order by creator name
|
||||||
When I follow "Sort by First name ascending"
|
When I follow "Sort by First name ascending"
|
||||||
And I follow "Sort by First name descending"
|
And I follow "Sort by First name descending"
|
||||||
|
@ -68,7 +61,7 @@ Feature: The questions in the question bank can be sorted in various ways
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: The question text can be shown in the list of questions
|
Scenario: The question text can be shown in the list of questions
|
||||||
When I click on "Show question text in the question list" "checkbox"
|
When I set the field "Show question text in the question list" to "1"
|
||||||
Then I should see "Question 1 text"
|
Then I should see "Question 1 text"
|
||||||
And I should see "Question 2 text"
|
And I should see "Question 2 text"
|
||||||
And I should see "Question 3 text"
|
And I should see "Question 3 text"
|
||||||
|
|
|
@ -29,7 +29,7 @@ Feature: Test duplicating a quiz containing a drag and drop markers question
|
||||||
And I restore "test_backup.mbz" backup into a new course using this options:
|
And I restore "test_backup.mbz" backup into a new course using this options:
|
||||||
| Schema | Course name | Course 2 |
|
| Schema | Course name | Course 2 |
|
||||||
| Schema | Course short name | C2 |
|
| Schema | Course short name | C2 |
|
||||||
And I navigate to "Question bank" in current page administration
|
And I am on the "Course 2" "core_question > course question bank" page
|
||||||
And I choose "Edit question" action for "Drag markers" in the question bank
|
And I choose "Edit question" action for "Drag markers" in the question bank
|
||||||
Then the following fields match these values:
|
Then the following fields match these values:
|
||||||
| Question name | Drag markers |
|
| Question name | Drag markers |
|
||||||
|
|
|
@ -21,14 +21,12 @@ Feature: In an essay question, let the question author choose the min/max number
|
||||||
| questioncategory | qtype | name | template | minwordlimit | maxwordlimit |
|
| questioncategory | qtype | name | template | minwordlimit | maxwordlimit |
|
||||||
| Test questions | essay | essay-min-max | editor | 0 | 0 |
|
| Test questions | essay | essay-min-max | editor | 0 | 0 |
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Minimum/Maximum word limit are enabled but not set.
|
Scenario: Minimum/Maximum word limit are enabled but not set.
|
||||||
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
|
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
|
||||||
And I set the field "minwordenabled" to "1"
|
And I set the field "minwordenabled" to "1"
|
||||||
And I click on "Save changes" "button"
|
And I click on "Save changes" "button"
|
||||||
Then I should see "Minimum word limit is enabled but is not set"
|
Then I should see "Minimum word limit is enabled but is not set"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Minimum/Maximum word limit cannot be set to a negative number.
|
Scenario: Minimum/Maximum word limit cannot be set to a negative number.
|
||||||
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
|
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
|
||||||
And I set the field "minwordenabled" to "1"
|
And I set the field "minwordenabled" to "1"
|
||||||
|
@ -36,7 +34,6 @@ Feature: In an essay question, let the question author choose the min/max number
|
||||||
And I click on "Save changes" "button"
|
And I click on "Save changes" "button"
|
||||||
Then I should see "Minimum word limit cannot be a negative number"
|
Then I should see "Minimum word limit cannot be a negative number"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Maximum word limit cannot be greater than minimum word limit.
|
Scenario: Maximum word limit cannot be greater than minimum word limit.
|
||||||
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
|
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
|
||||||
And I set the field "minwordenabled" to "1"
|
And I set the field "minwordenabled" to "1"
|
||||||
|
|
|
@ -128,8 +128,7 @@ Feature: Test all the basic functionality of this question type
|
||||||
| Confirmation | Filename | test_backup.mbz |
|
| Confirmation | Filename | test_backup.mbz |
|
||||||
And I restore "test_backup.mbz" backup into a new course using this options:
|
And I restore "test_backup.mbz" backup into a new course using this options:
|
||||||
| Schema | Course name | Course 2 |
|
| Schema | Course name | Course 2 |
|
||||||
And I should see "Course 2"
|
And I am on the "Course 2 copy 1" "core_question > course question bank" page
|
||||||
And I navigate to "Question bank" in current page administration
|
|
||||||
And I should see "Select missing words 001"
|
And I should see "Select missing words 001"
|
||||||
|
|
||||||
# Edit the copy and verify the form field contents.
|
# Edit the copy and verify the form field contents.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@core @core_question @javascript @report @report_questioninstance
|
@core @core_question @report @report_questioninstance
|
||||||
Feature: A Teacher can generate question instance reports
|
Feature: A Teacher can generate question instance reports
|
||||||
In order to see question instance reports
|
In order to see question instance reports
|
||||||
As a Teacher
|
As a Teacher
|
||||||
|
@ -32,7 +32,6 @@ Feature: A Teacher can generate question instance reports
|
||||||
| contextlevel | reference | name |
|
| contextlevel | reference | name |
|
||||||
| Activity module | Test quiz Q001 | Quiz category |
|
| Activity module | Test quiz Q001 | Quiz category |
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Generate general and specific report
|
Scenario: Generate general and specific report
|
||||||
Given I am on the "C1" "Course" page logged in as "admin"
|
Given I am on the "C1" "Course" page logged in as "admin"
|
||||||
And I navigate to "Reports > Question instances" in site administration
|
And I navigate to "Reports > Question instances" in site administration
|
||||||
|
@ -41,12 +40,9 @@ Feature: A Teacher can generate question instance reports
|
||||||
And "Course: Course 1" row "Visible" column of "generaltable" table should contain "2"
|
And "Course: Course 1" row "Visible" column of "generaltable" table should contain "2"
|
||||||
And "Course: Course 1" row "Hidden" column of "generaltable" table should contain "0"
|
And "Course: Course 1" row "Hidden" column of "generaltable" table should contain "0"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Generate report displaying hidden questions
|
Scenario: Generate report displaying hidden questions
|
||||||
Given I am on the "Test quiz Q001" "quiz activity" page logged in as "admin"
|
Given I am on the "Test quiz Q001" "mod_quiz > question bank" page logged in as "admin"
|
||||||
And I navigate to "Question bank" in current page administration
|
And I choose "Delete" action for "TF" in the question bank
|
||||||
And I click on "Edit" "link" in the "TF" "table_row"
|
|
||||||
And I choose "Delete" in the open action menu
|
|
||||||
And I press "Delete"
|
And I press "Delete"
|
||||||
And I navigate to "Reports > Question instances" in site administration
|
And I navigate to "Reports > Question instances" in site administration
|
||||||
When I press "Get the report"
|
When I press "Get the report"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue