View Rubric as Student via API

Jump to solution
LordAlex
Community Member

Hi,

 

How does one get information about a rubric (title, criteria, ratings, and descriptions) whilst authenticated as a student user type?

Using Get a single submission (from the URL https://-.instructure.com/api/v1/courses/-/assignments/-/submissions/-?include[]=full_rubric_assessm...) with "include full_rubric_assessment" gets some information:

"full_rubric_assessment": {
"id": 7531,
"rubric_id": 1556,
"rubric_association_id": 6751,
"score": 10,
"artifact_id": 3546759,
"artifact_type": "Submission",
"assessment_type": "grading",
"assessor_id": 1552,
"artifact_attempt": null,
"data": [
{
"id": null,
"points": 3,
"criterion_id": "_9667",
"learning_outcome_id": null,
"description": "No Details",
"comments_enabled": true,
"comments": ""
}
],
"rubric_association": {
"id": 6751,
"rubric_id": 1556,
"association_id": 112759,
"association_type": "Assignment",
"use_for_grading": true,
"created_at": "2023-10-11T10:14:54Z",
"updated_at": "2023-10-18T11:22:36Z",
"title": "Assessment 1",
"summary_data": null,
"purpose": "grading",
"url": null,
"context_id": -,
"context_type": "Course",
"hide_score_total": false,
"bookmarked": true,
"context_code": "course_-",
"hide_points": false,
"hide_outcome_results": false,
"root_account_id": 1,
"workflow_state": "active"
},
"assessor_name": "-",
"assessor_avatar_url": null
}

However, this says nothing about the actual criteria.

Using Get a single rubric (from the URL https://-.instructure.com/api/v1/courses/-/rubrics/-) returns error 403.

 

But on the Canvas website, it shows up on the submission details page from the Show Rubric button, and also on the Grades page, with the title, "Assessed by ...", table, and descriptions of the criteria.

 

So how do I get this information through the API, logged in with student credentials?

 

Kind regards,

Alex

Labels (1)
0 Likes
1 Solution
DecoyLex
Community Participant

Hi Alex,

Have you tried adding &include[]=assignment to the request? When I do that, I get back the full rubric information inside the assignment object. This makes sense because the rubric is attached to the assignment, not the submission (even though the rubric assessment is part of the submission). You'd need to do some data stitching to get the same rubric view you'd expect to see in the Canvas GUI, but this should get you on the right track.

 

GET https://canvas.instructure.com/api/v1/courses/123/assignments/456/submissions/789?include[]=assignment

{
    ... // Stuff you already had
    "assignment": {
        ... // Standard assignment stuff
        "rubric": [
            {
                "id": "_7938",
                "points": 20.0,
                "description": "Criterion 1",
                "long_description": "Blah blah blah",
                "criterion_use_range": false,
                "ratings": [
                    {
                        "id": "_6010",
                        "points": 20.0,
                        "description": "Superior",
                        "long_description": "Blah blah blah blah blah",
                    },
                    {
                        "id": "_3825",
                        "points": 10.0,
                        "description": "Acceptable",
                        "long_description": "Blah blah blah blah blah",
                    },
                    {
                        "id": "_9091",
                        "points": 5.0,
                        "description": "Marginal",
                        "long_description": "Blah blah blah blah blah",
                    },
                    {
                        "id": "_1275",
                        "points": 0.0,
                        "description": "Unacceptable",
                        "long_description": "Blah blah blah blah blah",
                    }
                ]
            }
        ],
        "rubric_settings": {
            "id": 17381,
            "title": "Test Rubric",
            "points_possible": 20.0,
            "free_form_criterion_comments": false,
            "hide_score_total": false,
            "hide_points": false
        }
    }
}

 

 One caveat for this is that, if the rubric is disassociated with the assignment, I'm pretty sure the rubric assessment will remain but there will be no rubric on the actual assignment object.

I hope this helps!

View solution in original post