Simple logger API to keep track of random values generated dynamically by Items API and analyse their frequency.
npm start
const itemsApp = LearnosityItems.init(window.activity, {
readyListener() {
const nodes = document.querySelectorAll('.lrn_stimulus_content > span > strong');
const values = Array.from(nodes).map(node => Number(node.textContent));
fetch(`http://localhost:6789/?values=${values}`).then(() => {
location.reload();
});
}
});
Just hit http://localhost:6789/log
.