PYP Term Grade Scores
ManageBac+'s Term Grades in the Primary Years Program have a complex data structure due to the nature of assessment and reporting within that curriculum. Thus, the API responses have a deeply nested properties, different from other term grades in other curricula.
In order to extract the grades ("scores") that are embedded in the response requires understanding how to flatten the nested structure, which can be accomplished by understanding the patterns in the data.
This article is intended to provide developers with a high-level overview in order to parse responses to extract scores.
Term Grade Entities
A term grade entity has three IDs that establish its uniqueness:
Class ID
Term ID
Student ID
The API is accessed via a Class ID and Term ID passed as path parameters, and the responses is an array of records where the Student ID can be obtained:
/v2/classes/:class_id/assessments/term/:term_id/term-grades
To determine valid term_id for a given class, please use the /v2/classes or /v2/classes/:class_id endpoint, which includes a start_term_id and end_term_id for each class class, and then the /v2/school/academic-years endpoint to loop through the terms in-between.
Responses
Each record has nested keys that correspond to different sections on the term grade report, for example atl_assessment, rubrics, subjects, and units, highlighted here:
{
"students": [
{
"id": 123455,
"name": "Last Name, First Name",
"term_grade": [
"atl_assessments": {},
"comments": "Comment",
"rubrics": [],
"subjects": [],
"units": []
]
},
// ...
]
}Nested Properties
When the above properties are expanded, the keys provided within each key can differ according to settings. For example, The units structure may have scores embedded inside of different areas of a unit, for example "overall_assessment".
// ...
"units": [
{
"comment": null,
"id": 123456,
"overall_assessment": {
"criteria": [
{
"id": 1234,
"score": "G", // <--- score
"title": "Effort"
}
]
},
"ss_assessment": {},
"subjects": {},
"title": "How the World Works (Change)",
"transciplinary_theme": {
}
}
],
// ...These values correspond to the teacher evaluations entered into the term grade, if enabled. These evaluations can be done on a per-unit basis:

Other scores are deeply nested into the subjects structure. Depending on settings, it can have the path subjects -> stands -> standards -> standards -> criteria.
Other possible paths are:
subjects -> strands -> criteria
subjects -> phases -> criteria
subjects -> strands -> standards -> criteria
subjects -> strands -> standards -> standards -> criteria
Last updated
Was this helpful?

