I need to provide server side functionality to storyline stories. I need to be able to store the variables value in the stores preferably by using a web service and store to our database. Going through the discussion forums on this website. I understand it is possible to do it using Javascript triggers. Can some one guide me , how these can be used? Any demo will be very helpful. Do you provide a Javascript file , that can be used to integrate between storyline and server side code.
I know, Jquery , Javascript, c# , asp.net and web service.
Once I get the variables using the Java script triggers and then how do I store them into a SQL database via WCF Service.
Do you have some examples?
Should I be putting all the published html source content and HTML files from Story Line in an asp.net project and use visual studio 2013 to attach it to a web service?
Is this the right way forward?
Hi, Rachna, and welcome to the community! I see that Michael has already provided you with our JS Best Practices sheet, and I just wanted to pop in an add that although Articulate does not support JavaScript, we have lots of experts in the community who should be able to assist you. Best wishes with your project! :)
I am wondering, if some one can help me with how to extract the variables from story.html file and then use in my javscript file to add them to the database.
Thanks for your answer Mark. I am trying to do something similar. I have a button , 'Save'. When user clicks on the button save , i want to execute javascript and to begin with just display the value of the variable .
My variable name is %slider8%
I did try, some thing like alert('%slider8%'); and alert('slider8'); on the click of the button but it just displays %slider8% rather than the value that is stored in it should be 1 .
Also, in user.js the function GetHostVars() has all arguments as null.
I thought, I would post my next query in this thread itself. It might help some one, doing something similar later. I am unable to find a function to load my variables from database . Something like a Onload of a layer.
What I want is, when a layer loads , my variables values that are stored in the database are read and assigned on the screen. For instance:- default value for a slider is 1 , so if user had choosen 3 last time and stored the value in the database, the value 3 should be read from the database on the layer load and the slider should be set to 3. Please advise.
I thought, I will come update my findings. All the variables are available to read on the base layer. So before showing the slide layers, I read all values of the variables from the database and assign to the storyline variables and then show the slide layers.
12 Replies
Here are some basic JS examples that should get you started.
Thanks Michael.
Once I get the variables using the Java script triggers and then how do I store them into a SQL database via WCF Service.
Do you have some examples?
Should I be putting all the published html source content and HTML files from Story Line in an asp.net project and use visual studio 2013 to attach it to a web service?
Is this the right way forward?
Cheers!
Rachna
Hi, Rachna, and welcome to the community! I see that Michael has already provided you with our JS Best Practices sheet, and I just wanted to pop in an add that although Articulate does not support JavaScript, we have lots of experts in the community who should be able to assist you. Best wishes with your project! :)
I am wondering, if some one can help me with how to extract the variables from story.html file and then use in my javscript file to add them to the database.
What I usually do is create a hidden form and insert the storyline variables into those form fields and submit it to a PHP Script.
Example: Creates a handout(PDF) students can turn in.
http://nextgen.wvnet.edu/Courses/Math9/Unit1/Lesson2/activity3/story_html5.html
But like with anything server side you better have some checks.
Thanks for your answer Mark. I am trying to do something similar. I have a button , 'Save'. When user clicks on the button save , i want to execute javascript and to begin with just display the value of the variable .
My variable name is %slider8%
I did try, some thing like alert('%slider8%'); and alert('slider8'); on the click of the button but it just displays %slider8% rather than the value that is stored in it should be 1 .
Also, in user.js the function GetHostVars() has all arguments as null.
Please advise, what I am doing wrong?
Thanks in advance.
Thanks , I got this to work. It was so simple.
var player = GetPlayer();
var name = player.GetVar("TextEntry");
Thanks for sharing that update, Rachna, and glad to hear you are all set! :)
I thought, I would post my next query in this thread itself. It might help some one, doing something similar later. I am unable to find a function to load my variables from database . Something like a Onload of a layer.
What I want is, when a layer loads , my variables values that are stored in the database are read and assigned on the screen. For instance:- default value for a slider is 1 , so if user had choosen 3 last time and stored the value in the database, the value 3 should be read from the database on the layer load and the slider should be set to 3. Please advise.
Thanks in advance.
Hi, Rachna -- I will defer to the community to assist you here. :)
I thought, I will come update my findings. All the variables are available to read on the base layer. So before showing the slide layers, I read all values of the variables from the database and assign to the storyline variables and then show the slide layers.
Many thanks for the update, Rachna! :)
This discussion is closed. You can start a new discussion or contact Articulate Support.