-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Add leaderboard for achievements. #2579
base: develop
Are you sure you want to change the base?
Conversation
6ebf2c3
to
66f2ceb
Compare
66f2ceb
to
d2141f3
Compare
d2141f3
to
95843d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several changes that are needed here. I also suggested some changes that should improve loading the needed data from the database some.
Also, to take the "Leaderboard" to "Achievement Leaderboard" comments further, I think you should rename |
@drgrice1 thanks for your suggestions. I'll add them later. I did initially call this the "Achievement Leaderboard", but felt the name looked to long in the menu, and then I put "Leaderboard" indented under the "Achievements" link, but felt the offset looked odd, and ended up just calling it "Leaderboard" with no offset. I'll go change the name back, just sharing my thought process. |
Yeah, I did note that "Achievements Leaderboard" does become the longest name in the site navigation. But it seems to still fit okay. |
95843d5
to
1ce79e9
Compare
@drgrice1 thanks again, your suggestions improve load speed quite a bit here. Still takes a couple of seconds, but 3 seconds is faster than the 15 or so seconds I was getting. |
1ce79e9
to
30586c1
Compare
This adds a leaderboard for achievements, which ranks users from the greatest to the least number of achievement points along with showing the badges of all earned achievements. The default use of this is to provide a summary page for professors to see how many achievement points students have earned along with which badges they have earned. The default permission level to view the leaderboard and see usernames on the leaderboard is professor. The permission level for viewing the leaderboard and viewing names on the leaderboard can be changed under course configuration to allow students to see the leaderboard. It is noted that since achievement points are often closely related to grades, that this should be considered before allowing students access.
Rename "Leaderboard" to "AchievementsLeaderboard". Implement the code and database improvements to make the page load faster.
30586c1
to
3ad85d9
Compare
This adds a leaderboard for achievements, which ranks users from the greatest to the least number of achievement points along with showing the badges of all earned achievements.
The default use of this is to provide a summary page for professors to see how many achievement points students have earned along with which badges they have earned. The default permission level to view the leaderboard and see usernames on the leaderboard is professor.
The permission level for viewing the leaderboard and viewing names on the leaderboard can be changed under course configuration to allow students to see the leaderboard. It is noted that since achievement points are often closely related to grades, that this should be considered before allowing students access.
Note, this is currently a little slow since it loops over all students, and for each student loops over all achievements making multiple database calls to get the user achievement records. In my class of 40 students with 80 achievements, it takes about 5 seconds to generate the page, and could be slower for much larger classes. I would like to speed this up, but unsure on how to more efficiently make database calls to get all the achievement data needed to build the leaderboard.