Skip to content

Build a Course Shop for a Small Studio

Davor Minchorov•Intermediate•8 to 9 weekends•October 29, 2026

A three-person training studio sells seven spreadsheet courses from a shop that told 19 learners who had already passed that they had failed, after the owner raised a pass mark. You will build the replacement, from a published course version and a video that must be ready, through payment, refunds, watching rights, quizzes and certificates. You will prove it with a newsletter day in which payments arrive late, video reports repeat, phones upload hours late and the pass mark changes halfway.

The brief

The client

I run a three-person studio that teaches financial modelling in spreadsheets to accountants and analysts. We sell seven courses, about 350 people enrol each month, and every lesson is a video on a hosting service we pay for.

When I raised the pass mark on our pivot tables course from 60 to 75 percent, the site marked everyone again. 19 people who had already passed got an email saying they had failed, and their certificates stopped verifying. A lesson I published showed "processing" for two days, and I could not tell whether the host's encode had failed or its message was late.

The same month a payment confirmation reached us three hours after the buyer paid, so the buyer paid a second time. A learner I had refunded kept watching for weeks, because I had unticked a box on the course and not on their account. I need to answer "why can this person watch, and have they finished?" with something better than "the page says so", and I need a pass mark change to leave past results alone.

The problem

The shop keeps one answer per learner and course for access and another for completion. The checkout script sets access, a refund script clears it, the owner sets it by hand in the admin page, and the video page reads it. Nobody can tell which change came last or why. Completion is a percentage recalculated from the course as it stands today, so adding a lesson lowers every enrolled learner's progress. A quiz is judged against the current pass mark, so a changed pass mark rewrites results that were already recorded.

Two outside parties add timing the shop does not control. The payment provider confirms a payment when it chooses, sometimes late and sometimes twice, and a buyer who sees no access pays again. The video host reports that a video is ready or failed through a message that can arrive late, twice, or for a video nobody uploaded, so a lesson flips between "ready" and "processing" and nobody can say whether the encode failed or the notification was late. A learner who skips to the end of every video reaches 100 percent, and a phone that reports progress hours late can overwrite what the laptop already saved.

The cost was 19 wrongly failed learners and an apology email, one duplicate charge refunded by hand, a refunded learner who watched for weeks, and an owner who spent two evenings finding out why.

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 studio draft a course of video lessons with a final quiz and publish it as a version that never changes afterwards.
  • Accept a lesson video, show a plain reason when the host cannot use it, and publish a version only when every video in it is ready.
  • Let a learner buy a course at the version's price through the provider's hosted payment page, and open the course within seconds of the confirmation, even when the confirmation arrives late or twice.
  • Refund a purchase within 14 days of payment under the refund rule that was in force when the learner paid, exactly once. The window is the studio's own guarantee: the legal EU right of withdrawal lapses once a buyer asks for immediate access.
  • Decide at the moment of a playback request whether the learner may watch, stop a refunded learner from starting a new playback, and say why for any learner at any past moment.
  • Email the learner once when a course is ready and once when an order is refunded.
  • Record what a learner watched from a laptop and a phone, late and sometimes twice, and count a lesson as complete only when 90 percent of its length has been watched.
  • Run quizzes with an attempt limit, a passing score and a time limit judged on the shop's clock, and change a passing score without changing any recorded result.
  • Issue a certificate with a public verification code when, and only when, the learner has completed the course. Show it as revoked after a refund.
  • Erase a learner's name and email on request, keeping orders, access, progress, attempts and certificate records identified by ID.
  • Check with one command that every paid order has access or a refund, that no certificate exists without a completion, and that the access and completion the shop reports equal what the rules conclude when worked out independently.

