Pass quiz scores and other Storyline variables into Smartsheet - without an LMS
I'm often looking for ways to track learning outside an LMS and recently I struggled to find a way to pass a Storyline quiz score into Smartsheet. I scoured the forums and found little pieces here and there, so I thought I would give back to the community that's helped me so much through the years by writing down my steps for others who might need the same thing.
In Storyline, set up variables to be passed to the Smartsheet. The two I want to pass are:
- Email address ("Email")
- Quiz Score ("Score")
In Smartsheet, set up columns to hold the course data
- Created Date (System-generated auto-numbered)
- Email Address (Primary)
- Full Name (Text/number)
- Quiz Score (Text/number)
In Smartsheet, create a form for the sheet to capture the data
- Hide (but don't delete or remove) the fields that will be passed from Storyline (email address and score)
- Set the score field validation to "Percentage"
- Note: The form must contain at least one visible field, so in my example I have one asking for the full name.
- Save the form
- Copy and save the form's URL (under Manage Forms) to be used later
- Note: Storyline's built-in variables cannot be accessed yet, so create one slide trigger that sets the new variable "Score" to the built-in SL variable (Results.ScorePercent).
//This opens a new window with the pre-filled Smartsheet form.
var player = GetPlayer();
var score = player.GetVar ("Score");
var email = player.GetVar ("Email");
- The double forward slashes define the first line as a comment - not code.
- The "var player" line starts the communication with the Storyline player to get the variables.
- The "var email" line does the same with the Email variable.
- The "window.open" line opens a new window with the Smartsheet form pre-filled with the score and email variables.
- The "" enclose the pieces that make up the smartURL.
- The + connects the smartURL pieces (without any spaces).
- The ? goes after the form URL and tells the form which fields to pre-fill.
- The & connects the URL fields if there is more than one. If there were a third variable named comment, this would come before the end parenthesis and semi-colon: +"&Comment="+comment