arazzo: 1.0.1 info: title: Canvas LMS Grade an Assignment From a Module summary: List a course's modules with items, then grade a student on a module assignment. description: >- A module-driven grading flow for Canvas. Because the covered REST surface exposes module listing but not module-item authoring, this workflow adapts the "create module then add item" theme to a supported read-then-grade pattern: it lists the course modules including their items, then reads and grades a student's submission for the assignment id supplied for one of those module items. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: canvasApi url: ../openapi/canvas-lms-rest-api-openapi.yml type: openapi workflows: - workflowId: grade-module-assignment summary: List modules then grade a student on a module's assignment. description: >- Lists the course modules with items for context, reads the student's submission for the supplied module assignment, and posts a grade. inputs: type: object required: - courseId - assignmentId - userId - postedGrade properties: courseId: type: string description: The Canvas course id. assignmentId: type: string description: The Canvas assignment id linked from a module item. userId: type: string description: The Canvas user id of the student to grade. postedGrade: type: string description: The grade to post. steps: - stepId: listModules description: >- List the course modules including their items to provide module context for the assignment being graded. operationId: listModules parameters: - name: course_id in: path value: $inputs.courseId - name: include[] in: query value: - items successCriteria: - condition: $statusCode == 200 outputs: firstModuleId: $response.body#/0/id firstModuleName: $response.body#/0/name - stepId: getSubmission description: >- Read the student's submission for the module's assignment. operationId: getSubmission parameters: - name: course_id in: path value: $inputs.courseId - name: assignment_id in: path value: $inputs.assignmentId - name: user_id in: path value: $inputs.userId successCriteria: - condition: $statusCode == 200 outputs: submissionUserId: $response.body#/user_id - stepId: gradeSubmission description: >- Post the grade to the student's submission for the module assignment. operationId: gradeSubmission parameters: - name: course_id in: path value: $inputs.courseId - name: assignment_id in: path value: $inputs.assignmentId - name: user_id in: path value: $inputs.userId requestBody: contentType: application/json payload: submission: posted_grade: $inputs.postedGrade successCriteria: - condition: $statusCode == 200 outputs: grade: $response.body#/grade score: $response.body#/score outputs: moduleId: $steps.listModules.outputs.firstModuleId grade: $steps.gradeSubmission.outputs.grade