Deliverables

  • Your repository starts the shop, the two stand-ins, the devices script, the newsletter-day simulator and a mailbox that catches every email the shop sends, each with one documented command, plus seven courses ready to sell.
  • A README that takes a reviewer from a fresh clone to a bought, refunded and certified course and the shop check report in 20 minutes, and lists the command for each test.
  • A sheet of the studio's rules with every example worked by hand, written before the shop.
  • A test suite for every Checkpoint. A test that needs two requests at the same moment must be able to fail against a build that handles them one after the other.
  • A way to run the studio's day faster than real time: a clock you can move for the shop and each stand-in, and a way to make the video host and the payment provider report late, twice, out of order and for something nobody ordered, and to make a refund fail once.
  • The order-independence result and the report of the final newsletter day, both committed to your repository.
  • A short operations note covering what the studio can do and see: why a video is not usable, which host reports and provider messages the shop could not match, why a learner could watch at a past moment, which paid orders have no access and how to fix them, and which refunds are waiting to be sent.

Out of scope

  • Cohorts, seat limits and seat holds. The studio sells self-paced courses only.
  • Instructor payouts, revenue share and a ledger. The owner pays the co-instructor by hand from a sales report, and a statement that traces every cent is a different brief's subject.
  • Disputes and chargebacks. They need evidence deadlines, a second money flow and a block on refunds.
  • Taking a lesson down after a rights notice. It cascades into refunds, access and payouts, and the studio has not decided what should happen to each.
  • VAT by customer country, the withdrawal waiver and tax reports. Their rules need legal input and a tax table the studio has not given. Prices are tax-inclusive and the shop records one amount in euro cents.
  • Coupons, bundles and subscriptions. Each adds a price rule the studio does not use.
  • Moving a learner to a newer course version. A learner stays on the version they bought, and a test in the fifth Phase proves nothing moves them by accident.
  • Quiz question types beyond single-choice, and text or download lessons. The pass mark, attempt limit and time limit are the point, not the question bank.
  • SCORM, xAPI and LTI. They solve packaging and launching courses inside other systems, which is not this client's problem.
  • Real video transcoding, copy protection, watermarking and a player front end. You build a video host stand-in and a script that plays the browser. A viewing address that expires is as far as protection goes.
  • Learners under 16. Their consent rules need legal input, so sign-up asks for an adult confirmation and stops there.
  • Collecting card data. The payment provider stand-in offers a hosted payment page.
  • Learner and studio sign-in. The studio proves itself with one secret key and a learner is named by their learner ID, so do not put this shop on the internet.
  • Deploying anywhere but the reviewer's machine, including containers and cloud hosting.
  • Deleting orders and access records on a schedule. The studio is Dutch and has to keep its business records for 7 years, or 10 years for sales reported under the EU One Stop Shop VAT scheme, so the shop deletes nothing by age. Erasure happens on request only.

Architectural constraints

  • Prices and refunds are exact to the cent in euros, video lengths are whole seconds and scores are whole percent, rounded down. Times in answers are UTC with milliseconds and are shown to people in Europe/Amsterdam.
  • No card number is ever stored or logged. The learner pays on the provider's page.
  • A published course version, and the refund rule in force on a given day, never change. A change creates a new one, and each purchase, attempt and refund is judged under the one in force when it happened.
  • For any learner and any past moment, the shop says why the learner could or could not watch and whether they had finished. A script or a person changing one thing by hand cannot silently decide either answer, and the same history gives the same answer in whatever order the messages arrived.
  • Things are judged on when they happened, not on when a message arrived. The quiz deadline and the refund window are judged on the shop's clock, never on a device's.
  • Receiving the same provider or host message twice changes nothing the second time. Anything interrupted by a crash is finished once after the restart, never lost and never done twice.
  • Money is never refunded twice, a version number is never given twice, and a quiz never allows an attempt beyond its limit, even when two requests arrive at the same moment.
  • After an erasure request the learner's name and email appear nowhere the shop stores data, holds mail or other work waiting to go out, or writes logs. Mail already sent stays in the mailbox. Orders, payments, access, progress, attempts and certificates stay, identified by ID.

