Recording User's Name and Email Address
May 07, 2012
I want to create a module for use in a tradeshow booth. The module will be a game. However, before the user starts to play I want to capture their name and email address and store it in a file such as Excel or any other file.
There is NO internet access available - everything has to be self-contained on a Windows laptop.
I can build a simple VBA/Macro in Excel which they would fill in and that would store the information. And then I could have a button to hyperlink to the course module.
But, my question is this: Is there a way to build this completely in Storyline so that the user would enter their name and email into to text boxes and that variable would be added to a file such as Excel or Access?
The goal is to have a list of everyone who played the game in the booth.
Thanks
Ben
63 Replies
I am not Java literate, but I can copy paste. Can anyone show me how to take the code Brian provided and do what Robin Leach here is suggesting?
Thanks
Ben
The second bit of help I need is having this go to my server instead of C drive. I am not sure about file hierarchy so if someone has a moment, a detailed answer would be appreciated.
Thanks
Ben
Maybe I should add the Javascript I have:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("www.myurl.com/studentinfo/data.txt", 8, true, 0);
var player = GetPlayer()
var name = player.GetVar("name");
var email = player.GetVar("email");
var school = player.GetVar("school");
var grade = player.GetVar("grade");
s.WriteLine("Name: " + name);
s.WriteLine("Email: " + email);
s.WriteLine("School: " + school);
s.WriteLine("Grade: " + grade);
s.WriteLine("==========");
s.Close();
I couldn't get the script in the video to work either. Something must have changed since then. However, I was able to write that information to a text file using the example provided here.
The only problem was that you cannot send the Quiz Results variables - they are protected! If you try, nothing gets sent. However, I was able to send my own variables to a text file on the server just fine.
I am getting some help to figure out how to send the SL quiz results to a database table.
Russ
I, too, am having the same problems - no warning message, no .txt file. I noticed that people who have replied to the screencast are also having problems?
Has anyone been able to get variables passed to a text file?
Here some answers for those who don't understand why the exemple of Ben doesn't work.
I was in that case and for me i figure it out with two issue :
First to allow this action with javascript you have to pass by Internet Explorer in order to have access to ActiveX, if you don't want to have Internet Explorere you can download an IE emulator on Chrome or Firefox.
Second check if you have 2 trigger on the same button or hotspot, you have to put the trigger that execute javascript on top of all the button or hotspots actions,
Now it works perfectly !
Good luck
hi brain which you create really very nice but when i try to do this in pc its not working. I don't no why?
can you tell me what is exact problem.
thank u brain for this implement
Hi Manish,
I'm not a Javascript expert either (far from it...) and Brian has taken another position within Articulate so he doesn't get into the forums as often. When testing this on your computer, are you testing the published output within the intended environment as described here? Testing it locally could cause you to run into some issues.
hmmm. I am starting to think that using the Javascript example provided in another forum to write to a simple text file may be a better option that dealing with ActiveX.
Save the grades to a text file using a comma or semi-colon as delimiters and then open in Excel to run a quick VB script to format everything. No headaches with ActiveX or browser or computer security and no issues (for me anyway) with our IT Security team.
I know you guys aren't experts but would anyone know why the JavaScript doesn't work when i put it in a usb, it executes perfectly fine if i publish it to my computer but when publishing it to a usb it doesn't work?
Hi Damien and welcome to Heroes!
Have you tested publish to Web? The other element to consider is you'll want to publish to your local drive as described here and then if you needed to place the published output on your USB drive (when you publish to a CD or other local source) you could do so after with the published output. You'll also want to test it within the intended environment as detailed here.
Thank you for the response Ashley!
I have tried what you said and explored other options, it still seems to not work. I dont understand what makes the difference from copying and pasting it to a different location, it acts as if the JavaScript doesn't even exist when transferred to usb or any other external location. Im testing ways to develop an offline lms and if somehow i could get this working it could open up many new possibilities on what i can do!
Thanks
Hi Damien,
I'm not an expert in Javascript (not even close..) but I do know that you'll want to test it within the intended environment for any of our content to prevent running into security errors or content failing. There is some additional Javascript best practices detailed here.
Hi GUys
need to find out out two things, please if you can assit me out ...appreciate that
1) do I copy and paste the whole thing or need to change something
2) I have server that I need to put my storyline prjoect. I was wondering I can put excel file overthere as well.
please let me know and then I will be ready to go
Hi AHme,
This thread is a bit older, so I'm not sure what element you're referring to. Could you share a bit more information about what you're looking to do and any difficulty you're running into.
Hi Ashley
Thanks for replying :) actually I was talking about these lines of codes below in bold :).....do I have to replace it myself
Also I am using Intranet and its hard to get a variables to pass through , there should be working way that come out recently specially for storyline2.....do you have any info regarding
also is there storyline2 LMS got a database where variables can store and be use able and if it is please let me know how much it will cost. Thank
Please let me know, :) will wait for your response
var wsName = document.location.pathname;
wsName = wsName.replace(/\//gi, "\\\\"); // Replaces all forward slashes (/) with double back slashes (\\)
wsName = wsName.substring(2); // Removes the two leading slashes
wsName = wsName.replace(/%20/gi, " "); // Replaces %20 with spaces
wsName = wsName.substring(0, wsName.lastIndexOf("\\") + 1); // Removes the html file name from the file path
Hi AHme,
I'm not able to assist with Javascript code or elements - so I'll defer to the community on that.
We don't support tracking or reporting information to a text database or similar, so you'd want to use an LMS to track and store information. In regards to an option available from Articulate, you may want to look at Articulate Online.
Thanks for all this, Ben.
Do you have a solution for getting text from Excel or a text file into storyline variables.
I'm building a quiz game, and I want the questions and answers to change randomly. There is like 50 fquestions and anwers.
Thanks,
Just wanted to link this thread where David was receiving some assistance with this for anyone that may run across this thread.
Do you have a solution now? I need the same solution?
Hi Bo!
Not sure if Diwakar is still subscribed to this thread, but you are welcome to utilize the Contact Me option on the user profile if needed.
Can someone provide an example of how "document.location.pathname" variable inthe script be indicated?
Thanks.
Hi Christopher! Hopefully someone in the community will be able to pop in and assist you.
Thanks but I got this addressed.
This discussion is closed. You can start a new discussion or contact Articulate Support.