From version 5.0.5 the quiz plugin WatuPRO comes with a basic bar chart shortcode that can be used to display a chart in the final page of the quiz.
Here is an example of the chart:
This basic chart does not require the Reporting Module. Below is a more detailed explanation how to use the shortcode:
Please note this shortcode can be used only in the quiz output box. At the moment it won’t work anywhere else including certificates.
Using the shortcode
The shortcode to be included in the final screen is [watupro-basic-chart]
It can be used without any attributes in which case will produce a chart like in the image above. You can however use several attributes to customize it:
show – this attribute defines whether to show both charts, only the points chart, or only the percentages chart. The possible values of this parameter are: ‘both’, ‘points’, ‘percent’.
your_color – the color of the bar with user’s stats (your points, your % correct answer). Defaults to blue. Can accept color as a word or as hexadecimal value.
avg_color – the color of the bar with average stats (avg. points, avg % correct answer). Defaults to gray. Can accept color as a word or as hexadecimal value.
The following attributes are not documented in the Help page because using them improperly can cause on-screen errors:
your_points_text – defines the text written under “Your points” bar. Defaults to “Your points: %s”. You can change it but it must always include the “%s” variable.
avg_points_text – defines the text written under “Avg. points” bar. Defaults to “Avg. points: %s”. You can change it but it must always include the “%s” variable.
your_percent_text – defines the text under “Your % correct” bar. Defaults to “You: %d%% correct”. Must always include the “%d” variable.
avg_percent_text – defines the text under “Avg. % correct” bar. Defaults to “Avg. %d%% correct”. Must always include the “%d” variable.
Here is an example usage including several arguments:
[watupro-basic-chart show="points" your_color="red" avg_color="#00FF00" your_points_text="You: %s points" avg_points_text="Avg.from all users: %s points"]