diff --git a/client/i18n/locales/english/intro.json b/client/i18n/locales/english/intro.json index f7558020063..8c80b5e6629 100644 --- a/client/i18n/locales/english/intro.json +++ b/client/i18n/locales/english/intro.json @@ -3101,7 +3101,12 @@ ] }, "cvsw": { "title": "226", "intro": [] }, - "cvs1": { "title": "227", "intro": [] }, + "lab-voting-system": { + "title": "Build a Voting System", + "intro": [ + "In this lab, you will build a voting system using Maps and Sets." + ] + }, "review-javascript-maps-and-sets": { "title": "JavaScript Maps and Sets Review", "intro": [ diff --git a/client/src/pages/learn/full-stack-developer/lab-voting-system/index.md b/client/src/pages/learn/full-stack-developer/lab-voting-system/index.md new file mode 100644 index 00000000000..8ebec02e4d4 --- /dev/null +++ b/client/src/pages/learn/full-stack-developer/lab-voting-system/index.md @@ -0,0 +1,9 @@ +--- +title: Introduction to the Build a Voting System +block: lab-voting-system +superBlock: full-stack-developer +--- + +## Introduction to the Build a Voting System + +In this lab, you will build a voting system using Maps and Sets. diff --git a/curriculum/challenges/_meta/lab-voting-system/meta.json b/curriculum/challenges/_meta/lab-voting-system/meta.json new file mode 100644 index 00000000000..458625b6318 --- /dev/null +++ b/curriculum/challenges/_meta/lab-voting-system/meta.json @@ -0,0 +1,11 @@ +{ + "name": "Build a Voting System", + "isUpcomingChange": true, + "usesMultifileEditor": true, + "dashedName": "lab-voting-system", + "superBlock": "full-stack-developer", + "challengeOrder": [{ "id": "673b567e3ba535dda140d278", "title": "Build a Voting System" }], + "helpCategory": "JavaScript", + "blockType": "lab", + "blockLayout": "link" +} diff --git a/curriculum/challenges/english/25-front-end-development/lab-voting-system/673b567e3ba535dda140d278.md b/curriculum/challenges/english/25-front-end-development/lab-voting-system/673b567e3ba535dda140d278.md new file mode 100644 index 00000000000..94fd256999d --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/lab-voting-system/673b567e3ba535dda140d278.md @@ -0,0 +1,352 @@ +--- +id: 673b567e3ba535dda140d278 +title: Build a Voting System +challengeType: 14 +dashedName: build-a-voting-system +--- + +# --description-- + +In this lab, you will build a voting system that uses `Map` to create a poll and `Set` to prevent duplicate voting. + +**Objective:** Fulfill the user stories below and get all the tests to pass to complete the lab. + +**User Stories:** + +1. You should initialize a `poll` variable to a new `Map` object. + +2. You should have a function `addOption` that accepts a parameter `option`. + +3. In the `addOption` function: + + - If the `option` does not already exist in the poll, it should be added to the poll with an empty `Set` as its value to track voters. You should also return the message `Option "