Explore the community Forums Lectora Lectora Questions & Answers Pulling just the First Name in Lectora SCORM courses

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #324563 Score: 0
    Profile photo of Lazaro Perez
    Lazaro Perez
    Member
    beginner
    intermediate
    curious george
    wise owl
    friend finder
    contributor
    profile
    Group Member
    picture perfect
    advanced
    28 pts
    @sirwise23

    Hello,

    I am trying to seperate the First name and last name from the AICC_Student_Name Variable.

    I have found instructions here but they don’t seem to work for me.  When I publish The page is out of whack.  Last time I saw instructions published was 2013.  I’m wondering if something is slightly different in Lectora 16 and maybe that’s the issue.

    Thanks.

    #324564 Score: 1
    Profile photo of Jennifer Valley
    Jennifer Valley
    Member
    contributor
    beginner
    friend finder
    advanced
    lectora beginner
    verified member
    wise owl
    profile
    picture perfect
    curious george
    114 pts
    @jvalley4735

    Can you share the instructions?  I’d love to see how it was structured and why it would be different now.  I’ll also ask around because I’m not 100% sure on this one.

    This post has received 1 vote up.
    #324567 Score: 0
    Profile photo of Lazaro Perez
    Lazaro Perez
    Member
    beginner
    intermediate
    curious george
    wise owl
    friend finder
    contributor
    profile
    Group Member
    picture perfect
    advanced
    28 pts
    @sirwise23

    This was posted in 2013:

    Separating first and last names.

    It can be done in three steps:

    1.
    Create a textfield that’s initially invisible
    Add an action
    On: Page show
    Action: Change content
    Target: This object
    Value: VAR(AICC_Student_Name)

    2.
    Create two variables
    -> lastname
    -> firstname

    3.
    Add an action on page level

    On: Show
    Action: Run JavaScript
    Javascript:
    var username = VarAICC_Student_Name.getValue().split(“, “);
    Varlastname.set(username[0]);
    Varfirstname.set(username[1]);

    • This reply was modified 3 years, 1 month ago by Profile photo of Lazaro Perez Lazaro Perez.
    #324572 Score: 2
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    307 pts
    @timk

    That code should work correctly, it only contains a combination of issues coming from different versions of forum software used in the community 😉

    The correct code is:

    var username = VarAICC_Student_Name.getValue().split(",");
    Varlastname.set(username[0]);
    Varfirstname.set(username[1]);

    Tim

    This post has received 2 votes up.
    #324574 Score: 3
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    307 pts
    @timk

    Sorry, actually the correct code is:

    var username = AICC_Student_Name.getValue().split(",");
    Varlastname.set(username[0]);
    Varfirstname.set(username[1]);
    This post has received 3 votes up.
    #324589 Score: 1
    Profile photo of Lazaro Perez
    Lazaro Perez
    Member
    beginner
    intermediate
    curious george
    wise owl
    friend finder
    contributor
    profile
    Group Member
    picture perfect
    advanced
    28 pts
    @sirwise23

    That was it. Thanks Tim.

    There should not be a VAR in front of AICC_Student_Name

    Once the VAR was gone the page loaded right up.

    Thanks again.

    This post has received 1 vote up.
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.