Currently we don't support the Get and Set functions like the Flash player does with JavaScript triggers, but simple things like alerts should work. In one of the sample courses I have a trigger to Execute JavaScript when the user clicks the next button if a variable is less than 4. That JS is set to:
window.alert('You must explore all areas before proceeding.')
We are going to look at adding better support for JS in the HTML5 version as we go along, but right now really only basic stuff is going to work.
If you publish with mobile support it will include jquery. I have created some cool stuff but, due to current limitations, it requires a lot of trickery post publishing to get Storyline to load and use my custom JS :-(
Can you execute functions from previously included JS files? I know that Email Results is no longer supported in Storyline, but the EmailResults function is still included in the story.js script file. In QM, we hacked the corresponding function (near line 450 in the quiz.js file, I believe) to post the results to a script on an application server in order to update our databases.
I would hope that using the Execute Javascript action in the Trigger Wizard might allow us to execute the EmailResults function in a similarly hacked story.js file so we can extract basic data. Perhaps even from a Results Slide without needing a quiz? The inability to extract even basic data from Storyline is currently our biggest stumbling block in moving ahead with it.
Currently we don't support the Get and Set functions like the Flash player does with JavaScript triggers, but simple things like alerts should work. In one of the sample courses I have a trigger to Execute JavaScript when the user clicks the next button if a variable is less than 4. That JS is set to:
window.alert('You must explore all areas before proceeding.')
Dave, That alert works for you when you run the story_html5.html?
Cause I can not get any JavaScript to run in html5...
Can you execute functions from previously included JS files? I know that Email Results is no longer supported in Storyline, but the EmailResults function is still included in the story.js script file. In QM, we hacked the corresponding function (near line 450 in the quiz.js file, I believe) to post the results to a script on an application server in order to update our databases.
I would hope that using the Execute Javascript action in the Trigger Wizard might allow us to execute the EmailResults function in a similarly hacked story.js file so we can extract basic data. Perhaps even from a Results Slide without needing a quiz? The inability to extract even basic data from Storyline is currently our biggest stumbling block in moving ahead with it.
John, I've been looking for a way to do this myself and have found a workaround using the execute javascript window. I posted about it on a different thread today:
Hope it helps. All I've had to do is amend my asp file so that it reads variables posted into the url from the javascript rather than reading from a submitted form.
I tried implementing the javascript - window.print() but it does not works on any browser....has it ever worked for somebody else.....If possible can somebody put a one page story template which has teh print function working ?
I want to create one course with 3 sections. Each section should have its own status in moodle. When I finish section 1, section 1 should go 100% on the course overview in moodle. section 2 and section 3 should stay at 0%.
What would be the easiest way?
I can imagine to put triggers at the end of each section calling the bookmark function of the scorm api and setting the students status to 100%. But I don t know how to tell storyline to handle each section as a unit.
thanks for your reply. I copied the Storyline output files of each section into one single folder and edited the imsmanifest.xml there. This worked for me. I have another issue. When I did not complete the section there is nothing in the status field. I would like to have the status "incomplete". Is this something I can set up in Storyline?
I know this is an old thread but would anyone know if you can set: lmsAPI.SetScore to trigger completion in your LMS. I have done it for desktop and it works fine as it runs flash. However in HTML 5 it does not report anything to the LMS.
JavaScript is not something I can help support, but I do know that we have many savvy users in the community that may be able to pop in and assist. I also wanted to point you to this guide on Javascript Best Practices and Examples.
20 Replies
It seems that a basic javascript alert is not supported in html5.
How can I make sure my js will work in html5?
Hey James,
Currently we don't support the Get and Set functions like the Flash player does with JavaScript triggers, but simple things like alerts should work. In one of the sample courses I have a trigger to Execute JavaScript when the user clicks the next button if a variable is less than 4. That JS is set to:
window.alert('You must explore all areas before proceeding.')
We are going to look at adding better support for JS in the HTML5 version as we go along, but right now really only basic stuff is going to work.
Actually what would be cool is to integrate Storyline with JS and even better JQuery
which already has many functions built in.
If you publish with mobile support it will include jquery. I have created some cool stuff but, due to current limitations, it requires a lot of trickery post publishing to get Storyline to load and use my custom JS :-(
Here you can see table compares the Storyline features that are supported in the Flash Player, HTML5.
Yes Andrzej that is one of the places.. the question is: What does it mean when it says JS has "Limited" support in HTML5?
How limited?
Limited to what?
Can I call my own functions?
Can I make a jquery call?
etc....
Can you execute functions from previously included JS files? I know that Email Results is no longer supported in Storyline, but the EmailResults function is still included in the story.js script file. In QM, we hacked the corresponding function (near line 450 in the quiz.js file, I believe) to post the results to a script on an application server in order to update our databases.
I would hope that using the Execute Javascript action in the Trigger Wizard might allow us to execute the EmailResults function in a similarly hacked story.js file so we can extract basic data. Perhaps even from a Results Slide without needing a quiz? The inability to extract even basic data from Storyline is currently our biggest stumbling block in moving ahead with it.
Do you want to do this in the HTML5 mode or just in Flash?
We'd prefer to do it in both Flash and HTML5, but even just Flash would suffice at this point.
Dave, That alert works for you when you run the story_html5.html?
Cause I can not get any JavaScript to run in html5...
Hi Ines,
Currently we don't support the Get and Set functions like the Flash player does with JavaScript triggers, but simple things like alerts should work.
You will likely see the addition of these features in a forthcoming update to Storyline.
-Dave
John, I've been looking for a way to do this myself and have found a workaround using the execute javascript window. I posted about it on a different thread today:
http://community.articulate.com/forums/p/12738/86871.aspx#86871
Hope it helps. All I've had to do is amend my asp file so that it reads variables posted into the url from the javascript rather than reading from a submitted form.
Chris
I tried implementing the javascript - window.print() but it does not works on any browser....has it ever worked for somebody else.....If possible can somebody put a one page story template which has teh print function working ?
I am in hurry :(
Hi there,
I want to create one course with 3 sections. Each section should have its own status in moodle. When I finish section 1, section 1 should go 100% on the course overview in moodle. section 2 and section 3 should stay at 0%.
What would be the easiest way?
I can imagine to put triggers at the end of each section calling the bookmark function of the scorm api and setting the students status to 100%. But I don t know how to tell storyline to handle each section as a unit.
Thanks for any reply in advance!
Hello Funda,
I think it may be best to break your course up into three SCORM packages.
Is that possible?
Hi James,
thanks for your reply. I copied the Storyline output files of each section into one single folder and edited the imsmanifest.xml there. This worked for me. I have another issue. When I did not complete the section there is nothing in the status field. I would like to have the status "incomplete". Is this something I can set up in Storyline?
Hi James,
I found out that its a LMS setting. Thank you for your support!
Glad you got it resolved!
I know this is an old thread but would anyone know if you can set: lmsAPI.SetScore to trigger completion in your LMS. I have done it for desktop and it works fine as it runs flash. However in HTML 5 it does not report anything to the LMS.
Hi Kyle and welcome to E-Learning Heroes!
JavaScript is not something I can help support, but I do know that we have many savvy users in the community that may be able to pop in and assist. I also wanted to point you to this guide on Javascript Best Practices and Examples.
This discussion is closed. You can start a new discussion or contact Articulate Support.