Prerequisites

You have built one application with a database, in any language and framework. You do not need distributed systems experience, and you do not need to know how a course studio sells its courses; the first Phase explains the business and the words the brief uses, then works the rules out by hand. Two parts are harder than the rest: counting watched seconds when reports overlap, and tests that move a clock. The first Phase works the cases out by hand before you write the shop.

Create a free accountSign in

Free to start. An account is what keeps track of the checkpoints you finish.

Phase 1

Work out the rules and control the clock

Produces a worked sheet of the studio's rules with the answer to every example the shop will be judged on, and a shop that starts with one command and runs on a clock you can move. Leaves every business behaviour for later: nothing can be drafted, bought or watched yet.

Research

Implementation

Architectural walkthrough

How a course studio sells its courses

The studio records each lesson as a video and groups the lessons into a course with a quiz at the end. Each video goes to a video host: a company that stores it, converts it so it plays on any screen, and reports back when it is ready or when the conversion failed. The conversion takes a while, so a new lesson waits for that report before anyone can watch it.

A learner buys a course on a payment page run by a payment provider. The provider takes the card payment and later sends the shop a message saying the payment went through. The learner then watches the lessons on a laptop or a phone and takes the quiz. A learner who has watched the lessons and passed the quiz gets a certificate, and anyone they show it to, an employer for example, can check that it is real.

In a normal month about 350 people enrol across the studio's seven courses, with a rush in the hour after a newsletter goes out. The owner now and then publishes a new or changed lesson, answers refund requests, and changes a lesson or a pass mark when a course needs it.

The words this brief uses:

  • Course version: the course as it was published at a given moment. A change creates a new version, and a learner stays on the version they bought.

  • Pass mark: the lowest quiz score that passes, in percent.

  • Refund window: how long after paying a learner may ask for their money back. Here it is the studio's own promise, not a legal right.

  • Payment confirmation: the provider's message that a payment went through. It can arrive late or twice.

  • Host report: the video host's message that a video is ready or has failed.

  • Viewing address: the link that plays one lesson, valid for a short time.

  • Verification code: the code a stranger uses to check a certificate.

  • Erasure: removing a learner's name and email when they ask, which the GDPR gives them the right to do.

Why the rules come first

The studio's trouble began with rules that lived only inside the old shop. Nobody could say what a recorded quiz score should mean once the pass mark changed, so the shop decided for itself and told 19 learners who had passed that they had failed. This Phase makes you write the rules down with numbers before any of them is code.

The boundaries are the expensive part. A refund request at 10:00:00 on the last day is accepted and one second later is refused. A lesson of 473 seconds is finished at 426 seconds watched and not at 425. A learner who skips to the last minute of every video has watched one minute. A member who first meets these as a failing test ends up arguing with the test instead of with the rule, and a test written by the same person who wrote the shop agrees with the shop even when both are wrong. Answers worked out by hand, before the shop exists, give you something to check it against.

The clock is the other problem. The refund window is 14 days, the quiz allows 20 minutes, a viewing address lasts 30 minutes, and a payment confirmation can arrive three hours late. A test that waits for any of those takes days or never runs, and a test that reads the machine's time passes on some days and fails on others. Nothing in the later Phases can be checked until the shop's time is something you set.

Phase 2

Publish a course version that never changes

Produces drafting, a video host stand-in that you build, a rule that a video must be usable before it is published, and published course versions that stay exactly as published. Leaves selling, access and learning for later: nothing can be bought or watched yet.

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

Two things go wrong here. The first is the video host. It tells the shop that a video is ready or has failed by calling back, and it keeps calling until the shop answers. It also calls late, calls out of order, and sometimes calls about a video nobody uploaded. The client's lesson that showed "processing" for two days is what a shop looks like when it treats the latest call to arrive as the truth about the video. The studio could not tell whether the encode had failed or the message was late, and learners clicked a lesson that never played.

