Add Users Name to SCORM Course

robm
Community Member Posts: 50 ☆ Roadie ☆
1. Add the following variables in the variable manager: a. firstName b. middleName c. lastName d. fullName2. Add a text box on the page to be a place holder for the user’s name.3. Add Action Group named “Process & Insert name” to Page. 4. Add “Dummy” Actions to the Action Group named “Process & Insert name” a. General Tab Name: Pass AICC_Student_Name Action: Show Target: Content Column 1 Condition Tab Variable: AICC_Student_Name Relationship: Is Not Empty b. General Tab Name: Pass firstName to JS Action: Show Target : Content Column 1 Condition Tab Variable: firstName Relationship: Is Not Empty c. General Tab Name: Pass middleName to JS Action: Show Target : Content Column 1 ConditionTab Variable: middleName Relationship: Is Not Empty d. General Tab Name: Pass lastName to JS Action: Show Target : Content Column 1 Condition Tab Variable: lastName Relationship: Is Not Empty e. General Tab Name: Pass fullName to JS Action: Show Target : Content Column 1 Condition Tab Variable: fullName Relationship: Is Not Empty5. Add another Action to the Action Group named “Process & Insert name” a. Name: Run processName JS function Action: Go To Target : Web Address Web Address: javascript:processName();6. Add one more Action to the Action Group named “Process & Insert name” a. Name: Insert Name into Name Text Action: Change Content Target: Name (text box) Contents: firstName, lastName or fullName 7. Add Action to the top level of the page a. Name: Run Process & Insert Name On: Show Action: Run Action Group Target: Process & Insert name8. Add External HTML Object below Action Group a. Object Name: processName JS Object Object Type: Header Script Custom HTML:function processName() {// Load Lectora variable AICC_Student_Name into Javascript variable StudentNameJSvar StudentNameJS = AICC_Student_Name.getValue();var commaPositionJS = StudentNameJS.indexOf(",");var firstSpaceJS = commaPositionJS +1;var lastSpaceJS = StudentNameJS.lastIndexOf(" "); if (firstSpaceJS != lastSpaceJS) { VarfirstName.set(StudentNameJS .substring(firstSpaceJS, lastSpaceJS)); VarmiddleName.set(StudentNameJ S.substring(lastSpaceJS)); VarlastName.set(StudentNameJS. substring(0, commaPositionJS)); VarfullName.set(VarfirstName.g etValue() + ' ' + VarmiddleName.getValue() + ' ' + VarlastName.getValue()); } else { VarfirstName.set(StudentNameJS .substring(firstSpaceJS)); VarlastName.set(StudentNameJS. substring(0, commaPositionJS)); VarfullName.set(VarfirstName.g etValue() + ' ' + VarlastName.getValue()); }}
Categories
- 35.9K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 25 ELB Learning Content
- 25 ELB Learning Content Discussions
- 329 CenarioVR®
- 196 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 42 Rockstar Learning Platform®
- 39 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 936 All Things eLearning
- 37 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products