From a0d62a8cc830a1a8987366ae846b29a4d350f05a Mon Sep 17 00:00:00 2001 From: Ilenia M Date: Wed, 11 Mar 2026 20:40:23 +0100 Subject: [PATCH 01/21] docs: add MD file templates to workshops, labs, quizzes, and reviews guides --- src/content/docs/how-to-work-on-labs.mdx | 54 ++++++++++++++++ src/content/docs/how-to-work-on-quizzes.mdx | 51 +++++++++++++++ src/content/docs/how-to-work-on-reviews.mdx | 62 +++++++++++++++++++ src/content/docs/how-to-work-on-workshops.mdx | 54 ++++++++++++++++ 4 files changed, 221 insertions(+) diff --git a/src/content/docs/how-to-work-on-labs.mdx b/src/content/docs/how-to-work-on-labs.mdx index 07147ca3..49b64470 100644 --- a/src/content/docs/how-to-work-on-labs.mdx +++ b/src/content/docs/how-to-work-on-labs.mdx @@ -39,3 +39,57 @@ For the labs that do not have a demo project, the solution can be the minimum ne The labs that have a demo project have a `demoType` property in the frontmatter with a value of `onClick`, the labs that do not have a demo project do not have a `demoType` project. The metadata for labs require a `blockLabel` property with a value of `lab`, and a `blockLayout` with a value of `link`. + +## Lab File Template + +Each lab is a single Markdown file. The `challengeType` and seed language depend on the type of lab: + +| `challengeType` | Lab type | Seed language(s) | Solution language(s) | +| --------------- | ----------------- | ----------------------------------------- | -------------------- | +| `25` | HTML/CSS(/JS/JSX) | `html` + `css`, or + `js`, or + `jsx` | same combination | +| `26` | JavaScript | `js` | `js` | +| `27` | Python | `py` | `py` | +| `13` | Bash/SQL/etc. | no seed — runs via a CodeRoad `url` field | none | + +`saveSubmissionToDB: true` is only present in cert-project labs. + +Here is the template for a JavaScript lab: + +````md +--- +id: +title: Build / Implement / Design / Debug [Name] +challengeType: 26 +dashedName: lab-name +--- + +# --description-- + +**Objective:** Fulfill the user stories below and get all the tests to pass to complete the lab. + +**User Stories:** + +1. ... + +# --hints-- + +Description of what the test checks. + +```js +// test code +``` + +# --seed-- + +## --seed-contents-- + +```js + +``` + +# --solutions-- + +```js +// solution code +``` +```` diff --git a/src/content/docs/how-to-work-on-quizzes.mdx b/src/content/docs/how-to-work-on-quizzes.mdx index c19456f4..116f88f0 100644 --- a/src/content/docs/how-to-work-on-quizzes.mdx +++ b/src/content/docs/how-to-work-on-quizzes.mdx @@ -150,6 +150,57 @@ developer[2]; ``` ```` +## Quiz File Template + +Each quiz is a single Markdown file. The `### --question--` block is repeated once per question — 10 or 20 times per `## --quiz--` set. A quiz file can contain multiple sets of questions, each introduced by a new `## --quiz--` header within the same `# --quizzes--` section. + +```md +--- +id: +title: [Topic] Quiz +challengeType: 8 +dashedName: quiz-topic-name +--- + +# --description-- + +To pass the quiz, you must correctly answer at least 18 of the 20 questions below. + +# --quizzes-- + +## --quiz-- + +### --question-- (repeated 10 or 20 times) + +#### --text-- + +Question text + +#### --distractors-- + +Wrong answer 1 + +--- + +Wrong answer 2 + +--- + +Wrong answer 3 + +#### --answer-- + +Correct answer + +## --quiz-- + +### --question-- (another full set of 10 or 20 questions, same structure as above) + +#### --text-- + +... +``` + ## Acceptable Resources to Use for Creating Questions If you need help creating questions, then you can look through a few of the existing quizzes in the certification. diff --git a/src/content/docs/how-to-work-on-reviews.mdx b/src/content/docs/how-to-work-on-reviews.mdx index 3d01b059..5aa75d5d 100644 --- a/src/content/docs/how-to-work-on-reviews.mdx +++ b/src/content/docs/how-to-work-on-reviews.mdx @@ -35,3 +35,65 @@ The metadata for reviews require a `blockLabel` property with a value of `review Reviews use a `challengeType` of 31. Reviews have a dashedName with `review-topic`, and titles of the reviews are like `Topic Review`. + +## Review File Template + +Each review is a single Markdown file. The content section uses either `# --interactive--` or `# --description--` depending on whether the review includes interactive code editors. + +Use `# --interactive--` when the review includes `:::interactive_editor` blocks that campers can run directly: + +````md +--- +id: +title: [Topic] Review +challengeType: 31 +dashedName: review-topic-name +--- + +# --interactive-- + +## Section Heading + +- **concept**: explanation + +```js +// optional static code example +``` + +:::interactive_editor + +```js +// interactive code example campers can run +``` + +::: + +# --assignment-- + +Review the [topic] topics and concepts. +```` + +Use `# --description--` when the review only contains static markdown content: + +````md +--- +id: +title: [Topic] Review +challengeType: 31 +dashedName: review-topic-name +--- + +# --description-- + +## Section Heading + +- **concept**: explanation + +```bash +# optional code example +``` + +# --assignment-- + +Review the [topic] topics and concepts. +```` diff --git a/src/content/docs/how-to-work-on-workshops.mdx b/src/content/docs/how-to-work-on-workshops.mdx index bfa31da5..6cf478ad 100644 --- a/src/content/docs/how-to-work-on-workshops.mdx +++ b/src/content/docs/how-to-work-on-workshops.mdx @@ -213,6 +213,60 @@ The script is to be used if the step-based project has files that have challenge pnpm run rename-challenges ``` +## Step File Template + +Each step in a workshop is a Markdown file named after its challenge `id`. The `challengeType` and seed language depend on the type of workshop: + +| `challengeType` | Workshop type | Seed language(s) | +| --------------- | ------------- | -------------------------------------------------------------- | +| `0` | HTML/CSS | `html` only, or `html` + `css`, or `html` + `css` + `js`/`jsx` | +| `1` | JavaScript | `js` | +| `20` | Python | `py` | +| `12` | Bash/SQL/etc. | no seed — the workshop runs via a CodeRoad `url` field | + +All step files use `--fcc-editable-region--` markers in the seed to highlight where campers should make changes. Only the last step requires a `# --solutions--` section. + +Here is the template for a JavaScript workshop step: + + +````md +--- +id: +title: Step N +challengeType: 1 +dashedName: step-n +--- + +# --description-- + +Step description in markdown. + +# --hints-- + +Description of what the test checks. + +```js +// test code +``` + +# --seed-- + +## --seed-contents-- + +```js +// seed code +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +// solution code (only required for the last step) +``` +```` + ## Proposing a Pull Request (PR) After you've committed your changes, check here for [how to open a Pull Request](/how-to-open-a-pull-request/). From 6ccb4dfd948262a6992cbfe7fcef15b75b461139 Mon Sep 17 00:00:00 2001 From: Ilenia M Date: Wed, 11 Mar 2026 21:14:38 +0100 Subject: [PATCH 02/21] docs: add demoType to workshop step template --- src/content/docs/how-to-work-on-workshops.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/content/docs/how-to-work-on-workshops.mdx b/src/content/docs/how-to-work-on-workshops.mdx index 6cf478ad..d9875b21 100644 --- a/src/content/docs/how-to-work-on-workshops.mdx +++ b/src/content/docs/how-to-work-on-workshops.mdx @@ -226,6 +226,8 @@ Each step in a workshop is a Markdown file named after its challenge `id`. The ` All step files use `--fcc-editable-region--` markers in the seed to highlight where campers should make changes. Only the last step requires a `# --solutions--` section. +The `demoType: onLoad` field is only present in the first step of workshops that have a demo project. + Here is the template for a JavaScript workshop step: @@ -235,6 +237,7 @@ id: title: Step N challengeType: 1 dashedName: step-n +demoType: onLoad --- # --description-- From 33fc755e3681407e95a7000fb7e196363d966b02 Mon Sep 17 00:00:00 2001 From: Ilenia M Date: Wed, 11 Mar 2026 21:16:08 +0100 Subject: [PATCH 03/21] docs: clarify demoType is only for HTML-based challenges with demo --- src/content/docs/how-to-work-on-labs.mdx | 3 ++- src/content/docs/how-to-work-on-workshops.mdx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/content/docs/how-to-work-on-labs.mdx b/src/content/docs/how-to-work-on-labs.mdx index 49b64470..e5389d5a 100644 --- a/src/content/docs/how-to-work-on-labs.mdx +++ b/src/content/docs/how-to-work-on-labs.mdx @@ -36,7 +36,7 @@ All labs have a solution, but not all labs have a demo project. For the labs that do not have a demo project, the solution can be the minimum necessary to make sure the tests are working correctly. ::: -The labs that have a demo project have a `demoType` property in the frontmatter with a value of `onClick`, the labs that do not have a demo project do not have a `demoType` project. +Labs that have a visual output (i.e. HTML-based) can have a demo project, in which case the frontmatter includes `demoType: onClick`. It is not mandatory even for HTML labs. The metadata for labs require a `blockLabel` property with a value of `lab`, and a `blockLayout` with a value of `link`. @@ -61,6 +61,7 @@ id: title: Build / Implement / Design / Debug [Name] challengeType: 26 dashedName: lab-name +demoType: onClick --- # --description-- diff --git a/src/content/docs/how-to-work-on-workshops.mdx b/src/content/docs/how-to-work-on-workshops.mdx index d9875b21..4140c3e1 100644 --- a/src/content/docs/how-to-work-on-workshops.mdx +++ b/src/content/docs/how-to-work-on-workshops.mdx @@ -226,7 +226,7 @@ Each step in a workshop is a Markdown file named after its challenge `id`. The ` All step files use `--fcc-editable-region--` markers in the seed to highlight where campers should make changes. Only the last step requires a `# --solutions--` section. -The `demoType: onLoad` field is only present in the first step of workshops that have a demo project. +The `demoType: onLoad` field is only present in the first step, and only for workshops that have a visual output (i.e. HTML-based). It is not mandatory even for those. Here is the template for a JavaScript workshop step: From c8562eaa0ff422fbec1e68786ac276abb2597da1 Mon Sep 17 00:00:00 2001 From: Ilenia M Date: Thu, 12 Mar 2026 10:21:32 +0100 Subject: [PATCH 04/21] docs: add hooks section to labs and workshops guides Documents --before-all--, --before-each--, --after-each--, and --after-all-- hooks: which challengeTypes support them, execution order, and how DOM challenges (iframe) differ from non-DOM challenges (Web Worker). --- src/content/docs/how-to-work-on-labs.mdx | 73 +++++++++++++++++++ src/content/docs/how-to-work-on-workshops.mdx | 73 +++++++++++++++++++ 2 files changed, 146 insertions(+) diff --git a/src/content/docs/how-to-work-on-labs.mdx b/src/content/docs/how-to-work-on-labs.mdx index e5389d5a..6c915ddf 100644 --- a/src/content/docs/how-to-work-on-labs.mdx +++ b/src/content/docs/how-to-work-on-labs.mdx @@ -94,3 +94,76 @@ Description of what the test checks. // solution code ``` ```` + +## Hooks + +Hooks are optional code blocks that run at specific points during test execution. They can be used to set up shared state, install fake timers, or clean up after tests. + +Hooks are supported for lab types `25`, `26`, and `27`. + +Four hooks are available: + +| Hook | When it runs | +| ----------------- | ------------------------------------------------------------------------------------------- | +| `--before-all--` | Once, before any test runs | +| `--before-each--` | Before each individual test | +| `--after-each--` | After each individual test (in a `finally` block, so it always runs even if the test fails) | +| `--after-all--` | Once, after all tests have finished | + +**Execution order:** + +``` +--before-all-- (once) + ↓ + For each test: + --before-each-- → test → --after-each-- + ↓ +--after-all-- (once) +``` + +**DOM vs non-DOM labs:** + +For HTML/CSS labs (`challengeType: 25`), `--before-all--` is injected as a ` +``` + +```css +/* CSS styles */ +``` + +```js +// JavaScript code +``` + +::: +```` + Use `# --description--` when the review only contains static markdown content: ````md From 66bbe4eed266ecf0d6bf901aa4bce984d754179b Mon Sep 17 00:00:00 2001 From: majestic-owl448 <26656284+majestic-owl448@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:51:37 +0100 Subject: [PATCH 17/21] Apply suggestions from code review --- src/content/docs/how-to-work-on-reviews.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/how-to-work-on-reviews.mdx b/src/content/docs/how-to-work-on-reviews.mdx index bf9b10f1..e2a61b04 100644 --- a/src/content/docs/how-to-work-on-reviews.mdx +++ b/src/content/docs/how-to-work-on-reviews.mdx @@ -75,7 +75,7 @@ dashedName: review-topic-name Review the [topic] topics and concepts. ```` -For HTML/CSS/JS examples, include all three file types inside the same `:::interactive_editor` block. The HTML file must explicitly link to the CSS and JS files — they are not linked automatically: +For CSS and JS examples, include the HTML file inside the same `:::interactive_editor` block. The HTML file must explicitly link to the CSS and/or the JS files — they are not linked automatically: ````md :::interactive_editor From 40e4bab1d7ece00a676d0534ce9106d82550f8d3 Mon Sep 17 00:00:00 2001 From: majestic-owl448 <26656284+majestic-owl448@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:52:46 +0100 Subject: [PATCH 18/21] Apply suggestions from code review --- src/content/docs/how-to-work-on-reviews.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/how-to-work-on-reviews.mdx b/src/content/docs/how-to-work-on-reviews.mdx index e2a61b04..4b25ea27 100644 --- a/src/content/docs/how-to-work-on-reviews.mdx +++ b/src/content/docs/how-to-work-on-reviews.mdx @@ -75,7 +75,7 @@ dashedName: review-topic-name Review the [topic] topics and concepts. ```` -For CSS and JS examples, include the HTML file inside the same `:::interactive_editor` block. The HTML file must explicitly link to the CSS and/or the JS files — they are not linked automatically: +For CSS and JS examples, include the HTML file inside the same `:::interactive_editor` block. The HTML file must explicitly link to the CSS and/or the JS files, they are not linked automatically: ````md :::interactive_editor From 5e980d346df0d43c0aef87e8e6016280f6c085ad Mon Sep 17 00:00:00 2001 From: Ilenia M Date: Fri, 13 Mar 2026 16:45:30 +0100 Subject: [PATCH 19/21] docs: clarify before-all scoping in non-DOM challenges Variables declared in --before-all-- are not in scope during isolated tests. State must be assigned to globalThis to persist across tests. --- src/content/docs/_hooks-shared.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/_hooks-shared.mdx b/src/content/docs/_hooks-shared.mdx index 3ce7fadc..7a12cb4a 100644 --- a/src/content/docs/_hooks-shared.mdx +++ b/src/content/docs/_hooks-shared.mdx @@ -22,7 +22,7 @@ for each test: --after-all-- ``` -For challenges that do not have an HTML file, `--before-all--` runs once before any test. User code is then re-evaluated as part of each individual test (concatenated with `--before-each--` and the test in a single `eval`): +For challenges that do not have an HTML file, `--before-all--` runs once before any test. However, because user code is re-evaluated as part of each individual test (concatenated with `--before-each--` and the test in a single `eval`), variables declared in `--before-all--` will not be in scope during tests. To share state across tests, assign to the global object directly (e.g. `globalThis.x = 1` instead of `let x = 1`): ``` --before-all-- (once) From 529d7906b902c6c75c61a93d8d60bc793c6cf421 Mon Sep 17 00:00:00 2001 From: majestic-owl448 <26656284+majestic-owl448@users.noreply.github.com> Date: Fri, 13 Mar 2026 17:25:23 +0100 Subject: [PATCH 20/21] Apply suggestions from code review Co-authored-by: Oliver Eyton-Williams --- src/content/docs/_hooks-shared.mdx | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/content/docs/_hooks-shared.mdx b/src/content/docs/_hooks-shared.mdx index 7a12cb4a..9517401f 100644 --- a/src/content/docs/_hooks-shared.mdx +++ b/src/content/docs/_hooks-shared.mdx @@ -12,25 +12,23 @@ Four hooks are available: For challenges that have an HTML file, `--before-all--` is injected as a `