Student's First Name as variable

jmohr4076 Community Member Posts: 31 ☆ Roadie ☆

I'm seeking assistance with including only the student's first name as a variable.  Lectora is set up to display the student's name as Doe, Jane when using the already created student name variable.  I'm wanting to have text appear within the Lectora project that says "Dear Jane," instead.  Has anyone found a way to do this?


  • danam
    danam Community Member Posts: 96
    That all depends on how you are retrieving the name of the student.
    If your LMS separates the names like CourseMill, it is a no-brainer. ACTION: ON SHOW CHANGE CONTENTS TEXT BOX 2 VARIABLE = <#USER_FIRSTNAME#>
    If it is hosted with a different LMS you may have to research how they handle it.
    If these are not options I would look for a script person in the community to help to get rid of the "Doe,".
  • jmohr4076
    jmohr4076 Community Member Posts: 31 ☆ Roadie ☆
    Thank you! We do host on CourseMill, and I can use that variable in the CourseMill notifications, but it can't be used in Lectora. :(
  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    It might be a bit overcomplicated... mostly due to i already have this setup for more then just getting the first name... but well it works..and maybe its of use for you..

    Action in Lectora: Run Javascript -> Javascript: getUserData(Varuser_name.getValue());
    ** this Lectora action calls a function that passes the usersname to Javascript **

    In the external JS file i then have:

    var dataFromLectora;
    var tempArray;
    var firstNameUser;

    function getUserData(_username){
    dataFromLectora = _username;

    function pushnewData(){ // this function splits the data received into an array

    tempArray = dataFromLectora.split(",");
    firstNameUser = tempArray[1].toLowerCase(); //getting the first name of the user


  • jmohr4076
    jmohr4076 Community Member Posts: 31 ☆ Roadie ☆
    Thank you!
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!