Skip to contents

Groups roster items into educators and gives each educator a permanent id of the form TLE000001.

  • Automatic: items sharing an email (any of primary, updated or secondary, in any year) are the same educator.

  • Approved decisions: decisions rows with decision == "same" link two items that share no email. "different" rows say the two items are different people: item_id_b's emails stop linking it to anyone (its email was wrong or shared), and the pair leaves the review queue. Put the item with the wrong email in item_id_b. Any other value (the review sheet stores "distinct": different people, both emails correct) only takes the pair out of the review queue.

  • Stable ids: an educator keeps the id its items had in previous_aliases. When two previously separate educators merge, the larger keeps its id and the merge is reported. When one splits, the larger part keeps the id and the rest get new ones. New educators get the next unused number, in order of first school year and then item id, so a seed run is reproducible.

Usage

assign_educator_ids(aliases, previous_aliases = NULL, decisions = NULL)

Arguments

aliases

Output of roster_items_to_aliases(), bound across boards.

previous_aliases

The last published alias table (with item_id and educator_id), or NULL on the first run.

decisions

Tibble with item_id_a, item_id_b, decision, or NULL.

Value

A list: aliases (input plus educator_id, and email_links, FALSE where a decision detached the item's email, so lookups by email should skip that row) and id_changes (merges and splits relative to previous_aliases).