showQuestion and answerResult should only be used by developers given permission to use the Question Overlay.
Legends of Learning Platform: JavaScript API
The LoL Game API is implemented as a sequence of asynchronous calls between an iFrame parent and child. Use the browser's built in window.postMessage to send outgoing messages, and window.addEventListener("message", message => {...}) to receive messages. Details on each method are linked below.
// payload received (JSON stringified){"welcome": "Welcome!","readyToPlay": "Are you ready to play?","greatJob": "Great job!","pressContinue": "Press the next button to continue.","onePlusOne": "One + One = Two"}
window.addEventListener("message",function (msg) {// Message name and JSONified payloadconst { messageName,payload } =msg.data; if (messageName ==='loadState') {// Your STATE handler herebreak; }});parent.postMessage({ message:'loadState', payload:'*' },'*');