function XapiGenerator(markTheWords) {

    /**
     * Generate answered event
     * @return {H5P.XAPIEvent}
     */
    this.generateAnsweredEvent = function () {
      var xAPIEvent = markTheWords.createXAPIEventTemplate('answered');

      // Extend definition
      var objectDefinition = createDefinition(markTheWords);
      $.extend(true, xAPIEvent.getVerifiedStatementValue(['object', 'definition']), objectDefinition);

      // Set score
      xAPIEvent.setScoredResult(markTheWords.getScore(),
        markTheWords.getMaxScore(),
        markTheWords,
        true,
        markTheWords.getScore() === markTheWords.getMaxScore()
      );

      // Extend user result
      var userResult = {
        response: getUserSelections(markTheWords)
      };

      $.extend(xAPIEvent.getVerifiedStatementValue(['result']), userResult);

      return xAPIEvent;
    }
  }
/**
   * Xapi statements Generator
   * @param {H5P.MarkTheWords} markTheWords
   * @constructor
   */
Xapi statements Generator
@param {H5P.MarkTheWords} markTheWords
@constructor
Xapi statements Generator @param { H5P . MarkTheWords } markTheWords @constructor
function XapiGenerator(markTheWords) {
    this.generateAnsweredEvent = function () {
      var xAPIEvent = markTheWords.createXAPIEventTemplate('answered');
      var objectDefinition = createDefinition(markTheWords);
      $.extend(true, xAPIEvent.getVerifiedStatementValue(['object', 'definition']), objectDefinition);
      xAPIEvent.setScoredResult(markTheWords.getScore(),
        markTheWords.getMaxScore(),
        markTheWords,
        true,
        markTheWords.getScore() === markTheWords.getMaxScore()
      );
      var userResult = {
        response: getUserSelections(markTheWords)
      };
      $.extend(xAPIEvent.getVerifiedStatementValue(['result']), userResult);
      return xAPIEvent;
    }
  }
function XapiGenerator ( markTheWords ) { this . generateAnsweredEvent = function ( ) { var xAPIEvent = markTheWords . createXAPIEventTemplate ( 'answered' ) ; var objectDefinition = createDefinition ( markTheWords ) ; $ . extend ( true , xAPIEvent . getVerifiedStatementValue ( [ 'object' , 'definition' ] ) , objectDefinition ) ; xAPIEvent . setScoredResult ( markTheWords . getScore ( ) , markTheWords . getMaxScore ( ) , markTheWords , true , markTheWords . getScore ( ) === markTheWords . getMaxScore ( ) ) ; var userResult = { response : getUserSelections ( markTheWords ) } ; $ . extend ( xAPIEvent . getVerifiedStatementValue ( [ 'result' ] ) , userResult ) ; return xAPIEvent ; } }
Xapi statements Generator
 @param {H5P.MarkTheWords} markTheWords
 @constructor
Xapi statements Generator @param { H5P . MarkTheWords } markTheWords @constructor
/**
     * Generate answered event
     * @return {H5P.XAPIEvent}
     */ // Extend definition // Set score // Extend user result