New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Link between original and restored choicegroup module after course is backed up and restored to new course #185
Comments
I tried to replicate this in Moodle 3.11.1+ with Choicegroup 1.33 for Moodle 3.5-3.11 (Build: 2021083100). |
@chiaravicere it's likely that the issue is in only in later versions of Choicegroup. We've used Choicegroup for several years and only discovered this bug recently. We upgraded all plugins in late september 2022, Choicegroup to 1.34. (We then upgraded to 1.39 to see if that solved the problem which it didn't). |
@chiaravicere We have now tested in a "clean" local computer installation, with Moodle 3.11.12 and Choicegroup 1.39 (Build 2023010300) and the problem is exactly the same: The Choicegroup in the copied course mirrors the members in the original course. |
@NicoAlexH @chiaravicere Today, to make absolutely sure, I installed the latest Moodle MAMP package for OS X on a local computer and ran the same tests. Moodle 4.1.1 (Build: 20230116), Group Choice 1.39 for Moodle 3.9-4.1 (Build: 2023010300) |
Ok I can reproduce the error. It occurs when the course is restored. In the following file in line 75 The return value of
It is an object and therefore true, then The query |
@miotto great, we will try this! |
@cdipe It does not fix the problem of already existing instances. |
@miotto we did the fix in our QA (moodle 3.11.10) and it works as expected. Thanks! |
@NicoAlexH can this be expected as a patch or a new release soon, since this is a bug that will cause for everyone copying a course where Group Choice is used? |
@miotto great, thank you! |
I think it would be great if there would be a hint here for a DELETE or UPDATE command which would allow to fix this (delete the non legit choices of now non-participants) on database level. Best, |
@NicoAlexH could you come up with such a query ? |
A possible SQL query
Or for deleting
|
Thanks @miotto ! Indeed this looks like it would clean up messy @lucaboesch would this do the job for you? |
Or with a new version in the update.php script.
|
Okay, this deals with removing wrong group choices which then would lead to a choicegroup activity emptied of options. Find what ID the choicegroup has, e.g. by searching it for name and course.
Then, with that ID, e.g. 4758, look up the options.
The group id are those of the old course (the wrong ones, probably filled), so you have to go bend them straight again and update to the current group ids which you have to look up beforehand in the UI (I don't explain that group ID lookup step in detail here).
This should lead to the correct options. |
Using Moodle 3.11.10 and Choicegroup 1.39 for Moodle 3.9-4.1 (Build: 2023010300)
When having backed up a course using mod_choicegroup, without backing up users and user data, the new course's choicegroup still contains the names of students from the backed up course. There is a link between the choicegroup modules when copied, making the copy show the members of the original.
To replicate:
Extended testing
11. Go to the original course's choicegroup module, log in as the student that was removed from the group (9) and select a group
12. Go to the new course's choicegroup module and verify that the same students name is added to the same group there as well
13. Finally: Go to the settings of the new course's choicegroup module and verify that there are actually no groups added to be selectable.
The text was updated successfully, but these errors were encountered: