Displaying A Course Version Number
Feb 01, 2017
I name my courses with a version number (e.g. "coursename"-v01.12) and I want to auto-display the course version number within the course itself (e.g. on the top of each slide or within an "about" popup screen): useful if you need to determine the version a user is using.
I solved this via JavaScript and a Storyline variable ("thisCourseVer"):
var dir = window.location.pathname
var idx = dir.indexOf('-v')
idx = idx + 1
var strippedVerNo = dir.substr(idx, 6)
var player = GetPlayer()
player.SetVar("thisCourseVer", strippedVerNo)
The above code gets the current directory (aka folder) - publishing to LMS creates a directory using the course name (e.g. "coursename - Storyline output") and finds the position of the string "-v" (the start of my version number). "substr" extracts the version number (e.g. v01.12) and finally the Storyline variable "thisCourseVer" is set to the value of "strippedVerNo".
3 Replies
This is quite helpful Kim. Thanks!
Cool!
Nicely done Kim - thank you for sharing!
This discussion is closed. You can start a new discussion or contact Articulate Support.