Skip to content

Settings not being imported after import in Moodle #170

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

Open
tanurov opened this issue Oct 10, 2024 · 6 comments
Open

Settings not being imported after import in Moodle #170

tanurov opened this issue Oct 10, 2024 · 6 comments

Comments

@tanurov
Copy link

tanurov commented Oct 10, 2024

Dear team,

We have recently recieved a report from a teacher that after importing the block LevelUp in a new moodle course, not all the settings of the block were there:

  1. The level names were all deleted together with their descriptions.
  2. The CRUD settings were added to each seprate rule and also to the plugin in general, just like when you add it as a new block.
  3. For each rule (aprox. 10-12 added for the entire course), first there was the correct rule, then the same rule again, but with 'Error: unknown module'.

We are currently using the moodle version 4.1.13. The LevelUp version we are using is 3.16.0

This would result into having to delete all the extra added settings and filling out missing ones each semester, since it's an university and the teachers are reusing their courses very often.

Thanks in advance for your work!

Best
Tina

P.S. I've noticed this issue being reported in a forum in 2019: https://moodle.org/mod/forum/discuss.php?d=387354

@FMCorz
Copy link
Owner

FMCorz commented Oct 10, 2024

Hi @tanurov,

Thank you for leaving your feedback on the restore process.

Moodle's import process (within the restore process) is designed to merge data within an existing course. What appears to be happening in your case is that the XP block already exists in the target course. When XP was already added (even if it has been removed), the settings and levels cannot be merged and are therefore kept untouched. The rules however, are merged and combined with the existing ones (the default crud ones that would have been created when XP was initially added).

With regards to the "Unknown module" rule, this may be a bug but it can also be an artefact of a misconfiguration in the course the data is being imported from.

Would it be possible for you to try and setup XP in a fresh new course (C1)? Then create a new course (C2) without adding XP to it. It is important to note that XP should not be added, even automatically as a default block. And then to import C1 into C2. These steps should apply XP's setting as you'd expect in C2.

Thank you!
Fred

@tanurov
Copy link
Author

tanurov commented Oct 10, 2024

Thank you @FMCorz , this was actually the case in my test, everything looks like it should.

However, the teacher reports that they hadn't set up a LevelUp block in the new course. We will continue to observe this in other courses and in future semeters.

Thanks for your help and kind regards
Tina

@tanurov
Copy link
Author

tanurov commented Mar 25, 2025

Hello,

me again :) So the same thing keeps happening again. I have done several tests. I do the following:

  1. I create a blank course. The course does not contain a XP block.
  2. I go to course reuse and import everything from the course that already contains Level Up XP (level description, 5 levels in total, points assigned)
  3. The XP block now contains 10 levels with no description, the points for the activities remain + the crud points are added.

We are currently running the XP version 1.17.1 (Pro) on Moodle 4.1.16+

Thanks in advance for your help
Tina

@FMCorz
Copy link
Owner

FMCorz commented Mar 25, 2025

Hi @tanurov,

That's intriguing but I may have an idea. It's likely that the import process starts by adding the block, which in itself sets the default config, levels, and crud rules. Then the restore process checks if those exist and does not override them in order to prevent inadvertently overriding information.

Would you be able to try to backup the original course, and the "Restore" its backup into the blank course? You would select "Restore into this course" with "Delete the contents of this course and then restore". Could you please confirm whether this produces the intended result?

Thank you!

@tanurov
Copy link
Author

tanurov commented Mar 26, 2025

Hi @FMCorz ,

Thank you very much for the quick response.

That worked. Everything's there.

However, I imagine this would be still frustrating for some users, because they don't have rights to restore courses, only the admins at our university do, so they would always have to contact us. It would be great if this could be fixed somehow in order for it to be more user friendly to the end users.

Best,
Tina

@FMCorz
Copy link
Owner

FMCorz commented Mar 27, 2025

Cool, thanks for confirming @tanurov!

We'll see if we can try to work someting out. The challenge here is managing different expectations from different users, and the behaviour of the import feature which typically adds to the course and does not override existing data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants