Fix JSON structure for rubric_assessment objects
Currently, it seems impossible to develop a schema that properly describes current and future rubric assessments that may be returned via the CANVAS REST API. This prevents us from using tools that require JSON Schema validation for REST data from being used with the CANVAS REST API. E.g. it is not possible to use this JSON data from within Microsoft's PowerAutomate, PowerApps or PowerBI.
The following request returns rubric_assessment objects for which the IDs have been objectified (i.e. the object name is the ID, instead of having a proper ID attribute):
GET /api/v1/courses/:course_id/assignments/:assignment_id/submissions/:submission_id?include[]=rubric_assessment
Here is an example schema that would be required for the returned rubric_assessment JSON objects:
"rubric_assessment": {
"type": "object",
"properties": {
"_8534": {
"type": "object",
"properties": {
"rating_id": {
"type": "string"
},
"comments": {
"type": "string"
},
"points": {
"type": "integer"
}
}
},
"_7209": {
"type": "object",
"properties": {
"rating_id": {},
"comments": {
"type": "string"
},
"points": {
"type": "integer"
}
}
},
"_4553": {
"type": "object",
"properties": {
"rating_id": {},
"comments": {
"type": "string"
},
"points": {
"type": "number"
}
}
}
}
}
Note that "_4553", "_7290", "_8534" are unique to a very specific set of rubrics defined in Canvas. The moment a new rubric is defined, a new schema would have to be defined, as the new objectified ID would not be covered by the current schema (e.g. the new ID might be 931251, and thus an object "_931251" would have to be added to the schema).
This makes working with the CANVAS REST API impossible in the context of Microsoft PowerAutomate. Additional String/text processing would be required to turn the current Canvas JSON formatting into proper formatting. This, however, is slow and computationally very expensive in PowerAutomate so that I currently have to abandon an automation project that aimed to build on the CANVAS REST API.
(Yes, this is also an issue with PowerAutomate/PowerApps - but it is first and foremost an issue based on a very "weird" data structure that Canvas uses, which does not seem to make sense.)
The following is a schema that would work and would seem more sound:
"rubric_assessment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"comments": {
"type": "string"
},
"points": {
"type": "integer"
},
"rating_id": {
"type": "string"
}
}
}
}
It's cleaner, shorter and less complex than the one that Canvas' JSON currently requires and it still allows capturing all of the required information in a rubric_assessment object.
Fixing this issue will make Canvas more usable in a lot of automation and software development tools and for us would open up opportunities to automate several of our tasks with MS PowerApps/PowerAutomate.
Thank you for your consideration.
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.