Ranking block

Blocks ::: block_ranking
Maintained by Willian Mano Araújo
A ranking block to improve the gamification into the course.
Latest release:
1664 sites
96 fans
Current versions available: 3

Moodle Ranking block repository


This block is and will remain free, but your donation allows me to continue the development, and any amount is greatly appreciated.

Imagem com link para doação

This block improves gamefication into the moodle plataform.

This new version is more simpler and easy to use, but, with more visual.

The plugin works listening moodle events, so now, the points are added in real time.

The ranking works with the activity completion tracking, so you need to enable that and configure the criterias for all activities you want to monitor. The plugin only add points to activities with completion criterias. The method to add points remains the same.

There are different ways to gain points.

For example:

  • If a student completes a html page the ranking adds 2 points.
  • If a student completes an assignment and it is ended only when the student receive a grade. The ranking add 2 points plus the grade points to the student. You can configure the default points in the block configuraion.

NOTE: All the activities that needs grade to be finished will add the activity points (default 2) more the activity grade. For example: If the course has one assignment and it's configured to be completed only after the grade is received by the student and let's say a random student received by the end of the assignment 10(ten) as his grade. In this case that student will obtain 12(twelve) points, the 2(two pre-configured) from finishing the activity plus 10(ten) from his grade.

This only occurs with activities that have grades. ex: foruns, assignments, lessons, etc...

For Moodle version 3.2+ 

With the new chart api in moodle version 3.2 i added some graphs to see the groups performance. Enjoy and feel free to send me your feedback.

Update Notes

  • Added graphs page
  • Added event listeners to add point
  • Removed cron dependency
  • Added a weekly ranking
  • Added a monthly ranking
  • Added a tiny report with top 100 students in general ranking
  • Added filter the tiny report by groups (the course group mode needs to be "separeted groups" or "visible groups")
  • Now you don't need configure the course completion tracking, only the activities completion criterias. Again, the plugin only monitors the activities with completion criteria
  • The table ranking_cmc_mirror was removed.


First way

  • Clone this repository into the folder blocks.
  • Access the notification area in moodle and install

Second way

  • Download this repository
  • Extract the content
  • Put the folder into the folder blocks of your moodle
  • Access the notification area in moodle and install

Post instalation

After you have installed the block you just add it into the moodle course.

The ranking block works together with the activity completion, so you need to enable that and configure the criterias for all activities you want to monitor. The ranking block monitors these activities and add points to the students based on accomplishing the activities.

Enabling completion tracking

  • Go to: Site administration / Advanced features
  • Turn on the item "Enable completion tracking"
  • Inside the course go to: Course administration / Edit settings
  • In the section Completion tracking set "Completion tracking" to yes
  • Save


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6


Willian Mano Araújo (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS


  • Sat, Mar 1, 2014, 11:29 AM
    I'm using Moodle 2.6.1
  • Tue, Mar 4, 2014, 1:49 PM
    How to Each session will be linked to general rating system and also Each session will be linked to a (general comments)Memo field for feedback.
  • Tue, Mar 4, 2014, 1:51 PM
    Hello. ! I was trying to use this block but when I try to update moodle database. It doesn't update the screen keep in color white. When I press the bottom update and nothing happen.
  • Thu, Mar 6, 2014, 7:07 PM
    Hello Atul Kachhadiya, what is your moodle version? Are you using mysql?

    The rating system monitor only activities marked in moodle course completion.
  • Sun, Mar 9, 2014, 8:53 PM
    I too cannot install this as two other posters have noted. I am using moodle 2.6.1. The install hangs at a white screen when trying to upgrade the database.
  • Mon, Mar 10, 2014, 1:17 PM
    Jehova Leal, Atul Kachhadiya and Richard Smyton. Thank you so much. I finally found the error and fix it. Please download the block again and test. More one time, Thank you! xD
  • Sat, Mar 15, 2014, 12:48 PM
    @Jehova and @Atul on line 47 of /block_ranking.php there is an attempt to test empty(trim($this->config->ranking_title)) which fails because the empty function expects a variable and will not use the return value of a function.
    I changed the line to
    if (isset($this->config->ranking_title) && !(trim($this->config->ranking_title)=='')) {
    which works.

    the same thing also happens on line 41 and line 42 and line 253 of /lib.php in the same folder.

  • Sat, Mar 15, 2014, 12:54 PM
    To clarify further, the PHP function EMPTY() in version before PHP 5.5 only allowed variables. As of PHP5.5 the function accepts other entries such as the return value of a function.
  • Tue, Mar 18, 2014, 3:23 AM
    Hey, Shane Edwards. Thanks for your reply.
    I've solved this in the last version.
  • Fri, Mar 21, 2014, 2:56 PM
    How to use the block ranking
  • Fri, Apr 4, 2014, 10:58 PM

    If you want to be able to add this block on a MS SQL Server powered Moodle, you need to make some little code changes in lib.php:
    1. On line 52-53, replace 'SELECT DISCTINCT' by 'SELECT DISTINCT TOP $limit'
    and replace on line 64 'LIMIT ".$limit;' by '";'

    2. On line 53, replace 'CONCAT(u.firstname, ' ', u.lastname)' by '(u.firstname + ' ' + u.lastname)'

    3. On line 144, replace 'IFNULL' by 'ISNULL'

    Some changes might still be needed by I haven't found any other problem yet (still testing the block).

  • Mon, Apr 14, 2014, 5:11 AM

    In my Moodle 2.5.2 the ranking block doesn't add points to completed activities that have grades, for example: hot potatoes quiz, quiz, scorm, etc. Ranking block version: 2014022400.

    Best regards
  • Fri, May 9, 2014, 8:51 PM

    This plugin looks great, but in my Moodle 2.5.5 over PostgreSQL doesn't work (version: 2014022400).

    The plugin is installed normally, but when I try to add the block to a course I get a blank page and doesn't load that course page any more (I have to uninstall the plugin to do so).

    Help will be appreciated.
  • Fri, May 23, 2014, 5:21 PM
    Using Moodle 2.7. Instaled block, activated. One user added to course. Course completion atcivated, Activities on the course (Quizzes, Scorm, links and documents), all of them must be marked as completed by user. Cron activated ("Processing cron function for ranking....... No new points to be computed") and block displays "No students to show".
  • Sat, May 24, 2014, 4:29 PM
    Does anyone maintains this plugin? It seems to be abandoned. What a shame!
Please login to post comments