How results come back
Keep each learner's result from your interactive page, and see what the game never sends.
- When a learner finishes, the game sends the result to your interactive page, and only to the pages in Page address. It never sends results to us, and our studio's gradebook does not show package plays.
- To keep results, your interactive page listens for the game's message and passes it to your gradebook. A listener looks like this (put your game's site in place of the address):
window.addEventListener("message", function (e) {
if (e.origin !== "https://games.school.example") return;
var m = e.data;
if (!m || m.v !== 1 || typeof m.type !== "string") return;
if (m.type === "rls:result") {
// m.result.masteryPercent, m.result.passed, m.result.itemsTotal ...: hand them to your gradebook.
}
});
- The score is
m.result.masteryPercent, from 0 to 100: the items right the first time out of all the items.m.result.passedis true at 70 or more. Every message's full format is inrls-messages.schema.jsonin the folder. - Accept messages only from your game's own site, as the first line of the listener does. If your page has more than one frame,
also check the message came from this one:
e.source === frame.contentWindow, whereframeis the interactive's iframe. - Results come from the learner's browser, so someone with the page open could change them. Use them for practice and progress, not for exam grades.
The messages, in detail
rls:readycomes each time the interactive opens,rls:startedwhen a learner starts, andrls:resultwhen they finish.- A learner who reached fewer than half the items gets no result: you see
rls:startedand norls:result. Match a result to its start bym.run. - A page that starts listening late can send
{"type":"rls:hello","v":1}to the frame from an address in Page address. The interactive then sendsrls:readyagain. - No
rls:readywithin 90 seconds means the interactive did not load. Check the folder withcheck.html. - We sometimes add a field to a message without changing
v, as we did withcheckandreplayOf. Ignore fields you don't know.
No names
- The game never asks for a name. Its messages carry no names and no learner, class or device numbers.
- A package asks us for one thing: its interactive, once per visit. That request names your school, the interactive and the game's version, and nothing about the learner. We note which version each interactive last ran at each of your web addresses, so your download page can show it.
- Progress is saved only in that device's browser. Shared computers: start fresh each visit clears it every visit. Safari may clear a framed game's saved progress after 7 days.
- There is nothing to turn off.