Forum Discussion
Course Name variable (for SmartSheet)
My final code, for your reference:
//Put name of student into variable "username"//Construct a URL with the student's name included in variable "smartURL"
var feedbackform = "https://app.smartsheet.com/b/form/94b1b0fcfe1234567890x"var player = GetPlayer();var docname = document.titlefunction findLMSAPI(win) { if (win.hasOwnProperty("GetStudentID")) return win; else if (win.parent == win) return null;
else return findLMSAPI(win.parent);}
var lmsAPI = findLMSAPI(this);var myName = lmsAPI.GetStudentName();var array = myName.split(',');var newName = array[1] + '%20' + array[0];player.SetVar("username", array[1]);
if (newName) {player.SetVar("smartURL", feedbackform + "?Name=" + newName + "&Course=" + docname);}else{player.SetVar("smartURL", feedbackform + "?Course=" + docname);}
------------------------------------
And here is the JS that is connected to the FEEDBACK button in the course
//Open the smartURL link created earliervar player = GetPlayer();var win = window.open(player.GetVar("smartURL"));
Related Content
- 12 months ago
- 6 months ago
- 12 months ago
- 12 months ago
- 12 months ago