0

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"}'
samurai
  • 101
  • 1
  • 13

1 Answers1

0

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

Brian J. Miller
  • 2,169
  • 1
  • 12
  • 12
  • hello @Brian J. Miller ,I have change to agent, my problem's code has revise. but it show "he following 'agent' parameter contains invalid properties: '{"objectType":"Group","name":"\u540d \u5c0f"}'" – samurai Aug 19 '20 at 00:23
  • @samurai You need to pass an Agent or Group that has an IFI (identifier). See https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#inversefunctional for more about IFIs. What you are passing is an anonymous Group, because it does not have an identifier, which is not a valid parameter for filtering. – Brian J. Miller Aug 20 '20 at 13:42