FMCorz / moodle-block_xp

A gamification plugin for Moodle allowing students to gain experience points and level up.
https://levelup.plus/?ref=github
149 stars 41 forks source link

Settings not being imported after import in Moodle #170

Open tanurov opened 3 hours ago

tanurov commented 3 hours ago

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 commented 2 hours ago

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 commented 1 hour ago

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