Do you have a postmessage API?

Yes, indeed! 

Get started with Easy LMS

Request a free demoorStart a free trial

The Postmessage API is used to send some extra information to your embedding page of our exams. The next part is a bit technical so bear with us. The postMessage API will now push a message that will look something like this:

        status: 'ranking',
        ranking: {
               score: 50,           // Number, the mark for the exam. 100 means 100% correct, 0 means 0% correct correct
               answered: 2,         // Number, The amount of answered questions for this session
               correct: 1,          // Number, the amount of questions that were answered (partially) correct
               incorrect: 1,        // Number, the amount of questions that were answered wrong
               points: 2,           // Number, The amount of points scored for this session
               maximum: 4,          // Number, the maximum amount of possible points for this session
               category: {
                       title: 'Failed'  // String,

For your ease below I've added a sample JavaScript that you can use on your embedding page. It makes use of the jQuery library, but that requirement can be quite easily removed if necessary.

<script type="text/javascript>
// Sample implementation of events. Using jQuery v1.7 or higher
// Should work on following browsers:
jQuery(window).on("message onmessage", function(event) {
        var     origin = event.originalEvent.origin;
        var     allowedDomains = [
        try {
               var     data = (typeof === "string") ? JSON.parse( ||;
        catch (e) {
        if (allowedDomains.indexOf(origin) !== -1 && data.status && data.ranking) {
               // Your custom script....
               // The following variables are available
               data.ranking.score;           // The mark in (%) for this exam. eg. 100 for everything correct and 0 when every answer was wrong
               data.ranking.answered;        // The total amount of answered questions
               data.ranking.correct;         // Amount of correctly answered questions
               data.ranking.incorrect;       // Amount of wrong answered questions
               data.ranking.points;          // The amount of points that the particpant got for this session
               data.ranking.maximum;         // The maximum possible points for this exam
               data.ranking.category.title;  // The name of the category the particpant falls in. Likely to be 'Passed' or 'Failed'
If there are some problems with the implementation you know to find our support at

Get started today!

Join almost 1 million users and try out our awesome tool.

Start your free trial today