简体   繁体   中英

Unable to add "mbox" in actor of learning locker

I am working on a .NET core application and using learning locker. I am using TinCan API to communicate with learning locker. The code which i was using for creating the actor for learning locker statement was:

public Agent MakeActor(bool anonymous)
{
    return new Agent
    {
        name = anonymous ? AnonymousUser : UserName,
        account = new AgentAccount
        {
            name = anonymous ? AnonymousUser : UserId.ToString(),
            homePage = new Uri(StringHelper.ResolveHostName(Name,AwsDefines.AwsDomain))
        }
    };
}

Now i also have to add user email address in the records. What i got from google is that there is an "mbox" field in the actor which can be used for adding email address. So i updated my code:

public Agent MakeActor(bool anonymous)
{
    return new Agent
    {
        name = anonymous ? AnonymousUser : UserName,
        mbox = UserEmailAddress,
        account = new AgentAccount
        {
            name = anonymous ? AnonymousUser : UserId.ToString(),
            homePage = new Uri(StringHelper.ResolveHostName(Name,AwsDefines.AwsDomain))
        }
    };
}

Now i have my email address in the mbox field of actor but when i save the statement and see it in the learning locker, the "mbox" field is not saved, the "mbox"field is even not present the actor.

Any help will he much appreciated.

The account property and the mbox are both IFIs (Inverse Functional Identifiers) and are therefore required to be unique within the Agent object.

An Agent MUST NOT include more than one (1) Inverse Functional Identifier;

(Ref: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#2421-when-the-actor-objecttype-is-agent )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM