Custom Library (or extend) + Analytics in D2L



I have an existing JavaScript program that will generate an infinite number of math problems of different types and complexities, but there is no way to in D2L Brightspace to track how many questions students do. Our D2L support people suggested H5P as we can get completion stats (analytics?) once we go over to the full license.

The idea is that students to log in and do as many problems as they would like to do. Check their answers and mark whether they got the quesiton right or wrong. I would like to record an array of the latex for each question attempted, the total number attempted and the number correct (as self assessed).

I have a play and I can ge my javascript library to put latex in H5P which displays nicely using MathJax ( via Math Display 1.0.5) so I know I can do the front end using H5P

This leads me to a couple of questions:

  1. I presume if I write my own Content library from scratch I will need to use some API calls to pass user details to the analytics. Is this documented?
  2. I don't know what analytics are provided, are these accesed through D2L or

In terms of development there are several content libraries that could be extended. As the student is 'self-marking' they are effectively true false questions. I would just need to feed the question in dynamically and keep giving a new question until the click 'quit' or some such.This would potentially avoid programming for the analytics, but I'm having a hard time figuring out where to put my JavaScript in some of the exiting libraries.

The existing "Arithmetic Quiz" library is close, but I would like a cleaner UI and I don't want to hard code the number of questions, I already have the code to generate questions. I'm clearly missing something as I can't figure out from the files where the first bit of code runs from if that makes sense, so I don't know where to put my code.

I'm sorry that this is a little vague, but I feel if I can get a small bit of help I'll be able to get on top of this.

Many thanks for your patience,


falcon's picture

Hi James,

Sounds interesting. To get the basics of creating H5P content types you could have a look at our content type development documentation. There is also a tutorial there. 

The closest to what you want to do might be H5P Question Set which has a feature for picking random questions from a question bank, but the number drawn is pre-defined there as well.

Here is the documentation for the reporting part. We use xAPI to communicate between the content types and the H5P Core.