【问题标题】:learning locker queryStatement using timestamp as a filter使用时间戳作为过滤器学习储物柜查询语句
【发布时间】:2016-11-14 21:53:53
【问题描述】:

我正在尝试使用 TinCanPHP 查询存储在 Learning Locker 中的语句,但我只想检索在特定时间间隔内生成的语句。比如我想要今天生成的所有语句。

我该怎么做?

【问题讨论】:

    标签: php tin-can-api lrs learning-locker


    【解决方案1】:

    试试这个:

    $LRSResponse = $LRS->queryStatements(['since' => '2016-11-15', 'ascending' => false]); // change to 'true', or omit, for ascending dates
    $StatementsResult = $LRSResponse->content;
    $array_of_Statement_objects = $StatementsResult->getStatements();
    foreach ($array_of_Statement_objects as $extracted_Statement_object){
    // deal with statements as necessary
    }
    unset($extracted_Statement_object);
    

    【讨论】:

    • 要限制为一天(不是今天),您还必须包含 until 参数,并且不应该包含 ascending 标志,除非您想要它们那个命令。请注意,这是语句的stored 顺序不是 timestamp 顺序。
    • 谢谢,它可以工作,但时间必须以与时间戳相同的格式表示。应该是$LRSResponse = $lrs->queryStatements(['since' => '2016-11-14T20:19:08+01:00', 'ascending' => false]);
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-20
    • 2018-07-25
    • 1970-01-01
    • 2019-03-21
    • 2016-02-08
    相关资源
    最近更新 更多