I am trying to use the .NET TinCan Library for use within my own Learning Management System. I have included the TinCan 0.0.2 Nuget package in my application and uploaded the GolfExample_TCAPI test course. The GolfExample course loads at the following URL when testing locally:
https://127.0.0.1/TINCAN/MYCOMPANY/GolfExample_TCAPI%20(1)/index.html?
On looking at the launch documentation that I could find it seems that at a minimum you are required to pass in the endpoint, the auth, and the actor so I have attempted to do so using the dll as follows within my viewmodel.
var lrs = new RemoteLRS("https://cloud.scorm.com/tc/public/", "<username>", "<password>");
var actor = new TinCan.Agent();
actor.name = "John Paul Mc Feely";
actor.mbox = "jpmcfeely@hsl-data.com";
TINCANStartPage = HttpContext.Current.Request.Url.Scheme + "://" + @HttpContext.Current.Request.Url.Host + ":" +
@HttpContext.Current.Request.Url.Port + HttpContext.Current.Request.ApplicationPath + this.Course.BlobURL + "/index.html" + "?endpoint=" + lrs.endpoint + "&auth=" + lrs.auth + "&actor=" + actor.ToJSON();
When debugging I can see that this created the URL for the launch window as follows:
"https://127.0.0.1/TINCAN/MYCOMPANY/GolfExample_TCAPI (1)/index.html?endpoint=https://cloud.scorm.com/tc/public/&auth=Basic anBtY2ZlZWx5QGhzbC1kYXRhLmNvbTpwbGFzbWExMQ==&actor={\"objectType\":\"Agent\",\"name\":\"John Paul Mc Feely\",\"mbox\":\"jpmcfeely@hsl-data.com\"}"
This looks like the correct format according to the documentation that I can see but when I proceed the window launches with the URL as:
https://127.0.0.1/TINCAN/MYCOMPANY/GolfExample_TCAPI%20(1)/index.html?endpoint=https://cloud.scorm.com/tc/public/&auth=Basic%20anBtY2ZlZWx5QGhzbC1kYXRhLmNvbTpwbGFzbWExMQ==&actor={"objectType":"Agent","name":"John%20Paul%20Mc%20Feely","mbox":"jpmcfeely@hsl-data.com"}
I then get a warning message as follows:
[warning] There was a problem communicating with the Learning Record Store. (400 | Statement 3bd49829-dc0b-4daa-a689-71a84c44e6ad does not have an actor assigned.)
If anyone could see what I am doing wrong here it would be greatly appreciated.