LTI Outcomes V2

LTI Outcomes V2

Hello I am trying to develop a tool provider using Outcomes V2. I have been testing against moodle and wanted to know how do i construct or get the lineitem. I currently have this:

LtiLibrary.Core.Outcomes.v2.LisResult result = new LtiLibrary.Core.Outcomes.v2.LisResult();
LtiLibrary.Core.Outcomes.v2.LisPerson person = new LtiLibrary.Core.Outcomes.v2.LisPerson();

person.UserId = "2";

// Uri uri = new Uri("");
result.Comment = "Good Job";

result.ResultAgent = person;
// result.ResultOf = uri;
result.ResultScore = "10";

Exception ex = LtiLibrary.Core.Outcomes.v2.OutcomesClient.PostResult(result, Request.Form["lis_outcome_service_url"].ToString(), Request.Form["oauth_consumer_key"].ToString(), clsLtiParams.SharedSecret).Exception;

i need to know how to complete the lisPerson object and the ResultOf URI

StephenVickers's picture

LTI Outcomes V2

I was not aware that Moodle supported the LTI Result service; is it possible you are confusing this with the Basic Outcomes service (as documented in LTI 1.1)? The Result service operates only against the default lineitem for a resource link so you do not construct it - you should get the service endpoint passed on launch. As per the LTI 2.0 specification, a Result object has this structure:

  "@context" : "",
  "@type" : "Result",
  "resultScore" : 0.83,
  "comment" : "This is exceptional work."

I suspect your references to a resultOf element may be to an earlier version of the new Gradebook services which I expect will be finally released in the next few months. It is not part of the LTI 2.0 Result service or any current drafts being worked on. What code library are you using?

StephenVickers's picture

Re: LTI Outcomes V2

Further to my previous message, I realised that you may have been referring to the proposed Score service which has yet to be published.  The current draft includes a resultAgent element, but not a resultScore element.  My advice would be to contact the author of the library you are using.