Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/course-next.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The decisions file (`src/data_files/course-decisions/<CODE>.json`) is keyed by t

- **Tabs.** "Current, until <day before>" (first, the default) and "Upcoming, from <day>". Each holds a whole course, with its own audience profile.
- **Headings are plain HTML** with ids that start with `current-` or `upcoming-`, so "On this page" does not list every domain twice (it lists none while a change is upcoming); the links between the tasks of one version use those ids.
- **Marks** come from the difference between the two courses (`versionMarks`, the same pairing as the build): a new task (green, underlined, badge "New from <day>"), a reworded task (green and underlined in the upcoming tab, its old wording with "Reworded from <day>" in the current tab), a task that leaves (red, badge "Leaves <day>"), and cards only one version has: `LinkCard`'s `change="added"` or `"removed"` and `tag` give a tint and a text label ("New from <day>", "Until <day before>"). The cards of a new or leaving task are not marked (the heading says it). Colour is never the only cue, the same rule as the Changes page. When more than half of the tasks are new or reworded (a course built with the whole pipeline) nothing is marked and a note says the course was largely rewritten.
- **Marks** come from the difference between the two courses (`versionMarks`, the same pairing as the build): a new task (green, underlined, badge "New from <day>"), a reworded task (green and underlined in the upcoming tab, its old wording with "Reworded from <day>" in the current tab), a task that leaves (red, badge "Leaves <day>"), and cards only one version has: `LinkCard`'s `change="added"` or `"removed"` and `tag` give a tint and a text label ("New from <day>", "Until <day before>"). The cards of a new or leaving task are not marked (the heading says it). Colour is never the only cue, the same rule as the Changes page. There is no limit: a course that is mostly new or reworded is marked like any other (decision of the maintainers, 2026-11-26: the page exists to show what differs, and a page with no marks shows nothing). `MAJOR_SHARE` only decides whether `course-next build` patches the course or asks for the whole pipeline.
- **The switch on the day.** From the effective day (UTC, the day itself counts) the component renders only the upcoming course, with no tab strip, no marks and no notes. The build decides, and a script decides again in the browser (the same `daysUntil` as the exam page's banner), so a page built before the day is right on it. The next build after the day renders the same, and `course-promote.mjs` (below) replaces the course in force by the upcoming one and renders the single page again.
- **`#upcoming`** opens the upcoming tab (the exam page's banner links it, see below).
- A page that is not rendered this way is byte for byte what `render` wrote before: `render` of all 43 courses was compared with their committed pages.
Expand Down
15 changes: 5 additions & 10 deletions scripts/lib/course-next.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -703,22 +703,20 @@ export function rekeyDecisions(store, rekey) {

/**
* What differs between the course in force and the upcoming course, for the page that shows both:
* { largely, counts, current: { task, card }, upcoming: { task, card } }. `task` maps a task key to what the
* { counts, current: { task, card }, upcoming: { task, card } }. `task` maps a task key to what the
* heading says ("new", "reworded-upcoming", "reworded-current", "leaves") and `card` maps `<task key>|<page path>`
* to "added" (only the upcoming course has the card) or "removed" (only the course in force has it); cards of a
* task that is new or leaves are not marked, the heading says it. When the change is a rewrite (more than
* MAJOR_SHARE of the tasks new or reworded) nothing is marked and `largely` is true: marks on most of the page
* say nothing.
* task that is new or leaves are not marked, the heading says it. Every change is marked, however much of the
* course it touches: showing what differs is the point of the page, so there is no limit (a rewrite is marked
* like any other change; MAJOR_SHARE only stops `buildNext` from patching one).
*/
export function versionMarks({ current, next }) {
const { pairs, counts, share } = planNext({ course: current, guide: next });
const { pairs, counts } = planNext({ course: current, guide: next });
const marks = {
largely: share > MAJOR_SHARE,
counts,
current: { task: new Map(), card: new Map() },
upcoming: { task: new Map(), card: new Map() },
};
if (marks.largely) return marks;
const pathsOf = (task) =>
new Set((task.picks ?? []).map((pick) => pick.target.path));
for (const pair of pairs) {
Expand Down Expand Up @@ -754,11 +752,8 @@ export function versionLabels({ effective, counts }) {
current: `Current, until ${eve}`,
upcoming: `Upcoming, from ${day}`,
intro: `The skills measured change on ${day}. The first tab is the course for what the exam measures until ${eve}, the second tab the course for the skills measured from ${day}. What differs between them is marked in words as well as colour; the Study Guide Changes page shows every difference word for word.`,
rewrittenIntro: `The skills measured change on ${day}. The first tab is the course for what the exam measures until ${eve}, the second tab the course for the skills measured from ${day}. Because most of the study guide was rewritten, individual tasks and cards are not marked; the Study Guide Changes page shows every difference word for word.`,
currentLegend: `This is the course for the skills measured until ${eve}. A task that leaves is marked "Leaves ${day}", a card the upcoming course does not have says "Until ${eve}", and a reworded task keeps its old wording here.`,
currentRewrittenLegend: `This is the course for the skills measured until ${eve}. Because most of the study guide was rewritten for ${day}, individual tasks and cards are not marked here; see the Study Guide Changes page for what changed.`,
upcomingLegend: `This is the course for the skills measured from ${day}. New and reworded tasks are green and underlined with a badge, and a card the current course does not have is green and says "New from ${day}".`,
rewritten: `This course was largely rewritten for the skills measured from ${day}: ${counts.added + counts.reworded} of ${counts.tasks} tasks are new or reworded, so nothing is marked. The Study Guide Changes page shows what changed.`,
added: `New from ${day}`,
reworded: "Reworded",
rewordedCurrent: `Reworded from ${day}`,
Expand Down
12 changes: 3 additions & 9 deletions scripts/lib/course-render.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -627,27 +627,21 @@ export function renderCourseVersions(
'<div slot="intro">',
"",
":::caution",
marks.largely && labels.rewrittenIntro
? labels.rewrittenIntro
: labels.intro,
labels.intro,
":::",
"",
"</div>",
"",
'<div slot="current">',
"",
...note(
marks.largely && labels.currentRewrittenLegend
? labels.currentRewrittenLegend
: labels.currentLegend,
),
...note(labels.currentLegend),
...side(current, "current-", marks.current.task, marks.current.card),
"",
"</div>",
"",
'<div slot="upcoming">',
"",
...note(marks.largely ? labels.rewritten : labels.upcomingLegend),
...note(labels.upcomingLegend),
...side(next, "upcoming-", marks.upcoming.task, marks.upcoming.card),
"",
"</div>",
Expand Down
Loading
Loading