Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error setting grade using ltijs #241

Open
jpsandovaln opened this issue Nov 11, 2024 · 1 comment
Open

Error setting grade using ltijs #241

jpsandovaln opened this issue Nov 11, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jpsandovaln
Copy link

Describe the bug
When try to set grade an error is displayed

         const gradeObj = {
          userId: idtoken.user,
          scoreGiven: score,
          scoreMaximum: 100,
          activityProgress: 'Completed',
          gradingProgress: 'FullyGraded'}

        const responseGrade = await this.lti.Grade.submitScore(idtoken, lineItemId, gradeObj)

Reviewing the submitScore function the problem occurs in the following lines

const accessToken = await platform.platformAccessToken(scopes.join(' '));
the value for scopes is: const scopes = ['https://purl.imsglobal.org/spec/lti-ags/scope/score'];

Expected behavior
Set grade without issues

Provider logs
HTTPError: Response code 404 (Not Found)
at Request. (/home/paolo.sandoval/master-quiz-lti/server/node_modules/got/dist/source/as-promise/index.js:118:42)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_NON_2XX_3XX_RESPONSE',
timings: {
start: 1731354953859,
socket: 1731354953859,
lookup: 1731354953859,
connect: 1731354953859,
secureConnect: 1731354953859,
upload: 1731354953859,
response: 1731354954048,
end: 1731354954165,
error: undefined,
abort: undefined,
phases: {
wait: 0,
dns: 0,
tcp: 0,
tls: 0,
request: 0,
firstByte: 189,
download: 117,
total: 306
}
}
}

Ltijs version
"ltijs": "^5.9.5"

NodeJS version
v20.18.0

Platform used
Canvas

Additional context
I am using typescript for my current project but I see the same error with you the example on github

@jpsandovaln jpsandovaln added the bug Something isn't working label Nov 11, 2024
@siddrc
Copy link

siddrc commented Nov 24, 2024

Hello @jpsandovaln are you still facing this issue..ping me on discord I would like to help , here is my id
siddharthroyc_97017
Also I have article on this
https://medium.com/@debu2in/implementing-ltiv1-3-using-ltijs-1ab38ab87567

Just wanna helps folks out there who are trying to make sense of this lovely library :) and I can say this with confidence coz I have stuff in PROD using this library and only after I figured stuff out I realised this library does literally everything 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants