Skip to content

Error Grades Services / Ask update @types/ltijs #256

@MrPeanutss

Description

@MrPeanutss

Hello everyone,

I would like first notice that @types/ltijs, types are not synchronized with some services like Grades. Only these methods are available :

export interface GradeService {
    scorePublish(idtoken: IdToken, grade: PublishedGrade): Promise<boolean>;

    result(idtoken: IdToken, filters?: GradeFilters): Promise<RetrievedGrade[] | false>;
}

I have an another, with Moodle . I'm trying to publish a score with ```scorePublish" or try to get lineItems , I always I have an error .

provider:main Ltik found +0ms
  provider:main Ltik successfully verified +1ms
  provider:main Attempting to retrieve matching session cookie +0ms
  provider:auth Valid session found +2ms
  provider:main Passing request to next handler +3ms
  provider:gradeService Target platform: https://******.fr +0ms
  provider:main Passing request to next handler +1ms
  provider:main Passing request to next handler +2ms
  provider:gradeService Attempting to retrieve platform access_token for [https://*******.fr] +10ms
  provider:platform Valid access_token for https://*******.fr not found +0ms
  provider:platform Attempting to generate new access_token for https://******.fr +0ms
  provider:platform With scopes: https://purl.imsglobal.org/spec/lti-ags/scope/lineitem https://purl.imsglobal.org/spec/lti-ags/scope/score +0ms
  provider:main Receiving request at path: /favicon.ico +13ms
  provider:main Path does not match reserved endpoints +0ms
  provider:main Cookies received:  +0ms
  provider:main [Object: null prototype] {
  provider:main   'ltiaHR0cHM6Ly9lY2FtcHVzLnBhcmlzLXNhY2xheS5mcm52bnIyUW1KMFJlMjJDMjExMg%3D%3D': '87840'
  provider:main } +0ms
  provider:main No ltik found +0ms
  provider:main Request body:  {} +0ms
  provider:main Passing request to invalid token handler +0ms
  provider:auth Awaiting return from the platform +304ms
  provider:main Receiving request at path: /assets/logo192.png +22ms
  provider:main Path does not match reserved endpoints +0ms
  provider:main Cookies received:  +0ms
  provider:main [Object: null prototype] {
  provider:main   'ltiaHR0cHM6Ly9lY2FtcHVzLnBhcmlzLXNhY2xheS5mcm52bnIyUW1KMFJlMjJDMjExMg%3D%3D': '87840'
  provider:main } +0ms
  provider:main No ltik found +1ms
  provider:main Request body:  {} +0ms
  provider:main Passing request to invalid token handler +0ms
node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

HTTPError: Response code 404 (Not Found)
    at Request.<anonymous> (C:\Users\user\Documents\Code\app\app\lti\dist\index.js:35957:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1742319606729,
    socket: 1742319606729,
    lookup: 1742319606729,
    connect: 1742319606729,
    secureConnect: 1742319606729,
    upload: 1742319606729,
    response: 1742319606893,
    end: 1742319606905,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 0,
      dns: 0,
      tcp: 0,
      tls: 0,
      request: 0,
      firstByte: 164,
      download: 12,
      total: 176
    }
  }
}

In my opinion , the problem is from the accessToken

    const accessToken = await platform.platformAccessToken('https://purl.imsglobal.org/spec/lti-ags/scope/lineitem https://purl.imsglobal.org/spec/lti-ags/scope/score')
    provGradeServiceDebug('Access_token retrieved for [' + idtoken.iss + ']')

and the logs corresponding.

  provider:gradeService Attempting to retrieve platform access_token for [https://************.fr] +10ms
  provider:platform Valid access_token for https://******.fr not found +0ms
  provider:platform Attempting to generate new access_token for https://******.fr +0ms

In moodle, LTI is configured for "Use this service for grade synchronization and column management – ​​The service will be able to create and modify notebook columns and manage grades.".

If anyone succeed to publish score or have this problems is welcome to discuss together .

Regards

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions