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

Editable default rules #26

Closed Canx closed 7 years ago

Canx commented 8 years ago

default rules aren't editable, it would be nice to have an option to change them. I guess you disabled them because default rules are applicable to all courses and any teacher could change them and interfere with other teachers courses. Maybe having an admin config page for defaults?

FMCorz commented 8 years ago

The reason why they are disabled by default is because I considered them as essential to the well functioning of the plugin. I found that it would have been too easy to make the plugin act strangely if some of the defaults events that I ignore were to be enabled, or if the default experience points were not making any sense.

I don't really have any strong opinion about making the defaults customisable by admins, but I fear that this is not enough. If you customise the default XP, you probably want to customise the default levels and their required XP as well. If not, then I do not think that changing the values would make sense. Also, if the admin changes the rules as some teachers are already using the block in some courses, then it could mess negatively affect their set-up.

Could you please describe your use case for this change? What events would you like to add/remove? In what way would you want to modify the rules as an administrator?

Cheers! Fred

PS: Updating the code shouldn't be too hard for you to set your own default rules.

Canx commented 8 years ago

Hi Frederic,

For me default rules (and also levels) should be a customizable template, maintained by an admin role.

I would use default rules when I'm starting to design gamification, adding general rules to activities types (for example: uploading a task), and then specific rules for each activity completion (for example: uploading THIS task). That way I can start gamificating without a big planning burden.

Having a default template of these general rules would make it even easier to start gamificating another course. I could start (as an admin or a similar role) tunning a default rules template, then I would add gamification block to courses (which would copy this template). Next I could modify default rules by course if needed. And finally add specific rules for each activity in a course.

Now I can modify default rules from source code (in function get_static_filters), but they are linked to all rules sets in all courses, not copied, and it's true that I could mess with other courses. I tried enabling rules (editable -> true) and I can change them from the GUI, but I cannot save them.

What do you think?

Cheers! Ruben.

PS: your code is great, very clean and easy to understand even for me! ;)

FMCorz commented 8 years ago

Thanks Ruben.

All right, so I understand. What you want are real default rules, such as ones set by the admin that will be copied over to new courses, and then be editable. Maybe I should start naming the "default rules" "core rules" instead to avoid the confusion. So those are sort of "templates" as they are editable by the teachers setting up their courses.

One thing though, when you say that you want to set a "default" rule for uploading THIS task, if you mean a specific event happening in a specific activity (e.g. a specific assignment), then this will not work. So I assume you meant filtering by event name, and not by location (contextid).

Changing the editable will not make the rules editable unfortunately. It is more of a flag which tells the renderers to display them in an editable mode, I'm actually surprised the UI did not crash after you enabled that. The only filters which are truly editable (and "savable") are the "users" filters.

What I would suggest you to do is to add more to the static filters by creating yours. At least you could have hardcoded default rules, which does not prevent teachers from overriding them even though it's not as flexible as templates.

Thanks for suggesting this improvement. I will think about it. I also remember someone asking me if it was possible to export the rules and re-import them later. I'm guessing that this could also be something to look into.

By the way, don't you agree that if you are able to create a template of rules, you should also be able to change the number of levels and their default required experience points? Perhaps also the default settings (show ladder, etc...).

Cheers! Fred

PS: Glad to read that :)

Canx commented 8 years ago

Hi Frederic,

I agree, a gamification template should have not only default rules but also default levels and other default settings. I also think default rules should only have specific events and event properties (not sure how to use this last one).

About your default rules, my pupils have learned very well how to find crud events that can level them up. And they repeat them as if they were grinding in WoW (like entering multiple times to forums and login in and out, so that's not very educative ;). Meanwhile I'll edit myself the static rules and I will change them, or override crud events with 0 points.

I hope you have time after bugs for new features! Exporting and importing gamification templates would be nice too ;)

BTW, if you need any help (testing, translating, minor programming..) maybe I can help.

Cheers, Ruben.

PD: sorry for the Eurobasket defeat!

Canx commented 7 years ago

Current version (3.0) solves the issue.