diff --git a/.github/workflows/update-license.yaml b/.github/workflows/update-license.yaml deleted file mode 100644 index bf85481deccd09..00000000000000 --- a/.github/workflows/update-license.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Update copyright year(s) in license file - -on: - workflow_dispatch: - schedule: - - cron: '0 3 1 1 *' - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 0 - - uses: FantasticFiasco/action-update-license-year@26ffac173f956c25f7467aa8e6f750eed24a1b7a # v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - path: | - README.md - LICENSE - commitTitle: 'docs: update copyright years' - prTitle: 'docs: update copyright years' - prBody: It's that time of the year, let's update the license - labels: 'status: waiting review' diff --git a/client/i18n/locales/english/intro.json b/client/i18n/locales/english/intro.json index de541074aca2a0..f5c94d9cb25db0 100644 --- a/client/i18n/locales/english/intro.json +++ b/client/i18n/locales/english/intro.json @@ -1880,7 +1880,13 @@ "yskn": { "title": "134", "intro": [] }, "tpni": { "title": "135", "intro": [] }, "hoec": { "title": "136", "intro": [] }, - "cygu": { "title": "137", "intro": [] }, + "workshop-teacher-chatbot": { + "title": "Build a Teacher Chatbot", + "intro": [ + "In this workshop, you will continue to learn more about JavaScript strings by building a chatbot.", + "You will learn how to work with template literals, and the indexOf method." + ] + }, "axgb": { "title": "138", "intro": [] }, "rwac": { "title": "139", "intro": [] }, "uzjg": { "title": "140", "intro": [] }, @@ -1921,7 +1927,10 @@ "ccnu": { "title": "175", "intro": [] }, "skiq": { "title": "176", "intro": [] }, "epfc": { "title": "177", "intro": [] }, - "gsfr": { "title": "178", "intro": [] }, + "lab-gradebook-app": { + "title": "Build a Gradebook App", + "intro": ["For this lab, you will create a gradebook app."] + }, "fbbn": { "title": "179", "intro": [] }, "lnmg": { "title": "180", "intro": [] }, "wead": { "title": "181", "intro": [] }, @@ -1950,9 +1959,9 @@ "ksfc": { "title": "204", "intro": [] }, "xeqa": { "title": "205", "intro": [] }, "lab-random-background-color-changer": { - "title": "Build a Random Background Color Changer", + "title": "Debug a Random Background Color Changer", "intro": [ - "For this lab, you will create a random background color changer." + "For this lab, you will debug a random background color changer and fix the errors to make it work properly." ] }, "dqth": { "title": "207", "intro": [] }, diff --git a/client/i18n/locales/portuguese/intro.json b/client/i18n/locales/portuguese/intro.json index be00a9f38378f3..cb9782d027148c 100644 --- a/client/i18n/locales/portuguese/intro.json +++ b/client/i18n/locales/portuguese/intro.json @@ -1779,10 +1779,10 @@ "intro": [] }, "workshop-hotel-feedback-form": { - "title": "Build a Hotel Feedback Form", + "title": "Crie um formulário de feedback de hotéis", "intro": [ - "In this workshop, you will learn how to work with forms by building a Hotel Feedback Form.", - "You will learn how to work with labels, inputs, fieldsets, legends, textareas and buttons." + "Neste workshop, você aprenderá a trabalhar com formulários criando um formulário de feedback de hotéis.", + "Você aprenderá a trabalhar com os elementos label, input, fieldset, legend, textarea e button." ] }, "lab-survey-form": { diff --git a/client/i18n/locales/portuguese/translations.json b/client/i18n/locales/portuguese/translations.json index a89b48eabe72d5..33b4d3d5c5099b 100644 --- a/client/i18n/locales/portuguese/translations.json +++ b/client/i18n/locales/portuguese/translations.json @@ -1,7 +1,7 @@ { "buttons": { "logged-in-cta-btn": "Comece (é grátis)", - "get-started": "Get Started", + "get-started": "Primeiros passos", "logged-out-cta-btn": "Inicie a sessão para salvar seu progresso (é grátis)", "view-curriculum": "Visualizar o currículo", "first-lesson": "Ir para a primeira aula", @@ -107,15 +107,15 @@ }, "landing": { "big-heading-1": "Aprenda a programar — de graça.", - "big-heading-1-b": "Learn to code.", + "big-heading-1-b": "Aprenda a programar.", "big-heading-2": "Crie projetos.", "big-heading-3": "Obtenha certificações.", - "big-heading-4": "All for free.", + "big-heading-4": "De graça.", "h2-heading": "Desde 2014, mais de 40.000 pessoas que concluíram o freeCodeCamp.org obtiveram empregos em empresas de tecnologia incluindo:", - "h2-heading-b": "More than 100,000 freeCodeCamp.org graduates have gotten jobs at tech companies including:", + "h2-heading-b": "Mais de 100 mil pessoas já concluíram o freeCodeCamp.org e obtiveram empregos em empresas de tecnologia, incluindo:", "hero-img-description": "Estudantes do freeCodeCamp em um grupo de estudos local na Coreia do Sul.", "hero-img-alt": "Um grupo de pessoas, incluindo um homem branco, uma mulher negra e uma mulher asiática, reunidos ao redor de um laptop.", - "hero-img-uis": "A group of screenshots showing the freeCodeCamp editor interface on both a mobile and desktop device and a certification.", + "hero-img-uis": "Um grupo de capturas de tela mostrando a interface de editor do freeCodeCamp em um dispositivo móvel e em um desktop, além de uma certificação.", "as-seen-in": "Conforme visto em:", "testimonials": { "heading": "Veja o que os nossos ex-alunos dizem sobre o freeCodeCamp:", @@ -281,9 +281,9 @@ "reset-p3": "Não conseguiremos recuperar nada disso depois, mesmo que você mude de ideia.", "nevermind-2": "Deixa para lá, não quero apagar todo o meu progresso", "reset-confirm": "Redefinir tudo. Eu quero começar do início", - "verify-text": "To verify, type \"{{ verifyText }}\" below:", - "verify-reset-text": "I agree that all progress will be lost", - "verify-delete-text": "I agree to delete my account" + "verify-text": "Para verificar, digite \"{{ verifyText }}\" abaixo:", + "verify-reset-text": "Eu concordo que todo o progresso será perdido", + "verify-delete-text": "Eu concordo em excluir minha conta" }, "email": { "missing": "Você não tem um e-mail associado a esta conta.", diff --git a/client/src/pages/learn/front-end-development/lab-gradebook-app/index.md b/client/src/pages/learn/front-end-development/lab-gradebook-app/index.md new file mode 100644 index 00000000000000..bc489d76ebe37f --- /dev/null +++ b/client/src/pages/learn/front-end-development/lab-gradebook-app/index.md @@ -0,0 +1,9 @@ +--- +title: Introduction to the Build a Gradebook App +block: lab-gradebook-app +superBlock: front-end-development +--- + +## Introduction to the Build a Gradebook App + +For this lab, you will create a gradebook app. diff --git a/client/src/pages/learn/front-end-development/lab-random-background-color-changer/index.md b/client/src/pages/learn/front-end-development/lab-random-background-color-changer/index.md index dd801356356ad6..8f9507470f62c0 100644 --- a/client/src/pages/learn/front-end-development/lab-random-background-color-changer/index.md +++ b/client/src/pages/learn/front-end-development/lab-random-background-color-changer/index.md @@ -1,9 +1,9 @@ --- -title: Introduction to the Build a Random Background Color Changer +title: Introduction to the Debug a Random Background Color Changer block: lab-random-background-color-changer superBlock: front-end-development --- -## Introduction to the Build a Random Background Color Changer +## Introduction to the Debug a Random Background Color Changer -For this lab, you will create a random background color changer. +For this lab, you will debug a random background color changer and fix the errors to make it work properly. diff --git a/client/src/pages/learn/front-end-development/workshop-teacher-chatbot/index.md b/client/src/pages/learn/front-end-development/workshop-teacher-chatbot/index.md new file mode 100644 index 00000000000000..33930c58b62522 --- /dev/null +++ b/client/src/pages/learn/front-end-development/workshop-teacher-chatbot/index.md @@ -0,0 +1,9 @@ +--- +title: Introduction to the Build a Teacher Chatbot +block: workshop-teacher-chatbot +superBlock: front-end-development +--- + +## Introduction to the Build a Teacher Chatbot + +This is a test for the new project-based curriculum. diff --git a/curriculum/challenges/_meta/lab-gradebook-app/meta.json b/curriculum/challenges/_meta/lab-gradebook-app/meta.json new file mode 100644 index 00000000000000..7bb2a6252a76a5 --- /dev/null +++ b/curriculum/challenges/_meta/lab-gradebook-app/meta.json @@ -0,0 +1,11 @@ +{ + "name": "Build a Gradebook App", + "blockType": "lab", + "isUpcomingChange": true, + "usesMultifileEditor": true, + "dashedName": "lab-gradebook-app", + "order": 178, + "superBlock": "front-end-development", + "challengeOrder": [{ "id": "66bb6a9c2dd58b73cd759034", "title": "Build a Gradebook App" }], + "helpCategory": "JavaScript" +} diff --git a/curriculum/challenges/_meta/lab-random-background-color-changer/meta.json b/curriculum/challenges/_meta/lab-random-background-color-changer/meta.json index e7f06676d2d979..19b5fd6d1a2ac3 100644 --- a/curriculum/challenges/_meta/lab-random-background-color-changer/meta.json +++ b/curriculum/challenges/_meta/lab-random-background-color-changer/meta.json @@ -1,11 +1,11 @@ { - "name": "Build a Random Background Color Changer", + "name": "Debug a Random Background Color Changer", "blockType": "lab", "isUpcomingChange": true, "usesMultifileEditor": true, "dashedName": "lab-random-background-color-changer", "order": 206, "superBlock": "front-end-development", - "challengeOrder": [{ "id": "66b62d0ad68488dd76228d6c", "title": "Build a Random Background Color Changer" }], + "challengeOrder": [{ "id": "66b62d0ad68488dd76228d6c", "title": "Debug a Random Background Color Changer" }], "helpCategory": "JavaScript" } diff --git a/curriculum/challenges/_meta/workshop-teacher-chatbot/meta.json b/curriculum/challenges/_meta/workshop-teacher-chatbot/meta.json new file mode 100644 index 00000000000000..6835183a0d70fa --- /dev/null +++ b/curriculum/challenges/_meta/workshop-teacher-chatbot/meta.json @@ -0,0 +1,85 @@ +{ + "name": "Build a Teacher Chatbot", + "blockType": "workshop", + "isUpcomingChange": true, + "usesMultifileEditor": true, + "hasEditableBoundaries": true, + "dashedName": "workshop-teacher-chatbot", + "order": 137, + "superBlock": "front-end-development", + "challengeOrder": [ + { + "id": "66b102ee0bdbad34a9f85ba0", + "title": "Step 1" + }, + { + "id": "66b5928b86e907fdfbf34e56", + "title": "Step 2" + }, + { + "id": "66b59829dba144ff1351220f", + "title": "Step 3" + }, + { + "id": "66b59b12a745e10011158f7b", + "title": "Step 4" + }, + { + "id": "66b59be6ab830800c4df9146", + "title": "Step 5" + }, + { + "id": "66b6d482bbb9e12f2e5ee1ae", + "title": "Step 6" + }, + { + "id": "66b6e39031393e30f2c48d0f", + "title": "Step 7" + }, + { + "id": "66b6e62423e8a031d6c1f03d", + "title": "Step 8" + }, + { + "id": "66b6e80d6c3f0b329c360283", + "title": "Step 9" + }, + { + "id": "66b6efddeca35833cd6f0b03", + "title": "Step 10" + }, + { + "id": "66b6f586767a1534f3097353", + "title": "Step 11" + }, + { + "id": "66b6f80fca500635d1e8af8d", + "title": "Step 12" + }, + { + "id": "66b6fdb76441c738719039fa", + "title": "Step 13" + }, + { + "id": "66b6ffb42b88e33943788abf", + "title": "Step 14" + }, + { + "id": "66b7049b7709ea3a9547c79d", + "title": "Step 15" + }, + { + "id": "66b70b8a611cbf3bcc5c6c5f", + "title": "Step 16" + }, + { + "id": "66b7137348cfb53fd3ec6c73", + "title": "Step 17" + }, + { + "id": "66b7142e588c4a407a51cdb6", + "title": "Step 18" + } + ], + "helpCategory": "JavaScript" +} \ No newline at end of file diff --git a/curriculum/challenges/english/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b23ad0df43588a6eadfa4.md b/curriculum/challenges/english/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b23ad0df43588a6eadfa4.md index e40d375337d4a7..ee5f53ab9b8cb3 100644 --- a/curriculum/challenges/english/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b23ad0df43588a6eadfa4.md +++ b/curriculum/challenges/english/21-a2-english-for-developers/learn-conversation-starters-in-the-break-room/657b23ad0df43588a6eadfa4.md @@ -35,7 +35,7 @@ The first sentence is correct, but the second one does not ask about interest. I ### --feedback-- -The first sentence is asking for a favorite thing, not interest in an activity. The second sentence is a statement, not a question. +The first sentence is correct. The second sentence is a statement, not a question. --- diff --git a/curriculum/challenges/english/25-front-end-development/lab-gradebook-app/66bb6a9c2dd58b73cd759034.md b/curriculum/challenges/english/25-front-end-development/lab-gradebook-app/66bb6a9c2dd58b73cd759034.md new file mode 100644 index 00000000000000..829c00353fa092 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/lab-gradebook-app/66bb6a9c2dd58b73cd759034.md @@ -0,0 +1,238 @@ +--- +id: 66bb6a9c2dd58b73cd759034 +title: Build a Gradebook App +challengeType: 14 +dashedName: build-a-gradebook-app +--- + +# --description-- + +**Objective:** Fulfill the user stories below and get all the tests to pass to complete the lab. + +**User Stories:** + +1. You should have a function named `getAverage` that takes an array of test scores as a parameter and returns the average score. +1. You should have a function named `getGrade` that takes a student score as a parameter and returns a string representing a letter grade based on the score. Here are the scores and their corresponding letter grades: + + | Score Range | Grade | + | ----------- | ------- | + | `100` | `"A+"` | + | `90 - 99` | `"A"` | + | `80 - 89` | `"B"` | + | `70 - 79` | `"C"` | + | `60 - 69` | `"D"` | + | `0 - 59` | `"F"` | + +1. You should have a function named `hasPassingGrade` that takes a score as a parameter and returns either `true` or `false` depending on if the score corresponds to a passing grade. +1. The `hasPassingGrade` function should use the `getGrade` function to get the letter grade, and use it to determine if the grade is passing. A passing grade is anything different from `"F"`. +1. You should have a function named `studentMsg` that takes an array of scores and a student score as the parameters. The function should return a string with the format: + + - `"Class average: average-goes-here. Your grade: grade-goes-here. You passed the course."`, if the student passed the course. + - `"Class average: average-goes-here. Your grade: grade-goes-here. You failed the course."`, if the student failed the course. + + Replace `average-goes-here` with the average of total scores and `grade-goes-here` with the student's grade. + Use `getAverage` to get the average score and `getGrade` to get the student's grade. + +# --hints-- + +You should have a function named `getAverage`. + +```js +assert.isFunction(getAverage); +``` + +Your `getAverage` function should return a number. + +```js +assert.isNumber(getAverage([92, 88, 12, 77, 57, 100, 67, 38, 97, 89])); +``` + +`getAverage([92, 88, 12, 77, 57, 100, 67, 38, 97, 89])` should return `71.7`. + +```js +assert.strictEqual(getAverage([92, 88, 12, 77, 57, 100, 67, 38, 97, 89]), 71.7); +``` + +`getAverage([45, 87, 98, 100, 86, 94, 67, 88, 94, 95])` should return `85.4`. + +```js +assert.strictEqual(getAverage([45, 87, 98, 100, 86, 94, 67, 88, 94, 95]), 85.4); +``` + +`getAverage([38, 99, 87, 100, 100, 100, 100, 100, 100, 100])` should return `92.4`. + +```js +assert.strictEqual(getAverage([38, 99, 87, 100, 100, 100, 100, 100, 100, 100]), 92.4); +``` + +Your `getAverage` function should return the average score of the test scores. + +```js +assert.strictEqual(getAverage([52, 56, 60, 65, 70, 75, 80, 85, 90, 95]), 72.8); +assert.strictEqual(getAverage([45, 50, 55, 60, 65, 70, 75, 80, 85, 90]), 67.5); +assert.strictEqual(getAverage([38, 42, 46, 50, 54, 58, 62, 66, 70, 74]), 56); +``` + +You should have a function named `getGrade`. + +```js +assert.isFunction(getGrade); +``` + +Your `getGrade` function should return `"A+"` if the score is `100`. + +```js +assert.strictEqual(getGrade(100), "A+"); +``` + +Your `getGrade` function should return `"A"` if the score is between `90` and `99`. + +```js +assert.strictEqual(getGrade(90), "A"); +assert.strictEqual(getGrade(94), "A"); +assert.strictEqual(getGrade(99), "A"); +``` + +Your `getGrade` function should return `"B"` if the score is between `80` and `89`. + +```js +assert.strictEqual(getGrade(80), "B"); +assert.strictEqual(getGrade(83), "B"); +assert.strictEqual(getGrade(88), "B"); +``` + +Your `getGrade` function should return `"C"` if the score is between `70` and `79`. + +```js +assert.strictEqual(getGrade(70), "C"); +assert.strictEqual(getGrade(75), "C"); +assert.strictEqual(getGrade(79), "C"); +``` + +Your `getGrade` function should return `"D"` if the score is between `60` and `69`. + +```js +assert.strictEqual(getGrade(60), "D"); +assert.strictEqual(getGrade(63), "D"); +assert.strictEqual(getGrade(68), "D"); +``` + +Your `getGrade` function should return `"F"` if the score is between `0` and `59`. + +```js +assert.strictEqual(getGrade(0), "F"); +assert.strictEqual(getGrade(30), "F"); +assert.strictEqual(getGrade(43), "F"); +assert.strictEqual(getGrade(59), "F"); +``` + + +You should have a function named `hasPassingGrade`. + +```js +assert.isFunction(hasPassingGrade); +``` + +Your `hasPassingGrade` function should return a boolean value. + +```js +assert.isBoolean(hasPassingGrade(100)); +``` + +Your `hasPassingGrade` function should return `true` if the grade is an `"A"`. + +```js +assert.isTrue(hasPassingGrade(100)); +``` + +Your `hasPassingGrade` function should return `false` if the grade is an `"F"`. + +```js +assert.isFalse(hasPassingGrade(53)); +``` + +Your `hasPassingGrade` function should return `true` for all passing grades. + +```js +assert.isTrue(hasPassingGrade(87)); +assert.isTrue(hasPassingGrade(60)); +assert.isTrue(hasPassingGrade(73)); +assert.isTrue(hasPassingGrade(96)); +``` + +You should have a function named `studentMsg`. + +```js +assert.isFunction(studentMsg); +``` + +Your function call of `studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37)` should return the following message: `"Class average: 71.7. Your grade: F. You failed the course."`. + +```js +assert.strictEqual(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37), "Class average: 71.7. Your grade: F. You failed the course."); +``` + +Your function call of `studentMsg([56, 23, 89, 42, 75, 11, 68, 34, 91, 19], 100)` should return the following message: `"Class average: 50.8. Your grade: A+. You passed the course."`. + +```js +assert.strictEqual(studentMsg([56, 23, 89, 42, 75, 11, 68, 34, 91, 19], 100), "Class average: 50.8. Your grade: A+. You passed the course."); +``` + +Your `studentMsg` function should return the correct message based on the student's score and the class average. + +```js +assert.strictEqual(studentMsg([33, 44, 55, 66, 77, 88, 99, 100], 92), "Class average: 70.25. Your grade: A. You passed the course."); +assert.strictEqual(studentMsg([33, 44, 55, 66, 77, 88, 99, 100], 57), "Class average: 70.25. Your grade: F. You failed the course."); +``` + + +# --seed-- + +## --seed-contents-- + +```js + +``` + +# --solutions-- + +```js +function getAverage(scores) { + let sum = 0; + + for (const score of scores) { + sum += score; + } + + return sum / scores.length; + } + + function getGrade(score) { + if (score === 100) { + return "A+"; + } else if (score >= 90) { + return "A"; + } else if (score >= 80) { + return "B"; + } else if (score >= 70) { + return "C"; + } else if (score >= 60) { + return "D"; + } else { + return "F"; + } + } + + function hasPassingGrade(score) { + return getGrade(score) !== "F"; + } + + function studentMsg(totalScores, studentScore) { + let average = getAverage(totalScores); + let grade = getGrade(studentScore); + + return `Class average: ${average}. Your grade: ${grade}. You ${ + hasPassingGrade(studentScore) ? "passed" : "failed" + } the course.`; + } +``` diff --git a/curriculum/challenges/english/25-front-end-development/lab-random-background-color-changer/66b62d0ad68488dd76228d6c.md b/curriculum/challenges/english/25-front-end-development/lab-random-background-color-changer/66b62d0ad68488dd76228d6c.md index 0306f02e984986..12fc9baa4078d7 100644 --- a/curriculum/challenges/english/25-front-end-development/lab-random-background-color-changer/66b62d0ad68488dd76228d6c.md +++ b/curriculum/challenges/english/25-front-end-development/lab-random-background-color-changer/66b62d0ad68488dd76228d6c.md @@ -1,13 +1,15 @@ --- id: 66b62d0ad68488dd76228d6c -title: Build a Random Background Color Changer +title: Debug a Random Background Color Changer challengeType: 14 -dashedName: build-a-random-background-color-changer +dashedName: debug-a-random-background-color-changer --- # --description-- -**Objective:** Fulfill the user stories below and get all the tests to pass to complete the lab. +Camperbot is learning JavaScript and has tried to build their own Random Background Color Changer. However, they have made a few mistakes along the way. + +**Objective:** Fulfill the user stories below and get all the tests to pass so the lab is functioning properly. **User Stories:** @@ -82,7 +84,7 @@ assert.match(code, /btn\.addEventListener\s*\(\s*("|')click\1\s*,\s*changeBackgr - Build a random background color changer + Debug a random background color changer @@ -190,7 +192,7 @@ const darkColorsArr = [ - Build a random background color changer + Debug a random background color changer diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b102ee0bdbad34a9f85ba0.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b102ee0bdbad34a9f85ba0.md new file mode 100644 index 00000000000000..20fa289c31674d --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b102ee0bdbad34a9f85ba0.md @@ -0,0 +1,36 @@ +--- +id: 66b102ee0bdbad34a9f85ba0 +title: Step 1 +challengeType: 1 +dashedName: step-1 +--- + +# --description-- + +In this workshop, you are going to continue learning about strings by building a Teacher Chatbot. + +To begin, add a `console` statement, with the message of `"Hi there!"`. + +# --hints-- + +You should have a `console` statement. + +```js +assert.match(code, /console\.log(.*)/); +``` + +Your console statement should output the message `"Hi there!"`. + +```js +assert.match(code, /console\.log\((['"])(Hi\s+there!)\1\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b5928b86e907fdfbf34e56.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b5928b86e907fdfbf34e56.md new file mode 100644 index 00000000000000..d78a2920d00d42 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b5928b86e907fdfbf34e56.md @@ -0,0 +1,44 @@ +--- +id: 66b5928b86e907fdfbf34e56 +title: Step 2 +challengeType: 1 +dashedName: step-2 +--- + +# --description-- + +Now it is time to set the bot's name. + +Create a variable called `botName` and assign it the string value of `"teacherBot"`. + +# --hints-- + +You should have a variable called `botName`. + +```js +assert.isNotNull(botName); +``` + +Your `botName` variable should be a string. + +```js +assert.isString(botName); +``` + +Your `botName` variable should have the value of `"teacherBot"`. + +```js +assert.strictEqual(botName, "teacherBot"); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59829dba144ff1351220f.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59829dba144ff1351220f.md new file mode 100644 index 00000000000000..bf240320243ac2 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59829dba144ff1351220f.md @@ -0,0 +1,65 @@ +--- +id: 66b59829dba144ff1351220f +title: Step 3 +challengeType: 1 +dashedName: step-3 +--- + +# --description-- + +Now it is time to create a greeting using the `botName` variable. + +In the previous lecture videos, you learned how to concatenate strings using template literals like this: + +```js +const name = "John"; + +// "Hello, John!" +`Hello, ${name}!`; +``` + +Start by creating a variable called `greeting`. + +Next, using template literal syntax, assign a string that says `My name is`, followed by the `botName` variable, and ending with a period (`.`). + +Finally, log the `greeting` variable to the console. + +# --hints-- + +You should have a variable called `greeting`. + +```js +assert.isNotNull(greeting); +``` + +You should assign a string to your `greeting` variable. + +```js +assert.isString(greeting); +``` + +You should use template literals to concatenate the string `My name is` with the `botName` variable followed by a period (`.`). + +```js +assert.equal(greeting, "My name is teacherBot."); +``` + +You should have a `console` statement that logs the `greeting` variable to the console. + +```js +assert.match(code, /console.log\(.*greeting.*\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59b12a745e10011158f7b.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59b12a745e10011158f7b.md new file mode 100644 index 00000000000000..f0063d626f0d93 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59b12a745e10011158f7b.md @@ -0,0 +1,69 @@ +--- +id: 66b59b12a745e10011158f7b +title: Step 4 +challengeType: 1 +dashedName: step-4 +--- + +# --description-- + +The next step is to create a few more variables that will be used in future bot messages. + +Create a variable called `subject` and assign it the string value `"JavaScript"`. + +Then create a variable called `topic` and assign it the string value `"strings"`. + +# --hints-- + +You should have a variable called `subject`. + +```js +assert.isNotNull(subject); +``` + +You should assign a string to your `subject` variable. + +```js +assert.isString(subject); +``` + +You should assign the string `"JavaScript"` to your `subject` variable. + +```js +assert.equal(subject, "JavaScript"); +``` + +You should have a variable called `topic`. + +```js +assert.isNotNull(topic); +``` + +You should assign a string to your `topic` variable. + +```js +assert.isString(topic); +``` + +You should assign the string `"strings"` to your `topic` variable. + +```js +assert.equal(topic, "strings"); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59be6ab830800c4df9146.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59be6ab830800c4df9146.md new file mode 100644 index 00000000000000..7e09d9eba71997 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b59be6ab830800c4df9146.md @@ -0,0 +1,74 @@ +--- +id: 66b59be6ab830800c4df9146 +title: Step 5 +challengeType: 1 +dashedName: step-5 +--- + +# --description-- + +Now, it's time to use the variables you created in the previous step. + +In the lecture videos, you learned how to work with template literals like this: + +```js +const name = "John"; +const age = 30; + +// My name is John and I am 30 years old. +`My name is ${name} and I am ${age} years old.`; +``` + +Start by creating a `sentence` variable. + +Using template literal syntax, assign the string `Today, you will learn about [topic variable goes here] in [subject variable goes here].` to the `sentence` variable. + +You will replace the `[topic variable goes here]` and `[subject variable goes here]` placeholders with the `topic` and `subject` variables and `${}` syntax. + +Finally, log the `sentence` variable to the console. + +# --hints-- + +You should have a `sentence` variable. + +```js +assert.isNotNull(sentence); +``` + +Your `sentence` variable should be a string. + +```js +assert.isString(sentence); +``` + +You should use template literal syntax to assign the string `Today, you will learn about [topic variable goes here] in [subject variable goes here].` to the `sentence` variable. Refer to the example if you need help. + +```js +assert.match(code, /Today,\s*you\s+will\s+learn\s+about\s+\$\{topic\}\s+in\s+\$\{subject\}\./); +``` + +You should log the `sentence` variable to the console. + +```js +assert.match(code,/console\.log\(\s*sentence\s*\);?/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6d482bbb9e12f2e5ee1ae.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6d482bbb9e12f2e5ee1ae.md new file mode 100644 index 00000000000000..079db69b33599c --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6d482bbb9e12f2e5ee1ae.md @@ -0,0 +1,67 @@ +--- +id: 66b6d482bbb9e12f2e5ee1ae +title: Step 6 +challengeType: 1 +dashedName: step-6 +--- + +# --description-- + +For this next portion of the project, the bot will teach working with the string `length` property. + +Start by creating a new variable called `strLengthIntro`. + +Then using template literal syntax, assign the string `Here is an example of using the length property on the word [subject].` to the `strLengthIntro` variable. + +Replace `[subject]` with the `subject` variable like you did earlier. + +Finally, log the `strLengthIntro` variable to the console. + +# --hints-- + +You should have a variable called `strLengthIntro`. + +```js +assert.isNotNull(strLengthIntro); +``` + +Your `strLengthIntro` variable should be a string. + +```js +assert.isString(strLengthIntro); +``` + +You should use template literal syntax to assign the string `Here is an example of using the length property on the word [subject goes here].` to the `strLengthIntro` variable. + +```js +assert.match(code,/`Here\s+is\s+an\s+example\s+of\s+using\s+the\s+length\s+property\s+on\s+the\s+word\s+\$\{subject\}\.`/); +``` + +You should log the `strLengthIntro` variable to the console. + +```js +assert.match(code,/console\.log\(\s*strLengthIntro\s*\);?/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e39031393e30f2c48d0f.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e39031393e30f2c48d0f.md new file mode 100644 index 00000000000000..67ea891739e3cf --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e39031393e30f2c48d0f.md @@ -0,0 +1,62 @@ +--- +id: 66b6e39031393e30f2c48d0f +title: Step 7 +challengeType: 1 +dashedName: step-7 +--- + +# --description-- + +To get the length of a string, you can use the length property. This property returns the number of characters in a string. + +Here is an example: + +```js +const greeting = "Hello, world!"; + +// Output: 13 +console.log(greeting.length); +``` + +Start by using the `length` property to get the length of the `subject` string and log that value to the console. + +# --hints-- + + +You should use the `length` property to get the length of the `subject` string. + +```js +assert.match(code, /subject\.length/); +``` + +You should log the length of the `subject` string to the console. + +```js +assert.match(code, /console\.log\(\s*subject\.length\s*\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e62423e8a031d6c1f03d.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e62423e8a031d6c1f03d.md new file mode 100644 index 00000000000000..d97e4c5de44f20 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e62423e8a031d6c1f03d.md @@ -0,0 +1,64 @@ +--- +id: 66b6e62423e8a031d6c1f03d +title: Step 8 +challengeType: 1 +dashedName: step-8 +--- + +# --description-- + +Now it is time to get the length of the `topic` string. + +You can use template literals inside `console` statements like this: + +```js +const developer = "Jessica"; +console.log(`Hello, my name is ${developer}.`); +``` + +Start by outputting the message `Here is an example of using the length property on the word [topic].` to the console. + +Remember to replace `[topic]` with the `topic` variable, and use proper template literal syntax as you did in the previous steps. + +Then, add a second `console.log` statement that outputs the length of the `topic` string to the console. + +# --hints-- + +You should use template literal syntax to output the message `Here is an example of using the length property on the word [topic].` to the `console`. + +```js +assert.match(code, /console\.log\(`Here\s+is\s+an\s+example\s+of\s+using\s+the\s+length\s+property\s+on\s+the\s+word\s+\$\{topic\}\.`\)/); +``` + +You should have a second `console` statement to output the length of the `topic` variable to the `console`. + +```js +assert.match(code, /console\.log\(\s*topic\.length\s*\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); +console.log(subject.length); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e80d6c3f0b329c360283.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e80d6c3f0b329c360283.md new file mode 100644 index 00000000000000..28235038635c4a --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6e80d6c3f0b329c360283.md @@ -0,0 +1,53 @@ +--- +id: 66b6e80d6c3f0b329c360283 +title: Step 9 +challengeType: 1 +dashedName: step-9 +--- + +# --description-- + +The next part of this workshop is to review accessing characters from a string. + +Start by outputting the message `Here is an example of accessing the first letter in the word [subject].` to the console. + +Remember to replace `[subject]` with the `subject` variable and use proper template literal syntax like you did in the previous steps. + +# --hints-- + +Your `console` statement should output the message `Here is an example of accessing the first letter in the word [subject].`. + +```js +assert.match(code, /console.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+first\s+letter\s+in\s+the\s+word\s+\${subject}\.`\);?/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6efddeca35833cd6f0b03.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6efddeca35833cd6f0b03.md new file mode 100644 index 00000000000000..929323c6bab08d --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6efddeca35833cd6f0b03.md @@ -0,0 +1,63 @@ +--- +id: 66b6efddeca35833cd6f0b03 +title: Step 10 +challengeType: 1 +dashedName: step-10 +--- + +# --description-- + +In the previous lecture videos, you learned how to access characters in a string like this: + +```js +const firstName = 'Jessica'; +// returns 'J' +firstName[0]; +``` + +Remember that index numbers start at `0`, so the first letter in a string will always be at index `0`. + +Start by adding another `console` statement. + +Inside the `console` statement, output the first letter of the `subject` variable using bracket notation and the correct index number. + +# --hints-- + +Your `console` statement should output the first letter of the `subject` variable using bracket notation and index `0`. + +```js +assert.match(code, /console.log\(subject\[0\]\);?/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6f586767a1534f3097353.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6f586767a1534f3097353.md new file mode 100644 index 00000000000000..6aa0986c0b7490 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6f586767a1534f3097353.md @@ -0,0 +1,63 @@ +--- +id: 66b6f586767a1534f3097353 +title: Step 11 +challengeType: 1 +dashedName: step-11 +--- + +# --description-- + +Now it is time to access the second letter of the `subject` variable. + +Start by adding a `console` statement that outputs the message `Here is an example of accessing the second letter in the word [subject].` Remember to replace `[subject]` with the actual value of the `subject` variable and use correct template literal syntax. + +Then add another `console` statement that outputs the second letter of the `subject` variable using bracket notation and the correct index number. + +# --hints-- + +Your `console` statement should output the message `Here is an example of accessing the second letter in the word [subject].`. + +```js +assert.match(code, /console.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+second\s+letter\s+in\s+the\s+word\s+\$\{subject\}\.`\);?/); +``` + +You should have another `console` statement that outputs the second letter of the `subject` variable using bracket notation index `1`. + +```js +assert.match(code, /console.log\(subject\[1\]\);?/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6f80fca500635d1e8af8d.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6f80fca500635d1e8af8d.md new file mode 100644 index 00000000000000..42a86af8017826 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6f80fca500635d1e8af8d.md @@ -0,0 +1,60 @@ +--- +id: 66b6f80fca500635d1e8af8d +title: Step 12 +challengeType: 1 +dashedName: step-12 +--- + +# --description-- + +Now it is time to access the last character of a string. + +Start by adding another `console` statement that outputs the message `Here is an example of accessing the last letter in the word [subject].` + +Remember to replace `[subject]` with the actual value of the `subject` variable and use correct template literal syntax. + +# --hints-- + +Your `console` statement should output the message `Here is an example of accessing the last letter in the word [subject].` Remember to use the correct template literal syntax. + +```js +assert.match(code, /console.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+last\s+letter\s+in\s+the\s+word\s+\${subject}\.`\);?/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +console.log(`Here is an example of accessing the second letter in the word ${subject}.`); +console.log(subject[1]); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6fdb76441c738719039fa.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6fdb76441c738719039fa.md new file mode 100644 index 00000000000000..be5cc91163cef7 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6fdb76441c738719039fa.md @@ -0,0 +1,83 @@ +--- +id: 66b6fdb76441c738719039fa +title: Step 13 +challengeType: 1 +dashedName: step-13 +--- + +# --description-- + +In the lecture videos, you learned how to access the last character in a string like this: + +```js +const firstName = "Jessica"; + +// returns 'a' +firstName[firstName.length - 1]; +``` + +`string.length - 1` will always give you the last index number for a string. + +Create a new variable called `lastCharacter` and assign it the value of the last character in the `subject` variable. + +Then, log the value of the `lastCharacter` variable to the console. + +# --hints-- + +You should have a variable called `lastCharacter`. + +```js +assert.isNotNull(lastCharacter); +``` + +You should assign the value of the last character in the `subject` variable to the `lastCharacter` variable. Refer to the example if you need help. + +```js +assert.strictEqual(lastCharacter, subject[subject.length - 1]); +``` + +You should log the value of the `lastCharacter` variable to the `console`. + +```js +assert.match(code, /console.log\(lastCharacter\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +console.log(`Here is an example of accessing the second letter in the word ${subject}.`); +console.log(subject[1]); + +console.log(`Here is an example of accessing the last letter in the word ${subject}.`); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6ffb42b88e33943788abf.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6ffb42b88e33943788abf.md new file mode 100644 index 00000000000000..6fc58f5cd98a69 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b6ffb42b88e33943788abf.md @@ -0,0 +1,75 @@ +--- +id: 66b6ffb42b88e33943788abf +title: Step 14 +challengeType: 1 +dashedName: step-14 +--- + +# --description-- + +For the last part of the workshop, you will review how to find the index position of substring in a string. Remember that a substring is a part of a string. + +Start by creating a variable called `learningIsFunSentence` and assign it the string value of `"Learning is fun."`. + +# --hints-- + +You should have a variable called `learningIsFunSentence`. + +```js +assert.isNotNull(learningIsFunSentence); +``` + +Your `learningIsFunSentence` should hold the value of a string. + +```js +assert.isString(learningIsFunSentence); +``` + +You should assign the value of `"Learning is fun."` to the variable `learningIsFunSentence`. + +```js +assert.equal(learningIsFunSentence, "Learning is fun."); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +console.log(`Here is an example of accessing the second letter in the word ${subject}.`); +console.log(subject[1]); + +console.log(`Here is an example of accessing the last letter in the word ${subject}.`); + +const lastCharacter = subject[subject.length - 1]; +console.log(lastCharacter); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7049b7709ea3a9547c79d.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7049b7709ea3a9547c79d.md new file mode 100644 index 00000000000000..a0a404020034fe --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7049b7709ea3a9547c79d.md @@ -0,0 +1,64 @@ +--- +id: 66b7049b7709ea3a9547c79d +title: Step 15 +challengeType: 1 +dashedName: step-15 +--- + +# --description-- + +The next step is to add another `console` statement that outputs the string `"Here are examples of finding the positions of substrings in the sentence."`. + +# --hints-- + +You should have a `console` statement that outputs the string `"Here are examples of finding the positions of substrings in the sentence."`. + +```js +assert.match(code, /console\.log\((['"])(Here\s+are\s+examples\s+of\s+finding\s+the\s+positions\s+of\s+substrings\s+in\s+the\s+sentence\.)\1\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +const strLength = subject.length; +console.log(strLength); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +console.log(`Here is an example of accessing the second letter in the word ${subject}.`); +console.log(subject[1]); + +console.log(`Here is an example of accessing the last letter in the word ${subject}.`); + +const lastCharacter = subject[subject.length - 1]; +console.log(lastCharacter); + +const learningIsFunSentence = "Learning is fun."; + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b70b8a611cbf3bcc5c6c5f.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b70b8a611cbf3bcc5c6c5f.md new file mode 100644 index 00000000000000..02624391eb2c77 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b70b8a611cbf3bcc5c6c5f.md @@ -0,0 +1,79 @@ +--- +id: 66b70b8a611cbf3bcc5c6c5f +title: Step 16 +challengeType: 1 +dashedName: step-16 +--- + +# --description-- + +In the previous lecture videos, you learned how to work with the `indexOf` method like this: + +```js +const sentence = "I love to learn."; + +// returns index 2 +console.log(sentence.indexOf("love")); + +// returns -1 +console.log(sentence.indexOf("hate")); +``` + +Remember that the `indexOf` method returns the index position of the first occurrence of a substring in a string. If the substring is not found, it returns `-1`. + +Add a new `console` statement that outputs the result of using the `indexOf` method on the `learningIsFunSentence` variable to find the index position of the substring `"Learning"`. + +# --hints-- + +Your `console` should use the `indexOf` method on the `learningIsFunSentence` variable to find the index position of the substring `"Learning"`. + +```js +assert.match(code, /console\.log\(\s*learningIsFunSentence\.indexOf\(\s*(['"])(Learning)\1\s*\)\s*\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +console.log(`Here is an example of accessing the second letter in the word ${subject}.`); +console.log(subject[1]); + +console.log(`Here is an example of accessing the last letter in the word ${subject}.`); + +const lastCharacter = subject[subject.length - 1]; +console.log(lastCharacter); + +const learningIsFunSentence = "Learning is fun."; + +console.log("Here are examples of finding the positions of substrings in the sentence."); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7137348cfb53fd3ec6c73.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7137348cfb53fd3ec6c73.md new file mode 100644 index 00000000000000..397d59ad73b1c9 --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7137348cfb53fd3ec6c73.md @@ -0,0 +1,77 @@ +--- +id: 66b7137348cfb53fd3ec6c73 +title: Step 17 +challengeType: 1 +dashedName: step-17 +--- + +# --description-- + +Next, you will add a new `console` statement that outputs the result of using the `indexOf` method on the `learningIsFunSentence` variable to find the position of the substring `"fun"`. + +Below that `console` statement, add a new `console` statement that outputs the result of using the `indexOf` method to find the position of the substring `"learning"`. + +Take note of what the last `console` statement outputs. + +# --hints-- + +Your `console` should output the index position of the substring `"fun"` from the `learningIsFunSentence` variable. + +```js +assert.match(code, /console\.log\(\s*learningIsFunSentence\.indexOf\(\s*(['"])(fun)\1\s*\)\s*\)/); +``` + +Your second `console` statement should output the index position of the substring `"learning"` from the `learningIsFunSentence` variable. + +```js +assert.match(code, /console\.log\(\s*learningIsFunSentence\.indexOf\(\s*(['"])(learning)\1\s*\)\s*\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +console.log(`Here is an example of accessing the second letter in the word ${subject}.`); +console.log(subject[1]); + +console.log(`Here is an example of accessing the last letter in the word ${subject}.`); + +const lastCharacter = subject[subject.length - 1]; +console.log(lastCharacter); + +const learningIsFunSentence = "Learning is fun."; + +console.log("Here are examples of finding the positions of substrings in the sentence."); + +console.log(learningIsFunSentence.indexOf("Learning")); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7142e588c4a407a51cdb6.md b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7142e588c4a407a51cdb6.md new file mode 100644 index 00000000000000..57b2e764b89ced --- /dev/null +++ b/curriculum/challenges/english/25-front-end-development/workshop-teacher-chatbot/66b7142e588c4a407a51cdb6.md @@ -0,0 +1,126 @@ +--- +id: 66b7142e588c4a407a51cdb6 +title: Step 18 +challengeType: 1 +dashedName: step-18 +--- + +# --description-- + +The last console statement outputs `-1` because the substring `"learning"` is not found in the `"Learning is fun.` sentence. + +The `indexOf` method is case-sensitive. So the substring `"learning"` is not the same as the substring `"Learning"`. + +Now that you understand how some common string methods work, you can complete the workshop by logging one last message to the `console`. + +Add a `console` statement that outputs the message `"I hope you enjoyed learning today."` to the `console`. + +And with that final message, you have completed the workshop! + +# --hints-- + +Your `console` statement should output the message `"I hope you enjoyed learning today."`. + +```js +assert.match(code, /console\.log\(\s*(['"])(I\s+hope\s+you\s+enjoyed\s+learning\s+today\.)\1\s*\)/); +``` + +# --seed-- + +## --seed-contents-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +console.log(`Here is an example of accessing the second letter in the word ${subject}.`); +console.log(subject[1]); + +console.log(`Here is an example of accessing the last letter in the word ${subject}.`); + +const lastCharacter = subject[subject.length - 1]; +console.log(lastCharacter); + +const learningIsFunSentence = "Learning is fun."; + +console.log("Here are examples of finding the positions of substrings in the sentence."); + +console.log(learningIsFunSentence.indexOf("Learning")); + +console.log(learningIsFunSentence.indexOf("fun")); +console.log(learningIsFunSentence.indexOf("learning")); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` + +# --solutions-- + +```js +console.log("Hi there!"); + +const botName = "teacherBot"; + +const greeting = `My name is ${botName}.`; +console.log(greeting); + +const subject = "JavaScript"; +const topic = "strings"; + +const sentence = `Today, you will learn about ${topic} in ${subject}.`; +console.log(sentence); + +const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`; +console.log(strLengthIntro); + +console.log(subject.length); + +console.log(`Here is an example of using the length property on the word ${topic}.`); +console.log(topic.length); + +console.log(`Here is an example of accessing the first letter in the word ${subject}.`); + +console.log(subject[0]); + +console.log(`Here is an example of accessing the second letter in the word ${subject}.`); +console.log(subject[1]); + +console.log(`Here is an example of accessing the last letter in the word ${subject}.`); + +const lastCharacter = subject[subject.length - 1]; +console.log(lastCharacter); + +const learningIsFunSentence = "Learning is fun."; + +console.log("Here are examples of finding the positions of substrings in the sentence."); + +console.log(learningIsFunSentence.indexOf("Learning")); + +console.log(learningIsFunSentence.indexOf("fun")); +console.log(learningIsFunSentence.indexOf("learning")); + +console.log("I hope you enjoyed learning today."); +``` diff --git a/curriculum/i18n-curriculum b/curriculum/i18n-curriculum index 2eeff06059955d..92292d35d9c610 160000 --- a/curriculum/i18n-curriculum +++ b/curriculum/i18n-curriculum @@ -1 +1 @@ -Subproject commit 2eeff06059955de7b87f22b111edee1a4c6395ff +Subproject commit 92292d35d9c610018d5eee1b3632ea1d4f27986e