Cvmcosta / ltijs

Turn your application into a fully integratable LTI 1.3 tool provider.
https://cvmcosta.github.io/ltijs/
Apache License 2.0
296 stars 64 forks source link

Add option for custom timestamp when publishing grades #229

Open prayujt opened 1 month ago

prayujt commented 1 month ago

Is your feature request related to a problem? Please describe. When publishing a grade with ltijs's Grade.submitScore service, it sets the timestamp to be the current time by default. However, in the case of our application, grades are being published to the LMS after the assignment's due date, and so they are all showing up as late submissions in the LMS.

Describe the solution you'd like We store submission times on our third party application, and would like those submission times to be used as the submission times on canvas. Instead of always hardcoding the submission timestamp to the current time, allow the user to optionally pass in the timestamp field in the score object. If it is not provided, it can still be defaulted to the current timestamp.

Additional context Willing to make a PR, this is a one line fix

prayujt commented 1 month ago

https://github.com/Cvmcosta/ltijs/blob/75fb0895816d9bc036d0e930498ce9e70f7ff823/src/Provider/Services/Grade.js#L301C1-L301C57

this line should just be changed to check if a value exists in score or not