简体   繁体   English

无法在学习储物柜的演员中添加“mbox”

[英]Unable to add "mbox" in actor of learning locker

I am working on a .NET core application and using learning locker.我正在开发一个 .NET 核心应用程序并使用学习储物柜。 I am using TinCan API to communicate with learning locker.我正在使用 TinCan API 与学习储物柜进行通信。 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.我从谷歌得到的是演员中有一个“mbox”字段,可用于添加电子邮件地址。 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.现在我在演员的 mbox 字段中有我的电子邮件地址,但是当我保存语句并在学习储物柜中看到它时,“mbox”字段未保存,“mbox”字段甚至不存在演员。

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. account属性和mbox都是 IFI(逆功能标识符),因此要求在 Agent 对象中是唯一的。

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 ) (参考: https : //github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#2421-when-the-actor-objecttype-is-agent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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