Creating analytics blocks

This functionality is only available in Quarterfall PRO.

In Quarterfall, it's possible to create your own custom analytics blocks by writing the JavaScript code that generates the analytics output. You can create new blocks in the global analytics settings to make them available for all courses, or you can create them for a particular course.

Such a piece of Javascript typically consists of three parts: Get the desired data, process it, and create a chart out of this. The chart data is returned.

The data you need for your analytics is available via a Knex-compatible database. For example, this line of code gives you the list of assignments:

const assignments = await knex("assignments");

(Don't forget the await, as this is asynchronous.) For more information about using the Knex library to access the database, see: Knex.js

Next you will process the data. This must result in a dataset that can then be displayed as a chart. You can output a variety of charts with the Quarterfall analytics suite. We support all charts provided by Chart.js. Also, it is possible to output a table. For example, a list of most active students. You can check the provided standard analytics blocks to get an idea of how this works.

While you are developing your analytics component, you can use console.log statements in your code to output debugging information. At the right you see the immediate effect of the code you are editing, with some temporary data.

Please note that creating your own analytics block is currently an experimental feature that may change in the future. For more information about how to use it, contact support.

Still need help? Contact Us Contact Us