caccl-grade-passback
Version:
Sends LTI 1.1 grade passback to Canvas. Support text and url submissions and overall score.
44 lines (43 loc) • 1.64 kB
TypeScript
/**
* Submits a grade passback request to Canvas
* @author Gabe Abrams
* @param opts object containing all arguments
* @param opts.request an object containing all the information for the
* passback request
* @param [opts.request.text] the text of the submission. If this is
* included, url cannot be included
* @param [opts.request.url] a url to send as the student's submission.
* If this is included, text cannot be included
* @param [opts.request.score] the student's score on this assignment
* @param [opts.request.percent] the student's score as a percent (0-100)
* on the assignment
* @param [opts.request.submittedAt=now] a timestamp for when the
* student submitted the grade. The type must either be a Date object or an
* ISO 8601 formatted string
* @param opts.info an object containing all LTI info required for the
* grade passback process
* @param opts.info.sourcedId the LTI sourcedid
* @param opts.info.url the LTI outcome service url
* @param opts.credentials an object containing the app's credentials
* @param opts.credentials.consumerKey the app's consumer key
* @param opts.credentials.consumerSecret the app's consumer secret
* @returns true if the request was successful
*/
declare const handlePassback: (opts: {
request: {
text?: string;
url?: string;
score?: number;
percent?: number;
submittedAt?: (Date | string);
};
info: {
sourcedId: string;
url: string;
};
credentials: {
consumerKey: string;
consumerSecret: string;
};
}) => Promise<boolean>;
export default handlePassback;