Last updated:

WP Plugin: LearnDash Users Results Add-On

Introduction

For a LearnDash LMS based website I manage, the admin needed to manually copy paste all notes from her classrooms in another software used by the high-school, and which doesn’t have import CSV/SpreadSheets/File functionality.

It was not very handy because when you display LearnDash Quiz Results, you have to do open a page manually for each users, and the results are not filtered: you have all attempts to all quiz. It looks good, but you can’t filter the results, and copy pasting is not very easy at it requires to select with click and drag a lot of times. The LD native table table is nice and well adapted to a particular user progression in details, but a more efficient solution can be found to fit our particular needs.

The main issue was that the admin needed to have reports for all users of a classroom/groups. Reports per groups of users. So it required to first filter the student list by groups and then open a page for each one of them, and do the selection + copy pasting, taking care of the date, of the attempt index for the quiz etc. What a pain.

I came up with the idea of displaying students results per group on a single page, with results filtered to only display the attempt of a quiz (which is, in the vast majority of cases, the best score). And to make the copy pasting more easier, a simple click on a cell would copy the result. Also, I added filters to be able to only display the desired time range. This was a huge time saver, and more user-friendly.

To push the thing even further, I decided to add just a touch of DataVisualization, by including interactive bar charts below the tables.

I realized it could be useful to others, so I took two days to make it sharp and clean: it is now ready to be a premium add-on for LearnDash!

Let’s discover the features and the look of the plugin.

Update: few months later, I still update and maintain this plugin!

Features

  • Interactive Tables per Users with
    • Search filter
    • Sort by Quiz Name, Quiz Date, Last User Date, Score
    • Date filter (min and max)
  • Interactive Results Charts per User
  • Interactive Tables per Quiz Statistics Entry with
    • Search filter
    • Sort by User Name, Last User Date, Score
  • Interactive Results Charts per Quiz Statistics Entry
  • Custom user meta table (for certain shortcodes)
  • (New) Last or Best score front-end switch
  • Filter by LearnDash Group leaders
  • Possibility to output several users table and charts at the same times with groups shortcode
  • CSV Export
  • Global copy button, or simply click on a cell to copy a value
  • Display only most recent quiz attempt for each quiz
  • Customizable chart with filter
  • Update from Dashboard
  • Charts and tables customizable with CSS. For the chart, see Highcharts doc.

Compatibility

Usage

ShortCodes

Display a single user quiz results table

[ld_group_quiz_table]

Different features for the users tables shortcode (Fixed header, fixed users column, charts filtering etc…).

Display a group of users quiz results table

[ld_group_quiz_results]

Different features for the group table shortcode (Fixed header, fixed users column, charts filtering etc…).

Display all results for LearnDash groups

A useful shortcode for admins, wich let you choose what you want to display, on one single page.

ld_group_quiz_results_all

Very useful if you have a lots of groups!

Users Results Shortcode Attributes

These attributes are common to the [ld_group_quiz_table] and [ld_group_quiz_results] shortcodes. It is the same for ld_group_quiz_results_all but without the id support, as it is determined by the user with the drop-down menu.

Attribute Type Default Requirement Action Other Values
id integer or csv if type is set to users. 1 Required Choose a group ID integer or string.
type string "learndash" Optional Choose what kind of groups you want to display "groups" for itthinx Groups,
"buddypress" for BuddyPress,
"all" for all,
"users" for csv of ids,
"current" for current user only,
"learndash_leader" for only users for which the current users is group leader.
user_meta string, csv "" Optional Choose other user meta column to display for the ld_group_quiz_table shortcode. WordPress user_meta names separated by commas.
all_attempts string false Optional Display all attepts instead of just last or best. true for display all attempts of the user (not on user results shortcode for now).
quizzes_order string asc Optionnal Sort the quizzes by a specific order. desc for having quiz displayed for last published to first publish.
last_best string last Optionnal Display last or best results for the users. last for displaying last score, best for displaying best score,.
not_passed string '' Optionnal How to calculate non-passed quiz for the group render shortcode. '' doesn’t add non-passed quiz to the user calculations, 0 for considering a score of 0 for non-passed quiz,.

Display a quiz results statistics and its histogram chart

Are your quiz too difficult? Is there some users which are way above or below the average? What about the median and the overall distribution? Do you want to have a sorted table of your users results? The table and the histogram rendered by this shortcode will help you to answer this question.

The user score is the highest score he got, which is usually his last passage.

[ld_quiz_stats id="0"]

The id is the post id for which you want to display the results statistics table and histogram.

Display is similar to the shortcode presented below.

Display a post quiz children results statistics and their histogram chart

Like the above shortcode but with front end control to allow you to choose any courses, lessons and topics and get their quiz children. A course has to be set to avoid huge request on the server.

[ld_quiz_stats_all]

Histogram view in action! (Notes, column headers text is wrong in this screenshot, but this has been corrected).

Display group quiz attempts statistics and associated bar chart

[ld_group_quiz_attempts] will display a table and chart to compare the number of quiz attempts VS quiz mastered by users. Attributes are mainly the same as [ld_group_quiz_table] shortcode.