The second is a published course that changes under the people who bought it. When the owner raised a pass mark from 60 to 75, the shop applied it to learners who had already finished, and 19 of them were told they had failed. A published version has to stay exactly as it was published, and a change has to become a new version that only new buyers get.

You build the video host stand-in yourself, because a real host will not send a duplicate or reversed message when you ask. A failure you can cause on demand can be fixed and tested again. A failure you wait for cannot.

Phase 3

Sell and refund a course

Produces a payment provider stand-in that you build, purchases at the price the learner was shown, orders that settle correctly whatever order the provider's messages arrive in, and refunds judged under the rule in force when the learner paid. Leaves access and learning for later: a paid order opens nothing yet.

Implementation

Implementation

Testing

Implementation

Testing

Architectural walkthrough

The provider decides when it tells the shop about a payment. In the client's story a confirmation reached the shop three hours after the buyer paid. The buyer saw nothing, paid a second time, and the studio refunded 79 euros by hand. A shop that sets an order to paid when a message arrives cannot tell which of two payments came first, and it keeps the wrong one.

Messages from the provider can also be forged. Anyone who can reach the shop's address can post "payment succeeded" for a course, and anyone who captured a genuine message can send it again next week. The provider signs each message, so a shop that does not check the signature sells courses for nothing.

Refunds add three more failures. The studio promised a learner 14 days, and a window that follows whatever rule applies today breaks that promise the day the studio changes the rule. Two refund requests at the same moment, or a retry after the provider failed once, can send the learner 79 euros twice. A process that dies after accepting a refund request and before telling the provider leaves a learner who was promised money and a studio that does not know it owes it.

Phase 4

Decide who may watch

Produces learners, access that opens on payment and ends on refund, a plain answer to why a learner may or may not watch, and short-lived viewing addresses. Leaves watching progress, quizzes and certificates for later: nothing is measured or assessed yet.

Implementation

Implementation

Implementation

Testing

Testing

Architectural walkthrough

In the old shop a learner who was refunded kept watching for weeks. The checkout set an answer, the refund routine cleared it, the owner edited it by hand and the video page read it, so nobody could say which change came last or why. When the owner asked why a learner could watch, the shop had no answer. The cost was weeks of free access and two evenings spent finding out why.

The failure to survive is that access disagrees with the money. Access must open once when a payment is counted, whatever order the provider's messages arrived in, and must end when a refund is counted. A buyer who paid twice must keep the access of the payment that happened first. A learner must be able to start watching only while their access is live, and the studio must be able to say what it knew about a learner at a past moment, because a confirmation that arrives three hours late makes what was true and what the shop knew differ.

A viewing address that has already been issued keeps playing until it expires, and a process can die after a payment is saved and before the learner is told.

Phase 5

Track and assess

Produces watched time from several devices, lesson completion from time actually watched, and quiz attempts judged on the shop's clock. Leaves certificates, erasure and the whole-shop proof for later: finishing a course issues nothing yet.

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

The pass mark on a course went from 60 to 75 percent, the old shop judged every recorded quiz against the new number, and 19 learners who had passed were told they had failed. A result is a fact about what happened under the rule the learner was on, and it has to stay what it was when the rule changes. The same goes for lessons: adding a ninth lesson to a course must not lower the progress of someone who finished eight.

Progress arrives from devices the studio does not control. A laptop reports every 15 seconds. A phone watches offline and reports hours later, sometimes twice. A phone report that arrives late must not overwrite where the laptop already got to, and a learner who skips to the end of every video must not count as having watched it.

Two learners can also ask for the last quiz attempt at the same moment, and a learner's laptop clock can say it is 10:05 when the shop says 10:20. A shop that trusts the learner's device lets a fourth attempt through and lets a late answer count. Every test in this Phase sets the shop's clock instead of waiting.

Phase 6

Certify and prove

