Forum Discussion

OwenHolt's avatar
OwenHolt
Super Hero
4 years ago

Passing Variable Data Between Storyline Blocks in Rise (a guide)

Did you know that you can use the computer's local storage to pass data from one Storyline block to another one within the same Rise course? Well you can and all it takes is a few simple lines of JavaScript code. 

This gives you all kinds of customization options for your Rise courses, including capturing and remembering the learners name and other selections they might make as shown here in this Rise example. What other ways might you use this?

https://360.articulate.com/review/content/b56569f8-4679-4c5c-a937-738eb98cc3fa/review 

  • JerryDonney's avatar
    JerryDonney
    Community Member

    Owen, if your still monitoring.. Does passing the variables from SL blocks work only on computers (local storage)?  Since Rise360 is responsive, does this data sharing work on mobile devices? i.e. phone or tablet storage?  Thanks  

  • SherriSagers1's avatar
    SherriSagers1
    Community Member

    Owen - You are a true hero! Thank you so much for sharing this. It's exactly what I was looking for!

  • I haven't taken time to fully debug but one thing I noticed is the use of spaces in your JavaScript before the open parenthesis. This will break your code.

    For example: var name = player.GetVar ("TextEntry") ;

    Should be: var name = player.GetVar("TextEntry");

    Try eliminating all of the extra spaces in your code and test it again. 

     

    • LindsayMaisel's avatar
      LindsayMaisel
      Community Member

      Owen, thanks for sharing this is awesome. Didn't even know this was possible.

  • BrianMcCann's avatar
    BrianMcCann
    Community Member

    Owen, thank you for sharing this. I've wanted to do something like this for a while. However, my lack of JavaScript knowledge has been a problem, and continues to be as I try to replicate this for one of my own projects.

    I'm hoping someone can help me out. I tried to modify the code snippets Owen shared in a quick demo, but they're not working, which means I'm screwing something up. I'm not sure what I'm doing wrong though.

    I've attached the Rise and both SL files. I wanted to design it so that in the first SL block someone puts their name in, clicks 1 of 2 guide characters, and then clicks submit. After they click the Continue button in Rise, the second SL block should show their name and the guide character they selected.

    Another question related to the example: how does the print certificate feature work in SL block 3? I've looked at some other threads, but they don't seem to work in HTML5 output.

    Any help is greatly appreciated. Thank you!

    ~Brian

  • Indeed great piece. One question pops out though. I tried using a 'completion' button after a Storyline block and it doesnot work in that case? What is your workaround to get that working?

    • PhilMayor's avatar
      PhilMayor
      Super Hero

      @Owen, this is great I want to use to create a journal throughout a short course, my only issue is persistence of values between session which will not be possible.

      @Math are you using the completion trigger in storyline?

      • MathNotermans-9's avatar
        MathNotermans-9
        Community Member

        Thx Phil. Your remark put me on the right track. Adding a 'Complete Trigger' in the Storyline fixed it... Great !!!!

  • This is awesome! Thanks for sharing, Owen. I am looking forward to using this.