Skip to contents

Instructors supply objectives as a spreadsheet far more often than as YAML, and in a predictable shape: the first column is the course objectives, each remaining column is one session, and every column is a different length because it stops when that session runs out of objectives. This reads that layout and write_objectives() writes the YAML read_objectives() reads.

Usage

read_objectives_table(
  file,
  course_name = NULL,
  title = NULL,
  term = NULL,
  sheet = 1L,
  check = TRUE
)

Arguments

file

Character: Path to the spreadsheet. .xlsx (requires the readxl package), .csv or .tsv.

course_name

Character: Course name, e.g. "Epi 207". Spreadsheets of this shape carry no course metadata, so it is supplied here.

title

Character: Course title.

term

Character: Term the course was taught, e.g. "Winter 2026".

sheet

Integer or character: Sheet to read, for .xlsx.

check

Logical: Whether to run check_objectives() on the result and warn about what it finds, naming the spreadsheet columns.

Value

A named list of the shape read_objectives() returns: "course_name", "title", "term", "objectives" and "sessions". The sessions element carries the original column headers in its "headers" attribute, which write_objectives() emits as comments.

Details

Course_Objectives   Week1_Objectives   Week2_Objectives
Identify sources..  Distinguish caus.. Practice develo..
Identify the pur..  Apply counterfac.. Understand how ..
Gain experience ..                     Identify how to..

Empty cells are dropped, so the ragged columns need no padding or alignment. Sessions are keyed session_01, session_02, ... in column order, and the original column header is preserved as a comment by write_objectives(). The key prefix is not cosmetic: map_course_to_sessions() shortens session_NN to SNN when it builds ids, so a sheet whose columns are weeks still gets readable ids and keeps its week numbering in the comment.

This is verbatim, and that is deliberate

Objectives come through exactly as written, including the ones that open with "Understand" or "Identify" and so name no observable behavior. Restating them as behavioral outcomes is a separate step, done with the material in hand and recorded in the file it produces – not folded into a reader, where it would silently change what the instructors said.

What it warns about

A column with a header and no objectives under it is dropped, since an empty session cannot be mapped, and the warning names it.

Everything else comes from check_objectives(), which is where those checks live: a spreadsheet built by copying columns and a YAML file edited by hand arrive in the same state, so one checker finds both. What the reader adds is the timing and the vocabulary. This is the last point at which the columns exist – afterwards they are session_NN keys – so findings are reported here, against the headers they came from:

2 problem(s) in "epi207.csv": identical_sessions in "Week1_Objectives" =
"Week2_Objectives"; duplicate_objective in "Week3_Objectives".

Two columns holding identical objectives are still both kept: a module taught over two sessions legitimately looks like this, a copy-paste error looks the same, and only the instructors can say which it is. Call check_objectives() on the result for the full table, or pass check = FALSE to read the sheet without it.

Author

EDG