There is also an Average and Total line. Beware that Score and Quizzes don’t count the same thing, they are only shown at the same time on this screenshot for illustration purpose, but it is in fact a toggle between “show average score” and “show quizzes”.

Hooks

Filters

The following code snippet are the filters declaration, not usage examples. You can see examples usage on this Gist page.

learndash_users_results_datatable_data
apply_filter( 'learndash_users_results_datatable_data', $data_attr, $user_id );

This can allow you to add more parameter as data attribute for the tables, especially for rendering the graph.

learndash_users_results_user_display
apply_filters( 'learndash_users_results_user_display', $user_info );

This filter allows you to change user names display. Useful to replace it by Last Name + First Name, or by randomly generated strings.

learndash-users-results-users
apply_filters( 'learndash-users-results-users', $users, $tags );

This filter allows you to modify users list.

learndash_users_results_quizzes
apply_filters( 'learndash_users_results_quizzes', $quizzes, $user_id );

This filter allows you to modify users what quiz should be rendered.

Notes

  • Coded with WordPress conventions and standards in mind.
  • Clean deactivation and uninstall process.
  • Minimal default styles for better integration in your theme.
  • Default sorting arrows for table required Font-Awesome, but you can replace them with custom CSS.
  • Performance is highly dependent on your amount of data. The more quiz and users you have, the more it can take to load.
  • Showcased on the official LearnDash Community Addons page: More LearnDash Add-Ons | LearnDash

Development Status

No new features planned at this time. The plugin already satisfy more than what I initially needed. The only known issue is that I don’t have find a way to make datatables buttons (copy and successful copy) translatable in a WordPress-friendly way at this time.

Some customization ability (hooks, shortcodes attributes, plugin compatibility) can be suggested by users. Advanced customization/update may require custom development contract.

Changelog

v1.7.0 (2023-07-27)

  • Update Highcarts to v11.0.1
  • Update DataTables to 1.13.4
  • Remove clipboard JS – replace by pure JS
  • Remove jQuery Inview – replace by pure JS
  • Various fixes and optimization

v1.6.2 (2021-08-09)

  • Multisite admin menu

v1.6.1 (2020-06-16)

  • Add not_passed shortcode attributes support for the ajax render “all” shortcode

v1.6.0 (2020-06-16)

  • Add last_best shortcode attributes for shortcode displaying user score.
  • fix some CSS styling
  • Updated dependencies
  • Minor optimization

v1.5.3 (2019-07-16)

  • Version bump

v1.5.2 (2019-05-31)

  • Clipboard.js updated to prevent JS problem with WordPress 5.2.

v1.5.1 (2019-02-18)

  • Updated dependencies
  • fix type="learndash_leader" for all shortcodes.
  • quizzes_order new attribute
  • all_attempts new attribute

v1.5.0 (2019-02-12)

  • type="learndash_leader" for all shortcodes.
  • New [ld_groups_quiz_attempts] shortcode
  • Few optimizations

v1.4.6 (2018-12-09)

  • learndash_leader shortcode attribute for ld_group_quiz_results_allshortcode.
  • Bug fixes

v1.4.5 (2018-10-29)

  • -0 score became “Not passed” string.

v1.4.3 (2018-06-25)

  • user_meta attribute shortcodes

v1.4.2 (2018-04-05)

  • Bug fixes

v1.4.1 (2018-04-04)

  • ld_quiz_stats column header fixed

v1.4 (2018-04-03)

  • New shortcodes: ld_quiz_stats and ld_quiz_stats_all
  • Update Highcharts to v6

v1.3 (2017-10-04)

  • New shortcode: ld_group_quiz_results_all
  • Prevent shortcode interference
  • Fix reset date filter
  • Update EDD updater

v1.2 (2017-08-03)

  • BuddyPress groups support.

v1.1.1 (2017-07-07)

  • Add ld_group_quiz_results_leader and ld_group_quiz_table_leader shortcodes.

v1.1 (2017-06-09)

  • Update bug fix
  • New ld_group_quiz_table shortcode with table and graph
  • Style charts by CSS
  • Warning (backward compatible issue): ld_user_quiz_results shortcode is replaced by [[ld_group_quiz_results type=”current”]]
  • New “id” types for shortcodes (you can put id of users as CSV)
  • Charts lazy loading (now appears only if their source table is on screen)
  • Charts columns colored according to “quiz-passed” status
  • Prevent image loading by DataTables, now required Font-Awesome or custom CSS for sorting arrows display
  • New filters for quiz and users
  • Performance optimizations

v1.0.4 (2017-05-12)

  • New filter to change user name display. See doc on the product page.

v1.0.3 (2017-05-05)

  • Don’t load assets from CDN (all scripts and styles are now included).
  • Small refactoring and optimizations

v1.0.2 (2017-04-28)

  • Bug Fix
  • All groups type attribute

v1.0.1 (2017-04-28)

  • New translation strings

v1.0 (2017-01-31)

  • Initial release

Licenses

License are valid 365 days, from purchase date.

  • 1 site, for non-profit

  • 3 sites, for business companies

  • 5 sites, for business companies