Explore the community Forums Lectora Lectora Questions & Answers ALT Tags, xAPI, and LRS's…

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #332038 Score: 0
    Profile photo of Atlanta Joe
    Atlanta Joe
    Member
    beginner
    intermediate
    curious george
    contributor
    wise owl
    profile
    13 pts
    @joejubee

    Hey People!

    Ok, so in Lectora, I can pull the alt tag of an item (after publishing) into a Lectora variable named “myAltTag” by using the following javascript code:

    VarmyAltTag.set(%HTMLNAME%.altName);

    I know it works, because I can then create a text field and set it to change its contents to the contents of the variable named “myAltTag” and the full alt tag will get displayed. I’m attempting now, to get that alt tag to be sent to our xAPI LRS by modifying this original javascript:

    LectoraXAPIStmt(“Btn001”, “Name that we want saved”); to this: LectoraXAPIStmt(“%HTMLNAME.altName%”);

    This “sort of” works in that our LRS will report the following interaction:

    button3434.altName

    It’s not pulling in the alt text for the image, it’s pulling in the HTML name that Lectora generates for each item. But I feel like I’m getting closer. I’ve tried a variety of variations on that coding like,

    LectoraXAPIStmt(“%VarmyAltTag%”);
    LectoraXAPIStmt(“VarmyAltTag “);
    LectoraXAPIStmt(“%VAR(myAltTag)%”);

    … and others, but can’t seem to get that ALT to pull in.

    Do y’all have any ideas or suggestions?

    Thanks,

    Joe

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

    Hi Joe,

    A way to do it should be to set the variable in the way I’ve described in that other topic. Mind the action must be attached to the button. Then use the variable myAltTag for all other puposes. I’m not familiar with xAPI but it should work with

    LectoraXAPIStmt(VarmyAltTag.getValue());

    to use the variable value in the command.

    If you’re using Lectoras “xAPI Statement” action, you can select the variable in the “Object” field from the dropdown or enter VAR(myAltTag)

    Tim

    This post has received 3 votes up.
    #332068 Score: 0
    Profile photo of Atlanta Joe
    Atlanta Joe
    Member
    beginner
    intermediate
    curious george
    contributor
    wise owl
    profile
    13 pts
    @joejubee

    Thanks! That did it. You ‘da man!

    Happy Halloween!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.