Detect user interaction with Player components?

Feb 13, 2024

Is there a way, perhaps using JS, to detect when a user clicks the Menu, Glossary, Resources etc.?

I am using xAPI to report other data to a LRS but also looking to see if this is possible.

Thank you.

4 Replies
Walt Hamilton

by when, do you mans the elapsed time of the project?

I always use my own Menu, Glossary and etc. Not because the built-in options don't work, but mostly because I can't stand the thought of my work looking like it came off the shelf in a box.  It also makes it a lot easier to do this sort of thing with triggers.

Nedim Ramic

Hi Jeff,

I don't know if you are still looking for a solution or if you may have already found one, but I wanted to share this thought to give you some ideas regarding your inquiry.

If I wanted to know if the hamburger menu was clicked, I would probably use this JavaScript code in an Execute JavaScript trigger when the timeline starts on this slide

let counter = 0;
const hamburger = document.getElementById('hamburger');
hamburger.addEventListener('click', () => {
  counter++;
  setVar("counter", counter)
  console.log(`Hamburger clicked ${counter} times`);
});

Now you can send a custom xAPI statement when the "counter" variable in Storyline changes:




When tested in ScormCloud I can see that the hamburger menu was clicked 5 times.