MDL-84193 qbank_bulkmove: Disable bulkmove on history page.

This removes the option to bulk move questions from the question
history page.
This commit is contained in:
Conn Warwicker
2025-01-20 10:07:41 +00:00
parent a2653cc924
commit 5107b5bcfc
2 changed files with 12 additions and 16 deletions
@@ -35,8 +35,13 @@ class plugin_feature extends plugin_features_base {
* @return bulk_move_action[]
*/
public function get_bulk_actions(view $qbank): array {
return [
new bulk_move_action($qbank),
];
// Don't return bulkmove if we are on the question history page.
if ($qbank->is_listing_specific_versions()) {
return [];
} else {
return [
new bulk_move_action($qbank),
];
}
}
}
@@ -124,19 +124,10 @@ Feature: Use the qbank plugin manager page for bulkmove
And I should not see "Question 3"
@javascript
Scenario: Move a question from one bank category to another from the history page.
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as teacher1
Scenario: Unable to bulk move questions from history page
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
And I choose "History" action for "First question" in the question bank
And I click on "First question" "checkbox"
And I click on "With selected" "button"
When I press "Move to"
# Select a different category to move the questions into.
And I open the autocomplete suggestions list in the ".search-categories" "css_element"
And I click on "Test questions 6" item in the autocomplete list
And I press "Move questions"
And I click on "Confirm" "button"
# Then go check that new category, as we'll still be on history page here.
And I am on the "Test quiz" "mod_quiz > question bank" page
And I apply question bank filter "Category" with value "Test questions 6"
# Confirm that selected questions are moved to selected category while unselected questions are not moved.
Then I should see "First question"
Then I should see question bulk action "deleteselected"
And I should not see question bulk action "move"