Produces certificates with a public verification code, revocation on refund, learner erasure, and a newsletter-day run that checks the whole shop. Leaves taking a lesson down, payouts and disputes out of the brief.

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

A certificate is a claim a stranger can check. A stranger types a code into a public page and learns whether the studio vouches for the person. A certificate issued for a course that was never completed is a false claim, and a false claim cannot be recalled quietly. A certificate that vanishes after a refund tells the stranger nothing, where "revoked" tells them the studio withdrew it. The page cannot be wrong in either direction.

Completion and refund can reach the shop in either order. A phone report that finishes the last lesson may arrive after the learner was refunded, and the shop must end in the same place whichever it handles first. A process that dies between completing a course and issuing the certificate leaves a learner who passed with nothing to show, and nobody notices until they write.

The page also shows a name, and a name is personal data. The learner can ask for it to be erased, and the orders, payments, progress and certificates that the studio has to keep must still make sense afterwards. The last Checkpoint puts all of it together on a newsletter day, when payments arrive late, host reports repeat, phones upload hours late and the pass mark changes halfway.

Architectural walkthrough

One answer that nobody can explain

The old shop kept a single answer for whether a learner could watch, and every part of the business wrote to it. The checkout set it, the refund routine cleared it, the owner edited it by hand, and the video page read it. When the studio asked why a refunded learner kept watching for weeks, the shop had no answer, because an answer that gets overwritten says nothing about who wrote it last or why. Each failure in the client's story traces back to that. The check on your own build is whether you can say, for any learner, why they can watch now and why they could at 12:00 last Tuesday.

Rules that change must not rewrite the past

The owner raised a pass mark from 60 to 75 and the shop judged every recorded quiz again. 19 learners who had passed were told they had failed and their certificates stopped verifying. A learner who bought under a 14-day refund rule was promised 14 days, and a window that follows whatever rule applies today breaks that promise the day the studio changes it. Adding a lesson to a course must not lower the progress of a learner who finished the old one. In your build, raise the pass mark, add a lesson and change the refund rule, and check that no learner who bought earlier sees a different result.

Outside parties are late, repeat themselves and arrive out of order

A payment confirmation reached the studio three hours after the buyer paid. The buyer saw nothing, paid a second time, and the studio refunded 79 euros by hand. The video host calls back until it gets an answer, so the same report arrives twice, and sometimes a failure that happened earlier arrives after a ready report. One lesson showed "processing" for two days because the shop took whichever message came last as the truth. A message can also be forged, or a genuine one can be sent again later. In your build, send every message twice, late, reversed and altered, and check that the learner, the studio and the money all end up in the same place.

Two people at the same moment

Two refund requests for one purchase, two publishes of one draft, and two requests for a learner's last quiz attempt can all arrive in the same instant. Each request looks fine on its own, and both succeed. The studio would refund 79 euros twice, two groups of buyers would hold different pass marks under one version number, and a learner would get a fourth attempt. A test that sends the two requests one after the other passes against all of these, so your tests have to be able to fail.

The process dies in the middle

A process can die after a payment is saved and before the learner is told. The buyer has paid, sees no access, and nobody finds out until they write. The reverse is quieter: a refund is saved, access is not ended, and the learner keeps watching. A learner can finish a course and never receive the certificate. None of these leaves an error behind. In your build, stop the shop at each of those moments, start it again, and check that nothing is lost and nothing is done twice.

What a refund really costs

A viewing address that was issued before a refund keeps playing until it expires. The studio cannot take it back, so the length of the address is the longest a refunded learner can keep watching, and the studio has to be told the number.

Where it shows if you cut a corner

Four symptoms show a cut corner. A refunded learner keeps watching, and the studio cannot say who wrote the answer last. A raised pass mark tells learners who passed at 60 that they failed at 75. A buyer pays twice because a confirmation came three hours late, and the studio refunds 79 euros by hand. Two refund requests for one purchase return 79 euros twice.