JI-2533 QS implement 'getContext()' (#81)

Co-authored-by: Ravi Majithia <ravikiran.majithia@joubel.com>
stable
Frode Petterson 2021-09-02 14:56:11 +02:00 committed by GitHub
parent d0dc718ff6
commit e941f693cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -1240,6 +1240,18 @@ H5P.QuestionSet = function (options, contentId, contentData) {
children: getXAPIDataFromChildren(this) children: getXAPIDataFromChildren(this)
}; };
}; };
/**
* Get context data.
* Contract used for confusion report.
*/
this.getContext = function () {
// Get question index and add 1, count starts from 0
return {
type: 'question',
value: (currentQuestion + 1)
};
};
}; };
H5P.QuestionSet.prototype = Object.create(H5P.EventDispatcher.prototype); H5P.QuestionSet.prototype = Object.create(H5P.EventDispatcher.prototype);