MDL-76026 Question bank: Fix errors related to categories renaming

This part of the code in 'question_category_object.php' 'update_category' method was used before Moodle 4.0 version for renaming
the random questions in an updated category. For Moodle 4.0, it is unnecessary as the details of random questions are no more
stored in 'question' table but in 'question_set_references' table. The method call move_question_set_references handles the same.
This commit is contained in:
Anupama Sarjoshi
2022-12-13 19:21:19 +00:00
parent ce6131e6f7
commit a85ff11cba
3 changed files with 23 additions and 17 deletions
@@ -51,3 +51,22 @@ Feature: Moving a question to another category should not affect random question
And I should see "Random (Used category)" on quiz page "1"
And I click on "(See questions)" "link"
And I should see "Used category"
@javascript
Scenario: Renaming a random question category should update the random question
Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
When I open the "last" add to quiz menu
And I follow "a random question"
And I set the field "Category" to "Used category"
And I press "Add random question"
And I should see "Random (Used category)" on quiz page "1"
And I am on the "Course 1" "core_question > course question categories" page
And I click on "Edit this category" "link" in the "Used category" "list_item"
And I set the following fields to these values:
| Name | Used category new |
| Category info | I was edited |
And I press "Save changes"
Then I should see "Used category new"
And I should see "I was edited" in the "Used category new" "list_item"
And I am on the "Quiz 1" "mod_quiz > Edit" page
And I should see "Random (Used category new)" on quiz page "1"