Creating Dynamic Content leveraging Javascript
Sep 29, 2021
Our use case is we want to personalize content and navigation when a student is taking a course.
I have seen several examples in Articulate knowledgebase that leverages variables and state to have the course behave differently based on user actions. In our case, I want to set the value of the variables in a Javascript that has business logic that defines what the value of the variable should be.
Is this a common technique to implement our use case or are there other suggestions?
This is best documentation I saw related to Javascript https://articulate.com/support/article/Articulate-Storyline-360-JavaScript-Best-Practices-and-Examples but am concerned that Articulate says that they dont publish system variables and such.
Thanks,
Vijay
2 Replies
Hi Vijay,
I'm not sure I fully understand your use case, but I have written several articles on JavaScript and Variables in Storyline, maybe one of them will help you. See links below.
https://community.articulate.com/discussions/articulate-storyline/example-use-case-for-instructor-driven-course-customization
https://community.articulate.com/discussions/articulate-storyline/is-javascript-needed-storyline-360-vs-javascript-code-offerings
https://community.articulate.com/discussions/building-better-courses/export-variable-values-via-email-message-using-javascript
https://community.articulate.com/discussions/building-better-courses/grant-course-completion-in-lms-based-on-branching-path-completion
Hope these help!
Javascript gives you the option to do anything in Storyline. Zsolt Olah's 99 tips are a good place to start your journey. https://www.rabbitoreg.com/examples/p99/#/
And indeed its true that Articulate doesnot support custom Javascript... but in my opinion thats more self-protection for too many Javascript related questions then anything else. Especially if you dive deep into the Articulate Storyline code, its all Javascript based.
Biggest issue you have to be aware of is scope. As each trigger and slide has its own scope that for sure can be a nuisance. Offcourse you can workaround that, but you for sure need to be aware of it.
Variables are your best bet indeed to get things done in combination with Javascript. As you can set and get them with JS, its quite easy to trigger default Storyline functions.