简体   繁体   English

我们能否更新xApi中已经发送的数据

[英]Can we update the data that have been sent already in the xApi

Initially I have done a post request for xApi containing some values(Score) under the verb.After successful api call it returns a token. 最初我对xApi发出了一个后置请求,该请求包含动词下的一些值(分数)。成功调用api后,它将返回一个令牌。

在此处输入图片说明

My question is can we update the same value(Score)? 我的问题是我们可以更新相同的值(分数)吗? 在此处输入图片说明 If we can, please let me know.....!!! 如果可以的话,请让我知道..... !!!

Generally the answer is, no. 通常,答案是不。 xAPI Statement data is intended to be immutable. xAPI语句数据旨在不可变。 But in so far as it is a stream of data it is really up to the statement consumer to indicate how values can change for its purposes. 但是就数据流而言,实际上由语句使用者决定值可以如何更改以达到其目的。 So there are a couple of ways to achieve the same concept... 因此,有两种方法可以实现相同的概念...

1) Depending on the consuming system it may be as easy as just sending another statement with the new score. 1)根据使用的系统,它可能像发送带有新分数的另一条语句一样容易。 Some consuming systems will see the new score (generally for the same Activity, object , and/or registration ) and consider it an update. 某些使用系统的用户会看到新分数(通常针对相同的Activity, object和/或registration )并将其视为更新。 In this case there will be multiple statements indicating a score, but based on timestamp we can know which was the last score received. 在这种情况下,将有多个语句指示得分,但是基于timestamp我们可以知道哪个是最后一个得分。

2) The other way that is more akin to an "update" or an "edit" is to indicate that the original statement should have never existed in the first place by voiding it. 2)与“更新”或“编辑”更相似的另一种方式是,通过使原始语句无效,可以表明原始语句根本不应该存在。 Voiding a statement effectively takes it out of the stream of data so that the consuming system shouldn't consider it to have ever existed. 声明无效可以有效地将其从数据流中删除,从而使使用方系统不应认为该声明曾经存在过。 After voiding you would then send a new statement with the updated score and likely keeping everything else the same, particularly the timestamp value. 无效后,您将发送带有更新分数的新语句,并且可能使其他所有内容保持相同,尤其是timestamp值。 It is important to realize that simpler systems (such as those described in #1) may not handle the voiding case correctly as we've seen relatively little use of it in the wild (to date). 重要的是要意识到,较简单的系统(例如#1中描述的系统)可能无法正确处理无效情况,因为到目前为止,我们在野外使用它的情况相对较少。 Additionally it can be important to understand the nuance of the differences between the timestamp and stored property values and the order in which the consuming systems will process the data. 另外,重要的是要了解timestampstored属性值之间的差异的细微差别,以及消费系统处理数据的顺序。 For more on voiding see: https://www.ht2labs.com/void-xapi-statement/ 有关排空的更多信息,请参见: https : //www.ht2labs.com/void-xapi-statement/

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

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