filmov
tv
How to use JavaScript within Articulate Storyline 360 | Byte Tutorials | E-Learning | Tutorials

Показать описание
How to use JavaScript within Articulate Storyline 360? In this video, I’ll explain to you step-by-step how to create a project and use JavaScript to calculate simple interest.
Project Brief:
► Introduction
Let's talk about what is possible using Articulate Storyline and what is not. And then how you can use JavaScript to accomplish it. How you can use JavaScript within Articulate Storyline 360 using triggers to build complex modules that will take a lot of time to build otherwise without JavaScript.
► Creating the example project
I am creating a Simple Interest calculation scenario using JavaScript and Numerical Entry Fields in this example project.
► Understanding Trigger panel
In the Trigger panel, you will see only 1 trigger that you have to create, and the other 4 will be automatically created when creating the Numerical Entry Fields. I renamed the variables associated with Numerical Entry Fields from the Manage Project Variables window or Variable window. Remember, you can only rename the variable and change its default value but won't change the type once created.
► Understanding JavaScript code
First, you need to initialize the GetPlayer() function of Articulate and create a constructor. Next, define three variables using the let keyword; you can use var too.
Now, we need to set the Articulate Storyline variables in the external variables. Here, we assign the value we type in these Numerical Entry Fields, Principal Amount, Rate of Interest, and Year into these external variables.
On the following line, we declare another variable, simpleInterestExternal, and use the simple interest formula, to calculate it. In the last line, I assign the value from the external variable Simple Interest External to the internal variable, which is Simple Interest.
► Publishing the project
Make sure to use the Web or LMS option while publishing the project. If you publish using Review 360, It will not work as expected because the JavaScript preview is not available in Review 360.
___________________________________________________________________________________________________
Chapters:
0:00 Introduction
0:26 Creating the example project
3:03 Understanding Trigger panel
3:58 Understanding JavaScript code
6:25 Publishing the project
6:54 Testing the project
___________________________________________________________________________________________________
🔔 Subscribe for more free E-learning and Storyline tips:
___________________________________________________________________________________________________
Trigger condition:
Action will be - Execute JavaScript
JavaScript - JavaScript
When - When the user clicks
Object - Calculate
___________________________________________________________________________________________________
//JavaScript code:
let player = GetPlayer();
let principalAmountExternal = player.GetVar("principalAmount");
let interestRateExternal = player.GetVar("rateOfInterest");
let yearExternal = player.GetVar("year");
let simpleInterestExternal = (principalAmountExternal * yearExternal * interestRateExternal) / 100;
player.SetVar("simpleInterest", simpleInterestExternal);
___________________________________________________________________________________________________
#ArticulateStoryline360 #AdvancedTriggers #JavaScript #ByteTutorials
Project Brief:
► Introduction
Let's talk about what is possible using Articulate Storyline and what is not. And then how you can use JavaScript to accomplish it. How you can use JavaScript within Articulate Storyline 360 using triggers to build complex modules that will take a lot of time to build otherwise without JavaScript.
► Creating the example project
I am creating a Simple Interest calculation scenario using JavaScript and Numerical Entry Fields in this example project.
► Understanding Trigger panel
In the Trigger panel, you will see only 1 trigger that you have to create, and the other 4 will be automatically created when creating the Numerical Entry Fields. I renamed the variables associated with Numerical Entry Fields from the Manage Project Variables window or Variable window. Remember, you can only rename the variable and change its default value but won't change the type once created.
► Understanding JavaScript code
First, you need to initialize the GetPlayer() function of Articulate and create a constructor. Next, define three variables using the let keyword; you can use var too.
Now, we need to set the Articulate Storyline variables in the external variables. Here, we assign the value we type in these Numerical Entry Fields, Principal Amount, Rate of Interest, and Year into these external variables.
On the following line, we declare another variable, simpleInterestExternal, and use the simple interest formula, to calculate it. In the last line, I assign the value from the external variable Simple Interest External to the internal variable, which is Simple Interest.
► Publishing the project
Make sure to use the Web or LMS option while publishing the project. If you publish using Review 360, It will not work as expected because the JavaScript preview is not available in Review 360.
___________________________________________________________________________________________________
Chapters:
0:00 Introduction
0:26 Creating the example project
3:03 Understanding Trigger panel
3:58 Understanding JavaScript code
6:25 Publishing the project
6:54 Testing the project
___________________________________________________________________________________________________
🔔 Subscribe for more free E-learning and Storyline tips:
___________________________________________________________________________________________________
Trigger condition:
Action will be - Execute JavaScript
JavaScript - JavaScript
When - When the user clicks
Object - Calculate
___________________________________________________________________________________________________
//JavaScript code:
let player = GetPlayer();
let principalAmountExternal = player.GetVar("principalAmount");
let interestRateExternal = player.GetVar("rateOfInterest");
let yearExternal = player.GetVar("year");
let simpleInterestExternal = (principalAmountExternal * yearExternal * interestRateExternal) / 100;
player.SetVar("simpleInterest", simpleInterestExternal);
___________________________________________________________________________________________________
#ArticulateStoryline360 #AdvancedTriggers #JavaScript #ByteTutorials
Комментарии