To use shortcodes with Level Up XP, the plugin Shortcodes must be installed and enabled.
Shortcodes are short words delimited by square brackets such as
[xpbadge] which can be added to text editors in Moodle. When displayed, they are transformed into alternate content. The term shortcode was popularised by Wordpress.
Here are the shortcodes built-in Level Up XP:
- xpbadge: To display the level badge
- xpdrop^: To award points anywhere
- xpiflevel: To display, or hide, some context according to the students' level
- xpladder: To display the leaderboard
- xpteamladder^: To display the team leaderboard
- xplevelname: To display the level name
- xppoints: To highlight points displayed as experience points
- xpprogressbar: To display the progress bar
^ Requires Level Up XP+
Displays the badge matching the level of current user.
With this shortcode, points can be awarded virtually anywhere. However, it is not intended to be constructed manually. Please see the documentation page to use drops.
Displays the content within its brackets according to the user's level. When a level is stricly specified, the content will be displayed regardless of the other rules. The greater and less than rules must all match for the content to be displayed, watch out as that may sometimes result in the content to never be displayed! Note that teachers, or otherwise users with editing capabilities, will always see everything.
[xpiflevel 1 3 5]
Displayed if the user's level is exactly 1, 3 or 5.
Displayed if the user's level is greater than 3.
Displayed if the user's level is greater or equal to 3.
[xpiflevel >=10 <20 30]
Displayed if the user's level is greater or equal to 10 AND is strictly less than 20
OR is exactly equal to 30.
[xpiflevel <=10 >=20]
Never displayed because the user's level can never be less or equal to 10 AND more or equal to 20.
Note that these shortcodes CANNOT be nested within one another.
By default, a portion of the ladder surrounding the current user will be displayed.
To display the top 10 students instead of the neighbours of the current user, set the parameter
top. You can optionally set the number of users to display like so
A link to the full ladder will automatically be displayed below the table, if you do not want to display such link, add the argument
By default, the table does not include the progress column which displays the progress bar. If such column has been selected in the additional colums in the ladder's settings, you can use the argument
withprogress to display it.
Note that when a course is using groups, the ladder will best guess which group to display the ladder of.
Requires Level Up XP+
By default, a portion of the team ladder surrounding the current user will be displayed.
To display the top 5 teams instead of the teams neighbouring those of the current user, set the parameter
top. You can optionally set the number of teams to display by giving
top a value, like so:
A link to the full ladder will automatically be displayed below the table if there are more results to be displayed, if you do not want to display such link, add the argument
By default, the table does not include the progress column which displays the progress bar. If such column has been selected in the additional colums in the ladder\'s settings, you can use the argument
withprogress to display it.
Note that when the current user belongs to multiple teams, the plugin will use the one with the best rank as reference.
By default the tag displays the name of the current user's level.
Alternatively, you can use the
level argument to display the name of a specific level.
level argument is provided and the level does not exist, nothing will be displayed.
Displays, and highlights, a number of points formatted as experience points.
This shortcode was added in XP 3.12.0.
Displays the current user's progress bar towards the next level.