The script is designed to take a name input in a single string and split it up into forename and surname, placing the result into the preset Opus variables LOGIN_FIRSTNAME and LOGIN_SURNAME. It is particularly useful with SCORM publications as the LMS will provide the student name as the last name, followed by the first name separated by a comma.
If a comma is present this script will assume the last name comes first. Otherwise it will assume the names in correct order but will still separate the two out.
Syntax: splitName(inVar)
inVar – is the variable containing the combined name you want to be broken up.
Example:
splitName(LOGIN_USER_NAME)
This is the most commonly-used example which will take the preset Opus variable for the complete name and split it into the first name and surname.