phpscormtin-can-api

Tin-can LRS query Statements can not grab my data


I use Tin Can query to grab my scorm.
I want to grab which name = "Ming" but I would show all student....
I use API step by step,I don't know what's wrong?
this is my data:
data picture

this is my code:

    <?php
 
$loader = require '../vendor/autoload.php';

$lrs = new TinCan\RemoteLRS(
    'https://cloud.scorm.com/lrs/SFXXXXX/',
    '1.0.0',
    'accountXXX',
    'PWDXXXX'
);

$actor = new TinCan\Agent(
    ['name'=> '名 小'] 
);

 $response = $lrs->queryStatements(
            [ 'agent' => $actor, 
              'limit' =>8 ,
            ]
 
            );
?>

This is my reference: Tin-can reference

please help me,thanks.

new:
I change my code to agent,
but it show:

he following 'agent' parameter contains invalid properties: 
'{"objectType":"Group","name":"\u540d \u5c0f"}'

Solution

  • actor is not one of the available query parameters. You would need to use agent, and to filter statements by an Agent you have to provide the IFI, in your case the account value, name is not an acceptable identifier in xAPI so it can't be used as a filter value. The list of available properties matches the set of query string parameters listed in the GET /statements resource here: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#213-get-statements