Build a Weekly Mini-Course
A piano teacher emails each student a video link by hand every week, and the links keep reaching the wrong people at the wrong time. You will build the small tool that shows each student only the lessons released to them so far, on their own schedule, and proves it with a recorded run of a whole course.
The brief
The client
I am a piano teacher in Utrecht. Twice a year I run a six-week jazz chords course for about 25 students, and I take payment by bank transfer myself. The lessons are videos I upload to a video site as unlisted, which means anyone who has the link can watch.
Every Wednesday I open a spreadsheet and email each student the link for their week. It takes me about an hour. Last run I sent week 4 to a student who was still in week 1, and a student who joined late asked me to send all six links at once, so I worked out her dates by hand. Two of the links have since turned up in a group chat outside the course.
I need one place where each student looks at their own lessons, released on their own schedule, and where I can switch a student off.
The problem
The weekly emailing costs about an hour every Wednesday and goes wrong whenever someone joins late or the spreadsheet is misread. Every link in an email is a permanent address. A forwarded link works for anyone, forever, and the teacher cannot take it back.
She needs students to see their own lessons, released on their own schedule, and she needs a student whose time is up, or who was refunded, to see nothing. The fix has to work for a student who joins in week 3 as well as one who joins on the first day.
The client's name and figures are invented for this brief; the rules and the failures are ones that real businesses of this kind work with.
The spec
Requirements
- Let the teacher create the course with a title, her time zone and its lessons, each with a title, a video link, a place in the order and the number of days after a student's start date that it is released.
- Let the teacher enrol a student with a name, an email address and a start date, and get back a private access code for that student.
- Release each lesson at the start of the calendar day, in the teacher's time zone, that falls its release number of days after that student's own start date.
- Show a student, given their access code, every lesson in order, each marked as released or not yet released, with the date it unlocks when it is not.
- Give a video link only for lessons that are released, and only while the student's 90 day access window is open.
- Let the teacher end a student's enrolment so that nothing is shown to that student from then on.
- Refuse bad input and say which field is wrong.
- Let the person testing the tool ask what a student would see at a given date and time, so the schedule can be checked without waiting.
Deliverables
- A running tool that keeps its data after a restart, and a README that takes a reviewer from a fresh clone to the compared run table in 10 minutes.
- The release rule document with at least six worked examples.
- A script or command that creates the course with its six lessons and enrols the three students of the final run.
- Automated tests, code that drives the tool and checks its answers against what you expect, for the edges of the rule, which run with one command.
- The expected table and the recorded run for three students, committed to your repository.
Out of scope
- Taking payments or checkout. The teacher is paid by bank transfer. The intermediate project in this domain, Build a Course Shop for a Small Studio, is the next one up.
- Uploading or hosting video. A pasted link from a video site is enough.
- Sign-up, passwords and login, for students and for the teacher. An access code is simpler, and real accounts are a topic that has nothing to do with the release rule. The teacher's side (create the course, enrol, end an enrolment) is assumed to run on her own computer. Do not put this tool on the internet, because anyone who can reach it can use the teacher's side.
- Keeping the test time away from students. The "what would this student see at this time" input exists so the schedule can be checked, and anyone who can use the tool can use it to look ahead. A version for real students would remove it.
- Sending emails. The teacher passes the code on herself, and mail delivery is a problem of its own.
- Watch progress, quizzes and certificates. They need data coming in from the student's devices.
- Several courses, several teachers, cohorts with a seat limit and teacher payouts. One course is enough to hold the rule.
- Stopping a student from forwarding a link they were shown. Hiding links until release is the goal. Preventing copying is the video host's job and cannot be checked from outside.
Architectural constraints
- A start date is a calendar date with no time of day. The course has one time zone, named the way the teacher would name it, such as Europe/Amsterdam, and every release is counted in that zone, wherever the server runs or the student sits.
- A lesson released "7 days after the start" appears at the start of the seventh calendar day in the teacher's time zone, also across a clock change. It does not appear 168 hours after the start of the start date.
- What a student sees always follows the dates and rules as they stand when the student asks.
- Access codes cannot be guessed. They are at least 20 characters long and have no link to a name, an email address, a date or the order students enrolled.
- A video link reaches a student only if the lesson is released and the access window is open. A link that is hidden by the page but present in the response counts as sent.
- The person or the request can supply the current time, for testing.
- Bad input is refused, the message names the field, and a refused submission leaves nothing saved.
Prerequisites
You can write a small program in a language of your choice and have saved data to a database or a file at least once. You do not need to know how time zones behave or how to write an automated test. You do not need to know how a piano teacher runs a short online course; the first Phase explains the business and the words the brief uses. You pick the language, and whether the result is a web page, an API that other programs call by sending requests, or a command-line tool: every Checkpoint says what a person does and what they see or get back, so it can be checked in any of the three. Knowing how to run a program from a terminal helps.
Free to start. An account is what keeps track of the checkpoints you finish.
Describe the course and enrol students
Produces the release rule written down with worked examples, a saved course with six lessons, and enrolled students with private access codes. Leaves showing anything to a student for later.
Acceptance criteria
Your repository holds a document that states the release rule in plain sentences and shows at least six examples that you worked out by hand. Each example gives a student's start date, a lesson's release day, and the moment the lesson becomes available, written as a time in Europe/Amsterdam with its offset from UTC, for instance 2027-03-10 00:00 +01:00.
The examples include a lesson with release day 0, a student who joins late and has their own dates, the first and the last day of the 90 day access window, and a start date in the week before a clock change. For that last one, work the case of a start date of 24 Mar 2027 and release day 7: the document gives the moment 31 Mar 2027, 00:00 (+02:00) and states that 167 hours pass between the start of the start date and the release, not 168.
You answer three questions in the document in one sentence each, and the answers are these. A lesson unlocks at 00:00 in Europe/Amsterdam on its release date. A student is shown a lesson at exactly that moment, not one second later. The start date is day 0, and the window stays open through the end of day 90, so it closes at 00:00 on day 91. A reader with a calendar can check every example without running anything.
Architectural guidance
If the rule is not written down before anything is built, whatever gets built becomes the rule, and a student who joined on 24 Mar 2027 finds a lesson missing on the morning she was promised it. Around a clock change a day has 23 or 25 hours, so "a week later" does not always mean 168 hours later.
Acceptance criteria
The teacher gives the tool a course (a title, the time zone Europe/Amsterdam and an access window of 90 days) together with six lessons, entered in one go as a form, a file or one request. Each lesson has a title, a video link, a position and a release day. The release days are 0, 7, 14, 21, 28 and 35.
After the program is stopped and started again, the course and its six lessons are still there, in position order, with the same release days.
A lesson with no title, no video link, a release day below 0 or a release day that is not a whole number is refused, and the message names the lesson and the field that is wrong. A time zone name that does not exist, such as Europe/Amsterdm, is refused the same way. When one of the six lessons is bad, the whole submission is refused: asking for the course afterwards finds no course, not a course with five lessons.
Architectural guidance
A mistyped time zone name does quiet damage: it passes unnoticed until the first student's dates are worked out, and then every release date in the course is wrong or missing. The teacher finds out from a student's email.
Acceptance criteria
Enrolling a student takes a name, an email address and a start date, and returns an access code. Enrolling two students returns two different codes, each at least 20 characters long, and neither contains the student's name, email address or start date, and the second code cannot be worked out from the first. After the program is stopped and started again, the enrolments and their codes are still there.
A start date that is not on the calendar, such as 31 Feb 2027, is refused and the message names the start date. A missing name, or an email address with no @, is refused and the message names the field. Enrolling an email address that is already enrolled in the course is refused with a message saying so, and the first student's code does not change. Nothing is saved for any refused enrolment.
Architectural guidance
A start date of 3 Mar 2027 means the start of that day in the teacher's time zone, wherever the student sits. A date that moves with the viewer's location releases lessons on the wrong day.
Architectural walkthrough
How a piano teacher runs a short online course
A piano teacher in Utrecht runs a six-week jazz chords course twice a year for about 25 students. Students pay her by bank transfer. Each lesson is a video, uploaded to a video site as unlisted, which means anyone who has the link can watch it.
Each week she used to email every student the link for their week. A lesson is released a set number of days after a student's own start date, so a student who joins in week 3 still gets week 1 first. A student's access lasts 90 days from their start date, and she can end a student's access sooner, for example after a refund.
The words this brief uses:
Lesson: one video of the course, with a place in the order.
Unlisted video: a video that has no public listing but plays for anyone who has its link.
Start date: the day a student begins the course.
Release: the moment a lesson becomes visible to a student, a number of days after their start date.
Access window: the 90 days after a student's start date in which they can watch.
Enrolment: a student's place in the course, with a start date.
Access code: the private code a student uses to see their own lessons.
Why the schedule rules come first
The teacher's trouble today starts with unwritten rules. Two correct readings of "released a week after you start" disagree on the hour a lesson appears, on whether it is visible at that exact moment or a second later, and on whether the start date is day 0 or day 1. The same questions apply to the end of the 90 day window. Left unsettled, each answer is a coin flip, and the student who loses it sees week 4 on the wrong morning.
The second failure is a course that is only partly there. If one bad lesson in a submission lets the other five through, week 5 never appears for any student, and no message tells the teacher why. She finds out when a student writes to ask where the lesson is.
The third is an access code someone else can guess. The code is all that tells the tool who is asking, so a guessable one lets a student read a stranger's lessons, including lessons that stranger has not yet reached.
Show only what is released
Produces the student's view: lessons in order, video links only for released ones, and access that stops when the window closes or the teacher ends the enrolment. Proves the release and access rules at their edges in one run. Leaves the recorded run of a whole course for Phase 3.
Acceptance criteria
The tool can answer "which lessons has this student released at this moment" for a student identified by their access code. The moment is optional and defaults to now. It can be given with its offset from UTC, for instance 2027-03-17T12:00:00+01:00 (a trailing Z means UTC and counts as an offset), and it exists for testing: without it, checking week 4 would take a month.
For the student who started on 3 Mar 2027, asking at 3 Mar 2027, 09:00, at 17 Mar 2027, 12:00 and at 7 Apr 2027, 00:00:00 gives 1, 3 and 6 released lessons. At 6 Apr 2027, 23:59:59 the answer is 5, and at 2 Mar 2027, 23:59:59, the second before the start date begins, it is 0.
Asking changes nothing: asking the same question twice gives the same answer, and asking about a later moment and then an earlier one gives the same answers as asking each on its own. A moment given without an offset, such as 2027-03-17T12:00:00, is refused with a message saying it needs an offset. An access code that does not exist gets a "not found" answer.
Architectural guidance
A student whose screen disagrees with the calendar writes to the teacher, and she is back to fixing things by hand. A lesson that is late because something did not run, or an hour early because a week was counted as 168 hours, costs the same trust. The teacher also has to check week 4 without waiting for week 4 to arrive, so the tool must be able to answer for any moment she names.
Acceptance criteria
A student who gives their access code gets every lesson in position order. For the student who started on 3 Mar 2027, asked at 12 Mar 2027, 10:00, lessons 1 and 2 come back with their title and video link. Lessons 3 to 6 come back marked as not yet released, with their title and the date they unlock (17, 24 and 31 Mar and 7 Apr 2027) and nothing else about them.
Save everything the student gets back, whether that is the page source, the response body or the command output, and search it for the video link of lesson 3, then of lessons 4, 5 and 6. None of the four is found. Hidden page elements, comments and data kept for later use count as part of what was sent, and none of them holds an unreleased link.
Asked at 2 Mar 2027, 10:00, before the start date, the same student sees all six lessons marked not yet released, with unlock dates 3, 10, 17, 24 and 31 Mar and 7 Apr 2027, and no links. An access code that does not exist gets a "not found" answer and no lessons.
Architectural guidance
A link that has reached a student's device has been sent, even if the page never shows it. Anyone can copy it from the page source or the network traffic. These videos are unlisted, so a link is a permanent address that works for anyone who holds it, and a link sent early cannot be taken back. That is what the teacher complains about today.
Acceptance criteria
For the student who started on 3 Mar 2027, asked at 1 Jun 2027, 23:59:59, all six lessons come back with links. Asked at 2 Jun 2027, 00:00:00 and at any later moment, the answer says that access has ended and holds no lessons and no links.
The teacher can end a student's enrolment by naming the student. After that, the student's code gets the "access has ended" answer at every moment you ask about, including 12 Mar 2027, 10:00, when the window was open. A second student who started on 10 Mar 2027 sees exactly what they saw before. After a restart, the ended enrolment is still ended.
Ending an enrolment that is already ended answers that it was already ended and changes nothing. Ending an enrolment for a student who does not exist gets a "not found" answer. An access code that does not exist still gets "not found", so a student can tell it apart from "access has ended".
Architectural guidance
Access ends for two different reasons: the 90 day window runs out, or the teacher ends it because the student was refunded or left. A student who still sees lessons after a refund has the course for free, and the teacher finds out when a link turns up in a group chat. A window that closes a day early takes away a day the student paid for, and one that closes a day late gives a day away. The teacher will press the end button twice, and the second press must not break anything or claim it did something.
Acceptance criteria
A person runs one command from the README and gets each case below reported by name as passed or failed, with the moment supplied by the case. For the student who started on 3 Mar 2027, the released lessons are 0 at 2 Mar 2027, 23:59:59, 1 at 3 Mar 2027, 09:00, 3 at 17 Mar 2027, 12:00, 5 at 6 Apr 2027, 23:59:59 and 6 at 7 Apr 2027, 00:00:00. At 1 Jun 2027, 23:59:59 all six lessons come back with links, and at 2 Jun 2027, 00:00:00 the answer says access has ended and holds no lessons. Everything returned at 12 Mar 2027, 10:00 is searched, and the links of lessons 3 to 6 are not found. After the teacher ends the enrolment, the student gets "access has ended" at every moment asked, and a second student who started on 10 Mar 2027 sees what they saw before. A moment given without an offset is refused. Changing one expected answer makes the run report that case as failed.
Architectural guidance
A lesson that appears an hour early, a window that closes a day late and a link that was already sent are each found by a student or in a group chat, never by the teacher. A rule that depends on the day of the week cannot be tried by waiting, so every case names its own moment.
Architectural walkthrough
The client's complaint is that links leave her hands too early. A student who opens the tool and finds week 4 while still in week 1 is the same mistake she makes by email, only faster. When the teacher moves a release day, students already enrolled must see the new date, not the one that was true on the day they joined.
A link is sent the moment it reaches the student's device, and access has to stop when the window closes or the teacher ends it.
Prove the schedule holds
Produces automated checks at the edges of the release rule and one recorded run of a whole course for three students. Adds no new behaviour.
Acceptance criteria
A set of automated checks runs with one command and passes in a few seconds, without waiting for real time and without changing the computer's clock. Each check sets up a student, supplies a moment and compares the answer with an expected answer written in the check. A moment ending in Z is in UTC.
The checks cover these moments. Release: for a student who started on 3 Mar 2027, lesson 2 (release day 7) is not released at 9 Mar 2027, 23:59:59 and is released at 10 Mar 2027, 00:00:00. Window: for the same student, lesson links are shown at 1 Jun 2027, 23:59:59 and are gone at 2 Jun 2027, 00:00:00. Late joiner: a student who starts on 24 Mar 2027 has lesson 1 released at 24 Mar 2027, 00:00:00 and nothing at 23 Mar 2027, 23:59:59, and the student who started on 3 Mar 2027 is not affected. Spring clock change: for a start date of 24 Mar 2027, lesson 2 is not released at 30 Mar 2027, 21:59:59 UTC and is released at 30 Mar 2027, 22:00:00 UTC. Autumn clock change: for a start date of 27 Oct 2027, lesson 2 is not released at 2 Nov 2027, 22:59:59 UTC and is released at 2 Nov 2027, 23:00:00 UTC.
The spring and autumn checks are written so that a tool counting every week as 168 hours fails them: it releases lesson 2 for the 24 Mar 2027 start at 30 Mar 2027, 23:00 UTC, an hour late, and lesson 2 for the 27 Oct 2027 start at 2 Nov 2027, 22:00 UTC, an hour early. The document from Phase 1 gives the same moments.
Architectural guidance
Bugs sit at the edges. On an ordinary Wednesday every version of the tool agrees, so a check in the middle of a week passes whether or not the tool gets the clock changes wrong. The version that is an hour out looks fine for most of the year and fails on one night in spring and one in autumn, when a lesson appears an hour late or an hour early. Checks that need real time to pass do not get run, so the mistake reaches students.
Acceptance criteria
Before the first run, your repository holds an expected table that you worked out by hand from the rule: for each student and each weekly date, how many lessons are released. A script then plays the whole course by supplying the moments instead of waiting, and its recorded output, committed to your repository, matches the table in every cell.
Three students: A starts on 3 Mar 2027, B on 10 Mar 2027 and C on 24 Mar 2027. The script shows what each sees at 09:00 in Europe/Amsterdam on every Wednesday from their start date. A sees 1, 2, 3, 4, 5 and 6 lessons on 3, 10, 17, 24 and 31 Mar and 7 Apr 2027, then 6 on every Wednesday through 26 May 2027, and nothing on 2 Jun 2027, when the window has closed. B sees 1, 2, 3, 4, 5 and 6 lessons on 10, 17, 24 and 31 Mar and 7 and 14 Apr 2027, then 6 on every Wednesday through 2 Jun 2027, and nothing on 9 Jun 2027. B is also asked on 3 Mar 2027, a week before the start: six lessons, none released, no links. C sees 1, 2 and 3 on 24 and 31 Mar and 7 Apr 2027. The script then ends C's enrolment, and from the 14 Apr 2027 view onward C sees nothing.
In the recorded output, the video link of lesson 6 appears only in the rows where lesson 6 is released. The README tells a reviewer how to go from a fresh clone to a comparison of the recorded run with the expected table in 10 minutes.
Architectural guidance
A table copied from the tool's own output only shows that the tool agrees with itself, so a wrong answer written into it passes. The teacher's real exposure is a whole course going out to real students, including one who joins late and one who is switched off partway. When the recorded run and the expected table differ, one of them is wrong, and a reviewer needs the README to say which and why.
Architectural walkthrough
A tool that works on an ordinary Wednesday can still fail the teacher twice a year. The moments that expose it are the second before a lesson unlocks, the second it unlocks, the last second of the 90 day window, and the week the clocks change. A check that sits on only one side of an edge misses a tool that is wrong on the other side.
The last Checkpoint compares a recorded run with a table written by hand before the first run.
Architectural walkthrough
A lesson that arrives on the wrong morning
The teacher's spreadsheet fails when someone reads it wrong. A student who joined late gets a date worked out by hand, or a student still in week 1 gets week 4. In the tool the same failure looks different: a screen that disagrees with the calendar, a lesson that appears a day early or late, or an hour out on the two nights a year the clocks change. An hour is small. It is also the difference between a lesson a student was promised at midnight and one that is missing when she opens the page.
When you check your build, ask for a student's lessons the second before a release, the second after, the last second of the 90 day window, and the week of a clock change, in both spring and autumn.
A link that has already been sent
The teacher's complaint is that links leave her hands too early, and the videos are unlisted, so a link works for anyone who holds it for as long as the video exists. A page that carries all six links and hides four has still sent the four. They can be read from the page source or the network traffic, and a forwarded copy cannot be recalled. Save everything a student receives and search it for the links of lessons that are not yet released. A single hit is the failure.
Access that does not stop
A student whose 90 days are over, or who was refunded, who can still open lessons has the course for free, and the teacher finds out when a link appears in a group chat. The same goes for a window that closes a day early or late, and for an enrolment the teacher ended that does not stay ended. Check the last second of the window, and check that an ended student sees nothing at every moment you can ask about.
A course that is only partly there
A submission with one bad lesson that saves the other five leaves a course whose week 5 never appears, with no message to say why. A guessable access code lets a student read a stranger's lessons. Both stay invisible until someone writes to the teacher. Try the bad submission and see whether any course exists afterwards, and try to work out one student's code from another's.
A check that cannot fail
The expected table in the last Phase is the one thing in the build that does not come from your tool. A table copied from the tool's output agrees with the tool whether or not either is right. Write it by hand from the rule before you run anything, and treat any difference between the table and the run as a finding about one of them.
Where it shows if you cut a corner
Four symptoms show a cut corner. A lesson that is missing at midnight in the week of a clock change, or present the second before its release, means the day was counted in hours or in the wrong time zone. A search of everything a student received that finds the link of an unreleased lesson means the page hides links it has already sent. A student at the end of the 90 day window, or with an ended enrolment, who can still open a lesson means access is checked at the wrong moment or not at all. A refused submission that leaves a course with five of its six lessons, or a code that can be worked out from another student's, means the save is partial or the codes follow a pattern.