Explore the community Forums Lectora Lectora Questions & Answers Seperate First name from AICC_STUDENT_NAME

Viewing 15 posts - 1 through 15 (of 44 total)
  • Author
    Posts
  • #282836 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

    Hey everyone,

    Haven’t been on here in a while. I know I have seen notes n this before but I can’t find it.

    I am trying display the students first name but the AICC_Student_Name only pulls LastName, FirstName.

    Is there a way with variables to strip off the LastName, and only display the firstname?

    I can probably manage this if I use a flash file to read the AICC_Student_name variable, strip out what I don’t need, write the first name to a new variable, and then use Lectora read the variable.

    Since I do plan on doing some development for an LMS that uses iPads, I was trying to avoid the flash route though.

    Anyone ever manage this?

    #286184 Score: 0
    Profile photo of Erica Hunter
    Erica Hunter
    Member
    beginner
    intermediate
    verified member
    contributor
    curious george
    wise owl
    LUC16 Attendee
    LUC16
    3 pts
    @beeps

    Do you need to pull the name from AIC_Student_Name? What about having the first name be its own variable and then asking them for their name at the start of the course?

    I think how you plan to have the first name show in the course depends on what you are doing with it. If it is just for customization (e.g., a guide says something like “Hi FIRSTNAME, let’s learn do something!”) then a new variable would work well for that.

    #286183 Score: 0
    Profile photo of Altarium
    Altarium
    Member
    @Altarium

    Haven’t tried it yet, but using javascript and the split() method.

    It should look something like this (variables aren’t correct, just used as an example):

    var studentname = varaicc_studnet_name.split(“,”);
    var firstname = studentname[1];
    [/CODE]

    the variable “firstname” should then only hold the students first name for you to use anywhere

    hopefully this gives you a starting place, let me know if you have any trouble with it! (someone else on here might be able to give you a better answer too)[CODE]
    var studentname = varaicc_studnet_name.split(“,”);
    var firstname = studentname[1];
    [/CODE]

    the variable “firstname” should then only hold the students first name for you to use anywhere

    hopefully this gives you a starting place, let me know if you have any trouble with it! (someone else on here might be able to give you a better answer too)

    #286181 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    346 pts
    @timk

    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]);

    “lastname” now contains the users’ lastname (i.e. everything before the “, “) “firstname” contains the users’ firstname. Both variables can now be used throughout the course.

    Tim

    #286182 Score: 0
    Profile photo of Altarium
    Altarium
    Member
    @Altarium

    Thanks, Tim! I was about 1/3 of the way there lol πŸ™‚

    #286180 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

    Thanks. This worked great.

    #350461 Score: 0
    Profile photo of Marcel Milo
    Marcel Milo
    Member
    beginner
    intermediate
    curious george
    friend finder
    picture perfect
    wise owl
    contributor
    advanced
    @mmilo9281

    Hey guys, i need really help, i did exactly the three steps from Tim, but it doesnt work. Has anyone an idea? i have Lectora inspire 17.0.2. The strange thing is, that in Lectora online, the first name appears at beginning but in inspire it doesnt work.

    var username = AICC_Student_Name.getValue().split(“,”,2);
    Varlastname.set(username[0]);
    Varfirstname.set(username[1]);
    alert(username);

    greetings marcel

    #350475 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    346 pts
    @timk

    If you publish with “Publish for Seamless Play” the code needs to be changed:

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

    Tim

    #350496 Score: 0
    Profile photo of Marcel Milo
    Marcel Milo
    Member
    beginner
    intermediate
    curious george
    friend finder
    picture perfect
    wise owl
    contributor
    advanced
    @mmilo9281

    Hey Tim, thxΒ  πŸ™‚

    i tried it but its the same like before, is there maybe something false in my variablemanager…

    #350499 Score: 0
    Profile photo of Marcel Milo
    Marcel Milo
    Member
    beginner
    intermediate
    curious george
    friend finder
    picture perfect
    wise owl
    contributor
    advanced
    @mmilo9281

    sorry it is the first time i work with variables πŸ™‚

     

    #350503 Score: 0
    Profile photo of Marcel Milo
    Marcel Milo
    Member
    beginner
    intermediate
    curious george
    friend finder
    picture perfect
    wise owl
    contributor
    advanced
    @mmilo9281

    i have send you a test title, maybe it helps

    #350505 Score: 0
    Profile photo of Marcel Milo
    Marcel Milo
    Member
    beginner
    intermediate
    curious george
    friend finder
    picture perfect
    wise owl
    contributor
    advanced
    @mmilo9281

    oh no it didnt work…:-( isnt allowed to send project files

    #350507 Score: 0
    Profile photo of Marcel Milo
    Marcel Milo
    Member
    beginner
    intermediate
    curious george
    friend finder
    picture perfect
    wise owl
    contributor
    advanced
    @mmilo9281

    second try: i get always both names

    Wellcome Eastwood, Clint

    for my project it will be necessary that only the firstname will appear….

    For example: Wellcome Clint

    #350511 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    346 pts
    @timk

    Ok, here’s my title, I tested in moodle 3.0.

    Damit sollte es funktionieren.

    Tim

    Attachments:
    1. Title-1-3.zip
    #350537 Score: 0
    Profile photo of Marcel Milo
    Marcel Milo
    Member
    beginner
    intermediate
    curious george
    friend finder
    picture perfect
    wise owl
    contributor
    advanced
    @mmilo9281

    hey Tim, vielen Dank, werde es gleich ausprobieren.

    glg Marcel

     

     

     

    • This reply was modified 3 years, 2 months ago by Profile photo of Marcel Milo Marcel Milo.
    • This reply was modified 3 years, 2 months ago by Profile photo of Marcel Milo Marcel Milo.
Viewing 15 posts - 1 through 15 (of 44 total)

You must be logged in to reply to this topic.