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

feat(leaderboard): add default limit setting #163

Open maxandron opened 7 months ago

maxandron commented 7 months ago

Hi,

I'm opening this pull request to bring to your attention a feature we wanted that we couldn't find in the plugin so you can consider adding a similar feature or that someone else in the future may find it useful.

We wanted to limit the amount of students displayed in the main leaderboard. Prior to this PR the only way to limit is using the [xpladder top=?] shortcode.

I would not merge this PR because:

  1. It does not have unit tests for the change
  2. I would change the setting to be a text box accepting a number instead of a select
  3. I didn't ensure linting passes
  4. The version bump should probably be different

I made this quick and dirty to serve our purposes. Not sure if that would be useful to anyone else.

FMCorz commented 7 months ago

Hi Ron, thanks for sharing, that's a good idea!

I understand this is for your own needs, but it might be useful to always show the current user, even if they are out of bound of the restricted leaderboard.

Please note that the additional has not be added to backup/restore. This may not be of importance to you, but I just thought I'd share.

Thanks again!

maxandron commented 7 months ago

Thanks for the input! 🙏🙏🙏