Version 1.5.0
Students can belong to a subdivision, such as a United States state, which decides the time of a local exam and which state-targeted exams they are offered. A United States student now needs one. One new operation, one new optional field and one new error code; nothing is removed.
Added
listCountrySubdivisions(GET /v1/country/{id}/subdivision) lists the subdivisions of a country, such as the 50 United States and the District of Columbia, a page at a time, with each one's_id, ISO 3166-2code,nameandtz. It needs thecountry/readpermission you already hold forlistCountries, so no role changes. An unknown or reserved country answers404 not_found, asgetCountrydoes; a country without subdivisions answers an empty page, which means its students need no subdivision.- The student operations take an optional
subdivision:registerStudent,checkStudentRegistration,createStudentImport(on each row),updateStudentandupdateOrgStudent. Send the subdivision's_idor its full ISO 3166-2 code (US-CA, never a bareCAor a name). It must belong to the student'scountry; anything else answers400 bad_request. Subdivision_ids are the same in every organization and in the sandbox. A student'susernamenever depends on it.getStudent,listStudents,getOrgStudent,listOrgStudents,linkStudentSupervisorandsetStudentPasswordreturn it (resolved into a record on the reads, an id on the writes), andcheckStudentRegistrationreturns it inresolvedand may list it inproblems[].field. listCountriesandgetCountryreturnsubdivisionRequired(truefor the United States) andsubdivisionLabel(State) on a country that has them, and in thecountriesan exam or a student carries (listExams,getExam,getStudentand the other reads that resolve a country).- Exams can be limited to states:
listExams,getExam,listAvailableExams,getApplication,listApplicationsandlistStudentApplicationsreturnsubdivisionson an exam. An exam that lists states of the student's country is offered only to students of those states (listAvailableExams), andcreateApplicationandmoveApplicationanswer409 conflict("Exam is not available in this student's state. It is offered in …") for any other student of that country. An exam that lists no states behaves as before. - A new error code,
subdivision_required(400), and the same code as a row code ofcreateStudentImportandgetStudentImport: the student's country needs a subdivision and none is given or stored. See the error reference.
Changed
- Versioning exception: a United States student needs a state. For a country whose
subdivisionRequiredistrue,registerStudentand each row ofcreateStudentImportneed asubdivision, andcheckStudentRegistrationreports its absence inproblems. A body that omitted it and was accepted before is now refused with400 subdivision_required(a row with the row codesubdivision_required). This is deliberately not announced as a breaking change, because no field became required in the contract: the rule follows the country's ownsubdivisionRequiredflag, which isfalsefor every country until the platform switches it on, and countries without subdivisions are never affected. Sandbox students in the United States need a state too. updateStudentandupdateOrgStudentcheck the state only when the body changescountryor sendssubdivision: a country that needs a state, with no state of that country on the student or in the body, is refused with400 subdivision_required, and a country without states drops the old country's state. A phone change on an existing student is never refused for want of a state.listAvailableExams,createApplicationandmoveApplicationanswer400 subdivision_requiredfor a student whose country needs a state and who has none, instead of offering a partial list. Reading and updating the student are not affected.- An exam's
countriesand the idslistCountriesreturns are the same ids (the platform keeps one id per country); the documentation no longer says they may differ. Nothing enforces it, so comparing byiso2still always works. tzon a country is documented as the zone for students without a subdivision; the example showedAmerica/New_York, and the United States row isAmerica/Chicago. A student with asubdivisionsits alocalexam in the subdivision's owntz.
Release notes
Version 1.5.0 adds a layer below the country. A student can belong to a subdivision (today, a
United States state), and the platform treats it like a country for the time of a local exam and for
which exams a student is offered. It adds one operation, one optional field, one error code and
removes nothing.
Listing subdivisions
listCountrySubdivisions lists the subdivisions of a
country. A country whose subdivisionRequired is true needs every student to have one. See
Subdivisions.
Sending a subdivision
The student operations take subdivision, as the _id or the full ISO 3166-2 code (US-CA). It is
looked up inside the student's country. A United States registration without it is refused with
subdivision_required. It never changes the username. See
Students.
State-targeted exams
An exam can list states. It is then offered only to students of those states in the countries it
names, and applying any other student answers 409. An exam that lists no states behaves as before.
See Exams for some states only.
Before you upgrade
If you register United States students, add the state to your registration, and set it on the students
you registered earlier with updateStudent before entering them for exams. Their usernames do not
change. Code written against 1.4.0 for other countries keeps working without a change.