From d99a2bbf98c7cd637d95f3b168870585f817b7f3 Mon Sep 17 00:00:00 2001 From: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> Date: Sat, 21 Jun 2025 00:31:59 -0700 Subject: [PATCH] feat(curriculum): adding Debug a Pet Adoption Page lab (#60917) --- client/i18n/locales/english/intro.json | 19 +++- .../lab-debug-pet-adoption-page/index.md | 9 ++ .../index.md | 9 ++ .../index.md | 9 ++ .../lecture-what-is-html/index.md | 9 -- .../lab-debug-pet-adoption-page/meta.json | 11 +++ .../meta.json | 19 ++++ .../meta.json | 20 ++-- .../685239f0cad43c7a909cbd98.md | 98 +++++++++++++++++++ .../66f6db08d55022680a3cfbc9.md | 0 .../6708143cab2b583ecd3324f5.md | 0 .../670838977810401844af6fe0.md | 0 .../670838e914096b194b0c51aa.md | 0 .../670839051794aa19fcef6dc8.md | 0 .../superblock-structure/full-stack.json | 8 +- e2e/super-block-page.spec.ts | 6 +- 16 files changed, 187 insertions(+), 30 deletions(-) create mode 100644 client/src/pages/learn/full-stack-developer/lab-debug-pet-adoption-page/index.md create mode 100644 client/src/pages/learn/full-stack-developer/lecture-understanding-html-attributes/index.md create mode 100644 client/src/pages/learn/full-stack-developer/lecture-understanding-the-html-boilerplate/index.md delete mode 100644 client/src/pages/learn/full-stack-developer/lecture-what-is-html/index.md create mode 100644 curriculum/challenges/_meta/lab-debug-pet-adoption-page/meta.json create mode 100644 curriculum/challenges/_meta/lecture-understanding-html-attributes/meta.json rename curriculum/challenges/_meta/{lecture-what-is-html => lecture-understanding-the-html-boilerplate}/meta.json (60%) create mode 100644 curriculum/challenges/english/25-front-end-development/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md rename curriculum/challenges/english/25-front-end-development/{lecture-what-is-html => lecture-understanding-html-attributes}/66f6db08d55022680a3cfbc9.md (100%) rename curriculum/challenges/english/25-front-end-development/{lecture-what-is-html => lecture-understanding-html-attributes}/6708143cab2b583ecd3324f5.md (100%) rename curriculum/challenges/english/25-front-end-development/{lecture-what-is-html => lecture-understanding-the-html-boilerplate}/670838977810401844af6fe0.md (100%) rename curriculum/challenges/english/25-front-end-development/{lecture-what-is-html => lecture-understanding-the-html-boilerplate}/670838e914096b194b0c51aa.md (100%) rename curriculum/challenges/english/25-front-end-development/{lecture-what-is-html => lecture-understanding-the-html-boilerplate}/670839051794aa19fcef6dc8.md (100%) diff --git a/client/i18n/locales/english/intro.json b/client/i18n/locales/english/intro.json index 0aa0e8e4373..a8644bd4f96 100644 --- a/client/i18n/locales/english/intro.json +++ b/client/i18n/locales/english/intro.json @@ -2083,11 +2083,24 @@ "In this lab, you will help Camperbot find and fix the errors in their code." ] }, - "lecture-what-is-html": { - "title": "Understanding HTML Attributes and the HTML Boilerplate", + "lecture-understanding-html-attributes": { + "title": "Understanding HTML Attributes", "intro": [ "In these lecture videos, you will learn more about HTML (HyperText Markup Language), a markup language for creating web pages.", - "You will learn about HTML's role on the web, the HTML boilerplate and what HTML attributes are." + "You will learn about HTML's role on the web, and what HTML attributes are." + ] + }, + "lab-debug-pet-adoption-page": { + "title": "Debug a Pet Adoption Page", + "intro": [ + "In this lab, you will need to find and fix the errors in this pet adoption page." + ] + }, + "lecture-understanding-the-html-boilerplate": { + "title": "Understanding the HTML Boilerplate", + "intro": [ + "In these lectures, you will learn about the HTML boilerplate which is a ready-made template for your webpages.", + "You will learn how to work with the link element, meta element and more." ] }, "workshop-cat-photo-app": { diff --git a/client/src/pages/learn/full-stack-developer/lab-debug-pet-adoption-page/index.md b/client/src/pages/learn/full-stack-developer/lab-debug-pet-adoption-page/index.md new file mode 100644 index 00000000000..765295ba655 --- /dev/null +++ b/client/src/pages/learn/full-stack-developer/lab-debug-pet-adoption-page/index.md @@ -0,0 +1,9 @@ +--- +title: Introduction to the Debug a Pet Adoption Page +block: lab-debug-pet-adoption-page +superBlock: full-stack-developer +--- + +## Introduction to the Debug a Pet Adoption Page + +In this lab, you will find and fix the errors in this pet adoption page. diff --git a/client/src/pages/learn/full-stack-developer/lecture-understanding-html-attributes/index.md b/client/src/pages/learn/full-stack-developer/lecture-understanding-html-attributes/index.md new file mode 100644 index 00000000000..58aaf946610 --- /dev/null +++ b/client/src/pages/learn/full-stack-developer/lecture-understanding-html-attributes/index.md @@ -0,0 +1,9 @@ +--- +title: Introduction to Understanding HTML Attributes +block: lecture-understanding-html-attributes +superBlock: full-stack-developer +--- + +## Introduction to Understanding HTML Attributes + +In these lecture videos, you will learn more about HTML (HyperText Markup Language), a markup language for creating web pages. You will learn about HTML's role on the web, and what HTML attributes are. diff --git a/client/src/pages/learn/full-stack-developer/lecture-understanding-the-html-boilerplate/index.md b/client/src/pages/learn/full-stack-developer/lecture-understanding-the-html-boilerplate/index.md new file mode 100644 index 00000000000..9db17ac6c55 --- /dev/null +++ b/client/src/pages/learn/full-stack-developer/lecture-understanding-the-html-boilerplate/index.md @@ -0,0 +1,9 @@ +--- +title: Introduction to the Understanding the HTML Boilerplate +block: lecture-understanding-the-html-boilerplate +superBlock: full-stack-developer +--- + +## Introduction to the Understanding the HTML Boilerplate + +In these lectures, you will learn about the HTML boilerplate which is a ready-made template for your webpages. diff --git a/client/src/pages/learn/full-stack-developer/lecture-what-is-html/index.md b/client/src/pages/learn/full-stack-developer/lecture-what-is-html/index.md deleted file mode 100644 index ac4a2763bdb..00000000000 --- a/client/src/pages/learn/full-stack-developer/lecture-what-is-html/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Introduction to What is HTML? -block: lecture-what-is-html -superBlock: full-stack-developer ---- - -## Introduction to What is HTML? - -Learn what HTML is in these lecture videos. diff --git a/curriculum/challenges/_meta/lab-debug-pet-adoption-page/meta.json b/curriculum/challenges/_meta/lab-debug-pet-adoption-page/meta.json new file mode 100644 index 00000000000..c2e3d051ca1 --- /dev/null +++ b/curriculum/challenges/_meta/lab-debug-pet-adoption-page/meta.json @@ -0,0 +1,11 @@ +{ + "name": "Debug a Pet Adoption Page", + "blockType": "lab", + "blockLayout": "link", + "isUpcomingChange": false, + "dashedName": "lab-debug-pet-adoption-page", + "superBlock": "full-stack-developer", + "helpCategory": "HTML-CSS", + "challengeOrder": [{ "id": "685239f0cad43c7a909cbd98", "title": "Debug a Pet Adoption Page" }], + "usesMultifileEditor": true +} diff --git a/curriculum/challenges/_meta/lecture-understanding-html-attributes/meta.json b/curriculum/challenges/_meta/lecture-understanding-html-attributes/meta.json new file mode 100644 index 00000000000..65269630e1f --- /dev/null +++ b/curriculum/challenges/_meta/lecture-understanding-html-attributes/meta.json @@ -0,0 +1,19 @@ +{ + "name": "Understanding HTML Attributes and the HTML Boilerplate", + "isUpcomingChange": false, + "dashedName": "lecture-understanding-html-attributes", + "superBlock": "full-stack-developer", + "challengeOrder": [ + { + "id": "66f6db08d55022680a3cfbc9", + "title": "What Role Does HTML Play on the Web?" + }, + { + "id": "6708143cab2b583ecd3324f5", + "title": "What Are Attributes, and How Do They Work?" + } + ], + "helpCategory": "HTML-CSS", + "blockType": "lecture", + "blockLayout": "challenge-list" +} diff --git a/curriculum/challenges/_meta/lecture-what-is-html/meta.json b/curriculum/challenges/_meta/lecture-understanding-the-html-boilerplate/meta.json similarity index 60% rename from curriculum/challenges/_meta/lecture-what-is-html/meta.json rename to curriculum/challenges/_meta/lecture-understanding-the-html-boilerplate/meta.json index afcfd815812..cf98f4861df 100644 --- a/curriculum/challenges/_meta/lecture-what-is-html/meta.json +++ b/curriculum/challenges/_meta/lecture-understanding-the-html-boilerplate/meta.json @@ -1,17 +1,12 @@ { - "name": "Understanding HTML Attributes and the HTML Boilerplate", + "name": "Understanding the HTML Boilerplate", + "blockType": "lecture", + "blockLayout": "challenge-list", "isUpcomingChange": false, - "dashedName": "lecture-what-is-html", + "dashedName": "lecture-understanding-the-html-boilerplate", "superBlock": "full-stack-developer", + "helpCategory": "HTML-CSS", "challengeOrder": [ - { - "id": "66f6db08d55022680a3cfbc9", - "title": "What Role Does HTML Play on the Web?" - }, - { - "id": "6708143cab2b583ecd3324f5", - "title": "What Are Attributes, and How Do They Work?" - }, { "id": "670838977810401844af6fe0", "title": "What Is the Role of the Link Element in HTML, and How Can It Be Used to Link to External Stylesheets?" @@ -24,8 +19,5 @@ "id": "670839051794aa19fcef6dc8", "title": "What Is UTF-8 Character Encoding, and Why Is It Needed?" } - ], - "helpCategory": "HTML-CSS", - "blockType": "lecture", - "blockLayout": "challenge-list" + ] } diff --git a/curriculum/challenges/english/25-front-end-development/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md b/curriculum/challenges/english/25-front-end-development/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md new file mode 100644 index 00000000000..ab3c74ad0f1 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/lab-debug-pet-adoption-page/685239f0cad43c7a909cbd98.md @@ -0,0 +1,98 @@ +--- +id: 685239f0cad43c7a909cbd98 +title: Debug a Pet Adoption Page +challengeType: 25 +dashedName: lab-debug-pet-adoption-page +# Purposefully removed the demo type because I don't want any example to show since this is a debugging project. +--- + +# --description-- + +Sally, a pet adoption store owner, has built her first web page but there are some issues. + +Your job is to fix all of the errors so Sally can continue building her page. + +Fulfill the user stories below and get all the tests to pass to complete the lab. + +**User Stories:** + +1. Sally wants to use an image of some cats but it is not displaying correctly. You will need to fix the following in the `img` element: + - Replace the `href` attribute with the correct attribute for the image source. + - Replace the `att` attribute with the correct attribute representing short, descriptive text for images. + - Remove the `` closing tag because `img` elements are void elements and don't have closing tags. +2. Sally wants to use some links to direct users to the dog and cat pages. But the links are not working correctly. You will need to fix the following in the `a` elements: + - Replace both `src` attributes with the correct attributes used to specify URLs. + +# --hints-- + +Your `img` element should have a `src` attribute instead of the `href` attribute. + +```js +const imgEl = document.querySelector("img"); +assert.isTrue(imgEl.hasAttribute("src")); +``` + +Your `img` element should have an `alt` attribute instead of the non-existent `att` attribute. + +```js +const imgEl = document.querySelector("img"); +assert.isTrue(imgEl.hasAttribute("alt")); +``` + +Your `img` element should not have a `` closing tag. + +```js +assert.notMatch(code, /<\/img>/); +``` + +Your `a` element with the text `Visit cats page` needs to have an `href` attribute instead of a `src` attribute. + +```js +const anchors = document.querySelectorAll("a"); +const catLink = Array.from(anchors).find(a => a.textContent.trim() === "Visit cats page"); +assert.isDefined(catLink); +assert.isTrue(catLink.hasAttribute("href")); +``` + +Your `a` element with the text `Visit dogs page` needs to have an `href` attribute instead of a `src` attribute. + +```js +const anchors = document.querySelectorAll("a"); +const dogLink = Array.from(anchors).find(a => a.textContent.trim() === "Visit dogs page"); +assert.isDefined(dogLink); +assert.isTrue(dogLink.hasAttribute("href")); +``` + +# --seed-- + +## --seed-contents-- + +```html +

Welcome XYZ Pet Adoption!

+

Consider adopting a pet today. We have cats, dogs, rabbits and more.

+ +

See our cats!

+ + +

Adopt a cat!

+Visit cats page + +

Adopt a dog!

+Visit dogs page +``` + +# --solutions-- + +```html +

Welcome XYZ Pet Adoption!

+

Consider adopting a pet today. We have cats, dogs, rabbits and more.

+ +

See our cats!

+Five cats looking around a field. + +

Adopt a cat!

+Visit cats page + +

Adopt a dog!

+Visit dogs page +``` diff --git a/curriculum/challenges/english/25-front-end-development/lecture-what-is-html/66f6db08d55022680a3cfbc9.md b/curriculum/challenges/english/25-front-end-development/lecture-understanding-html-attributes/66f6db08d55022680a3cfbc9.md similarity index 100% rename from curriculum/challenges/english/25-front-end-development/lecture-what-is-html/66f6db08d55022680a3cfbc9.md rename to curriculum/challenges/english/25-front-end-development/lecture-understanding-html-attributes/66f6db08d55022680a3cfbc9.md diff --git a/curriculum/challenges/english/25-front-end-development/lecture-what-is-html/6708143cab2b583ecd3324f5.md b/curriculum/challenges/english/25-front-end-development/lecture-understanding-html-attributes/6708143cab2b583ecd3324f5.md similarity index 100% rename from curriculum/challenges/english/25-front-end-development/lecture-what-is-html/6708143cab2b583ecd3324f5.md rename to curriculum/challenges/english/25-front-end-development/lecture-understanding-html-attributes/6708143cab2b583ecd3324f5.md diff --git a/curriculum/challenges/english/25-front-end-development/lecture-what-is-html/670838977810401844af6fe0.md b/curriculum/challenges/english/25-front-end-development/lecture-understanding-the-html-boilerplate/670838977810401844af6fe0.md similarity index 100% rename from curriculum/challenges/english/25-front-end-development/lecture-what-is-html/670838977810401844af6fe0.md rename to curriculum/challenges/english/25-front-end-development/lecture-understanding-the-html-boilerplate/670838977810401844af6fe0.md diff --git a/curriculum/challenges/english/25-front-end-development/lecture-what-is-html/670838e914096b194b0c51aa.md b/curriculum/challenges/english/25-front-end-development/lecture-understanding-the-html-boilerplate/670838e914096b194b0c51aa.md similarity index 100% rename from curriculum/challenges/english/25-front-end-development/lecture-what-is-html/670838e914096b194b0c51aa.md rename to curriculum/challenges/english/25-front-end-development/lecture-understanding-the-html-boilerplate/670838e914096b194b0c51aa.md diff --git a/curriculum/challenges/english/25-front-end-development/lecture-what-is-html/670839051794aa19fcef6dc8.md b/curriculum/challenges/english/25-front-end-development/lecture-understanding-the-html-boilerplate/670839051794aa19fcef6dc8.md similarity index 100% rename from curriculum/challenges/english/25-front-end-development/lecture-what-is-html/670839051794aa19fcef6dc8.md rename to curriculum/challenges/english/25-front-end-development/lecture-understanding-the-html-boilerplate/670839051794aa19fcef6dc8.md diff --git a/curriculum/superblock-structure/full-stack.json b/curriculum/superblock-structure/full-stack.json index 7f4289985ff..45d9f139ede 100644 --- a/curriculum/superblock-structure/full-stack.json +++ b/curriculum/superblock-structure/full-stack.json @@ -16,7 +16,13 @@ "dashedName": "lab-debug-camperbots-profile-page" }, { - "dashedName": "lecture-what-is-html" + "dashedName": "lecture-understanding-html-attributes" + }, + { + "dashedName": "lab-debug-pet-adoption-page" + }, + { + "dashedName": "lecture-understanding-the-html-boilerplate" }, { "dashedName": "workshop-cat-photo-app" diff --git a/e2e/super-block-page.spec.ts b/e2e/super-block-page.spec.ts index cbfeb3c1490..536ab3ea695 100644 --- a/e2e/super-block-page.spec.ts +++ b/e2e/super-block-page.spec.ts @@ -142,7 +142,7 @@ test.describe('Super Block Page - Authenticated User', () => { await page.addInitScript(() => { window.localStorage.setItem( 'currentChallengeId', - '66f6db08d55022680a3cfbc9' // What Is HTML, and What Role Does It Play on the Web? + '66f6db08d55022680a3cfbc9' // What Role Does HTML Play on the Web? ); }); @@ -160,10 +160,10 @@ test.describe('Super Block Page - Authenticated User', () => { }) ).toHaveAttribute('aria-expanded', 'true'); - // What is HTML block + // Understanding HTML Attributes block await expect( page.getByRole('button', { - name: /Lecture Understanding HTML Attributes and the HTML Boilerplate/ + name: /Lecture Understanding HTML Attributes/ }) ).toHaveAttribute('aria-expanded', 'true'); });