scorm Tincan api query

scorm Tincan api query

by hui chi -
Number of replies: 3

hello,

I use Tincan api  I want to grab some data,but it fail,

I don't know how to revise it .

this is my data:

{
    "id": "ab9b9208-cc25-4358-a4f9-e3e04e14be19",
    "actor": {
        "objectType": "Agent",
        "account": {
            "homePage": "http://localhost/moodle",
            "name": "3"
        },
        "name": "名 小"
    },
    "verb": {
        "id": "http://adlnet.gov/expapi/verbs/completed",
        "display": {
            "en": "completed"
        }
    },
    "result": {
        "score": {
            "scaled": 1,
            "raw": 100,
            "min": 0,
            "max": 100
        },
        "success": true,
        "completion": true,
        "duration": "PT19S"
    },
    "context": {
        "extensions": {
            "http://lrs.learninglocker.net/define/extensions/info": {
                "http://moodle.org": "3.7.2+ (Build: 20191016)",
                "https://github.com/xAPI-vle/moodle-logstore_xapi": "v4.4.0",
                "event_name": "\\mod_quiz\\event\\attempt_submitted",
                "event_function": "\\src\\transformer\\events\\mod_quiz\\attempt_submitted\\handler"
            }
        },
        "contextActivities": {
            "grouping": [
                {
                    "id": "http://localhost/moodle",
                    "definition": {
                        "name": {
                            "en": "md"
                        },
                        "type": "http://id.tincanapi.com/activitytype/lms"
                    },
                    "objectType": "Activity"
                },
                {
                    "id": "http://localhost/moodle/course/view.php?id=2",
                    "definition": {
                        "name": {
                            "en": "math"
                        },
                        "type": "http://id.tincanapi.com/activitytype/lms/course"
                    },
                    "objectType": "Activity"
                }
            ],
            "other": [
                {
                    "id": "http://localhost/moodle/mod/quiz/attempt.php?attempt=17&cmid=2",
                    "definition": {
                        "name": {
                            "en": "Attempt"
                        },
                        "type": "http://adlnet.gov/expapi/activities/attempt"
                    },
                    "objectType": "Activity"
                }
            ],
            "category": [
                {
                    "id": "http://moodle.org",
                    "definition": {
                        "name": {
                            "en": "Moodle"
                        },
                        "type": "http://id.tincanapi.com/activitytype/source"
                    },
                    "objectType": "Activity"
                }
            ]
        },
        "platform": "Moodle",
        "language": "en"
    },
    "timestamp": "2020-08-09T00:50:28.000Z",
    "stored": "2020-08-09T00:52:24.389Z",
    "authority": {
        "objectType": "Agent",
        "account": {
            "homePage": "http://cloud.scorm.com",
            "name": "6FHzChshWrTfDVs-z7s"
        },
        "name": "admin"
    },
    "version": "1.0.0",
    "object": {
        "id": "http://localhost/moodle/mod/quiz/view.php?id=2",
        "definition": {
            "name": {
                "en": "test1"
            },
            "type": "http://adlnet.gov/expapi/activities/assessment"
        },
        "objectType": "Activity"
    }
}
I want to grab  name  : "名 小":

"actor": {
        "objectType": "Agent",
        "account": {
            "homePage": "http://localhost/moodle",
            "name": "3"
        },
        "name": "名 小"
    },

this is  my code:

<?php

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

$lrs = new TinCan\RemoteLRS(

    'https://cloud.scorm.com/lrs/hhhh',

    '1.0.2',

    'abcd',

    'ddddd'

);

$actor = new TinCan\Group(

    [name' => '名 小'] 

);

 $response = $lrs->queryStatements(

[ 'actor' => $actor,

'limit' =>8 ,

]

);

?>

I write code,I just want to get student ming data, but I still get other student data....
I don't know how to do 
please help me ,thanks

Average of ratings: -
In reply to hui chi

Re: scorm Tincan api query

by Shirley Gregorczyk -
Picture of Particularly helpful Moodlers
Read the Article - Support Versions- Tin Can requires a third party plug-in
https://docs.moodle.org/39/en/SCORM_FAQ
In reply to Shirley Gregorczyk

回應: Re: scorm Tincan api query

by hui chi -

yes,I have install plug in : logstore xAPI

and I can pass data to scorm cloud

but I don't know how can I use Tincan query

this is my reference:

http://xapi.com/wp-content/assets/e-book/Anatomy-of-a-Tin-Can-Statement-e-Book.pdf 

this is  my code:

<?php

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

$lrs = new TinCan\RemoteLRS(

    'https://cloud.scorm.com/lrs/hhhh',

    '1.0.2',

    'abcd',

    'ddddd'

);

$actor = new TinCan\Group(

    [name' => '名 小'] 

);

 $response = $lrs->queryStatements(

[ 'actor' => $actor,

'limit' =>8 ,

]

);

?>

I write code,I just want to get student ming data, but I still get other student data....
I don't know how to do 
please help me ,thanks

In reply to hui chi

Re: 回應: Re: scorm Tincan api query

by Shirley Gregorczyk -
Picture of Particularly helpful Moodlers
Hopefully, someone else can help you - as Tin Can is not needed for my use cases.
There are a few Moodle Trackers - you should consider voting on since you are using Tin Can.
MDL-35433 and MDL-44655
Kind Regards