Exit a web object in Storyline 360?

May 01, 2024

Hello! What are some ways to get the user to exit from a web object in Storyline? We would like them to return to Storyline for course completion.

18 Replies
Marianne Seidler

The slide contains three web objects. Each web object contains a Rise course that was translated into a different language. For example, the  three web objects can be the same course in English, French, and Spanish. So the learner needs to view only one of the web objects and then get credit for completion, but we want to ensure they have completed the course in the web object.

Phil Mayor

I am not sure I understand your setup. Are you loading scorms inside storyline as they won’t pass completion to storyline or the LMS.

Or are you loading rise as web output? Either way they won’t pass completion to the storyline module without some link. The storyline block should pass completion to the storyline block.

Sent from my iPhone

Phil Mayor

Depends on how the web object is linked, but if they are on the same domain, Yes, it is in an iframe within an iframe but you can send a variable from the storyline block that can be picked up form the storyline course and use a change in that to unlock the next button.

Sent from my iPhone

Nedim Ramic

Consider this idea: You could use an object or button within Rise to modify a Storyline variable. By altering this variable, you gain the ability to transition from Rise to the subsequent slide in Storyline simply by clicking the Rise button. I've attached a video to demonstrate this concept. To implement it, you'll need to import the published Rise course into Storyline as a WebObject.

Nedim Ramic

Phil is correct.

In Rise:
Create a button to signify the end of the course. I've entered 'next' as the button text, but feel free to use any text you prefer. We'll utilize its "aria-label" attribute later to distinguish this button in Storyline. For example, if you enter "NEXT", the "aria-label" will match this value. Publish to Web. Edit index.html located in your published folder and copy and paste the script bellow at the end of the body element: 



<script>

      let player = parent.GetPlayer();
      function findRiseBtn() {
        let riseBtn = document.querySelector('[aria-label="next"]');
        if (riseBtn) {
            // If Rise btn is found, attach the event listener
            riseBtn.addEventListener('click', function() {
                console.log('clicked');
                player.SetVar('complete', true)
            });
        } else {
            // If Rise btn is not found, wait for a short period and then try again
            setTimeout(findRiseBtn, 100); // Retry after 100 milliseconds
        }
    }

      // Start searching for Rise btn
      findRiseBtn();
    </script>


Note: This button won't be visible in Rise immediately upon launching the Rise course. Therefore, I've implemented functionality in JavaScript to continually search for it until it becomes visible. Once found and clicked, it will trigger a function to modify the variable value in Storyline.

 
In Storyline:
Create a T/F variable "complete" (or what ever you prefer, just make sure it matches the variable in the script above), and set it to "false". Insert a WebObject and choose the folder where the index.html of the published Rise course is located. Triggers in SL:



You can customize triggers as necessary. For example, display a popup message when the learner closes the Rise course before reaching the last block with a button, while the "complete" variable is still set to "false", or something similar. Please find the attached .story file that I used for testing purposes.