0

I am trying to update my LMS to be TinCanAPI compliant and while I have been able to capture the statements for the beginning and the end of the Tetris Example game I have been unable to update the ActivityProfile calls to highscores as I am unsure as to what exactly is required to be returned.

I have the following WebAPI controller:

public class ActivitiesController : ApiController
{
    private XAPIBiz xvm;

    public ActivitiesController()
    {
         MetaLearning.Data.MetaLearningContext dbcontext = new MetaLearningContext(System.Configuration.ConfigurationManager.ConnectionStrings["MetaLearningContext"].ConnectionString);
         xvm = new MetaLearning.Biz.XAPIBiz(dbcontext);
    }

    // GET api/activity/5
    public string Get([FromUri]string profileId, [FromUri]string activityId)
    {
        return "[{actor:{name:John Paul}, score:9921, date:2014-04-07T14:42:46.492Z},{actor:{name:John Paul}, score:4000, date:2014-04-07T14:42:46.492Z}]";

        //var test = profileId;
        //var test2 = activityId;
        //return "value";
    }

    .......
}

If I try to view the leaderboard when the course is hosted on Cloud.Scorm.Com then I am able to see the request to /activities/profile?profileId=highscores&activityId=http%3A%2F%2Ftincanapi.com%2FJsTetris_TCAPI

I get the response of

"[{actor:{name:John Paul}, score:9921, date:2014-04-07T14:42:46.492Z},{actor:{name:John Paul}, score:4000, date:2014-04-07T14:42:46.492Z}]"

But If I try to return just the string value of this for testing purposes I get a list of 137 undefined on the leaderboard.

If I return void in this controller action then the leaderboard appears blank.

If I save the text in this file as a json file and save to blob storage and then try to return a URI pointing to the file I get an undefined list of 66 names.

Any help in furthering my understanding of how the ActivityProfile API works would be greatly appreciated. What is the implementation on SCORM cloud?

Jay
  • 3,012
  • 14
  • 48
  • 99
  • Two questions: 1. What headers are you returning? Do they match this (https://github.com/adlnet/xAPI-Spec/blob/1.0.1/xAPI.md#75-activity-profile-api)? 2. Can you include a screenshot or a full error of what you see on the leaderboard including any errors in the console? Even better - can you give us a link to a page we can visit that shows this error? – Andrew Downes Jul 07 '14 at 11:44
  • X-Experience-API-Version:1.0.0 Query String Parametersview sourceview URL encoded profileId:highscores activityId:http://tincanapi.com/JsTetris_TCAPI Response Headersview source Cache-Control:no-cache Content-Length:187 Content-Type:application/json Date:Mon, 07 Jul 2014 12:54:07 GMT Expires:-1 Pragma:no-cache Server:Microsoft-IIS/8.0 X-AspNet-Version:4.0.30319 X-Powered-By:ASP.NET ConsoleSearchEmulationRendering – Jay Jul 07 '14 at 13:08
  • Is there any way you can share your endpoint and credentials so I can inspect? – Andrew Downes Jul 07 '14 at 20:16

0 Answers0