var H5P = H5P || {}; /** * Will render a Question with multiple choices for answers. * * Options format: * { * title: "Optional title for question box", * question: "Question text", * answers: [{text: "Answer text", correct: false}, ...], * singleAnswer: true, // or false, will change rendered output slightly. * } * * Events provided: * - h5pQuestionSetFinished: Triggered when a question is finished. (User presses Finish-button) * * @param {Array} options * @param {int} contentId * @returns {H5P.QuestionSet} Instance */ H5P.QuestionSet = function (options, contentId) { if (!(this instanceof H5P.QuestionSet)) { return new H5P.QuestionSet(options, contentId); } var $ = H5P.jQuery; var cp = H5P.getContentPath(contentId); var texttemplate = '<% if (introPage.showIntroPage) { %>' + '