Skip to content

Commit cb9f3a1

Browse files
jdwilkin4SembaukeKsound22
authored
feat(curriculum): adding teacher bot workshop (freeCodeCamp#55870)
Co-authored-by: Sem Bauke <[email protected]> Co-authored-by: Kolade Chris <[email protected]>
1 parent bb9e28f commit cb9f3a1

21 files changed

+1325
-1
lines changed

client/i18n/locales/english/intro.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,13 @@
18801880
"yskn": { "title": "134", "intro": [] },
18811881
"tpni": { "title": "135", "intro": [] },
18821882
"hoec": { "title": "136", "intro": [] },
1883-
"cygu": { "title": "137", "intro": [] },
1883+
"workshop-teacher-chatbot": {
1884+
"title": "Build a Teacher Chatbot",
1885+
"intro": [
1886+
"In this workshop, you will continue to learn more about JavaScript strings by building a chatbot.",
1887+
"You will learn how to work with template literals, and the <code>indexOf</code> method."
1888+
]
1889+
},
18841890
"axgb": { "title": "138", "intro": [] },
18851891
"rwac": { "title": "139", "intro": [] },
18861892
"uzjg": { "title": "140", "intro": [] },
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Introduction to the Build a Teacher Chatbot
3+
block: workshop-teacher-chatbot
4+
superBlock: front-end-development
5+
---
6+
7+
## Introduction to the Build a Teacher Chatbot
8+
9+
This is a test for the new project-based curriculum.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"name": "Build a Teacher Chatbot",
3+
"blockType": "workshop",
4+
"isUpcomingChange": true,
5+
"usesMultifileEditor": true,
6+
"hasEditableBoundaries": true,
7+
"dashedName": "workshop-teacher-chatbot",
8+
"order": 137,
9+
"superBlock": "front-end-development",
10+
"challengeOrder": [
11+
{
12+
"id": "66b102ee0bdbad34a9f85ba0",
13+
"title": "Step 1"
14+
},
15+
{
16+
"id": "66b5928b86e907fdfbf34e56",
17+
"title": "Step 2"
18+
},
19+
{
20+
"id": "66b59829dba144ff1351220f",
21+
"title": "Step 3"
22+
},
23+
{
24+
"id": "66b59b12a745e10011158f7b",
25+
"title": "Step 4"
26+
},
27+
{
28+
"id": "66b59be6ab830800c4df9146",
29+
"title": "Step 5"
30+
},
31+
{
32+
"id": "66b6d482bbb9e12f2e5ee1ae",
33+
"title": "Step 6"
34+
},
35+
{
36+
"id": "66b6e39031393e30f2c48d0f",
37+
"title": "Step 7"
38+
},
39+
{
40+
"id": "66b6e62423e8a031d6c1f03d",
41+
"title": "Step 8"
42+
},
43+
{
44+
"id": "66b6e80d6c3f0b329c360283",
45+
"title": "Step 9"
46+
},
47+
{
48+
"id": "66b6efddeca35833cd6f0b03",
49+
"title": "Step 10"
50+
},
51+
{
52+
"id": "66b6f586767a1534f3097353",
53+
"title": "Step 11"
54+
},
55+
{
56+
"id": "66b6f80fca500635d1e8af8d",
57+
"title": "Step 12"
58+
},
59+
{
60+
"id": "66b6fdb76441c738719039fa",
61+
"title": "Step 13"
62+
},
63+
{
64+
"id": "66b6ffb42b88e33943788abf",
65+
"title": "Step 14"
66+
},
67+
{
68+
"id": "66b7049b7709ea3a9547c79d",
69+
"title": "Step 15"
70+
},
71+
{
72+
"id": "66b70b8a611cbf3bcc5c6c5f",
73+
"title": "Step 16"
74+
},
75+
{
76+
"id": "66b7137348cfb53fd3ec6c73",
77+
"title": "Step 17"
78+
},
79+
{
80+
"id": "66b7142e588c4a407a51cdb6",
81+
"title": "Step 18"
82+
}
83+
],
84+
"helpCategory": "JavaScript"
85+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
id: 66b102ee0bdbad34a9f85ba0
3+
title: Step 1
4+
challengeType: 1
5+
dashedName: step-1
6+
---
7+
8+
# --description--
9+
10+
In this workshop, you are going to continue learning about strings by building a Teacher Chatbot.
11+
12+
To begin, add a `console` statement, with the message of `"Hi there!"`.
13+
14+
# --hints--
15+
16+
You should have a `console` statement.
17+
18+
```js
19+
assert.match(code, /console\.log(.*)/);
20+
```
21+
22+
Your console statement should output the message `"Hi there!"`.
23+
24+
```js
25+
assert.match(code, /console\.log\((['"])(Hi\s+there!)\1\)/);
26+
```
27+
28+
# --seed--
29+
30+
## --seed-contents--
31+
32+
```js
33+
--fcc-editable-region--
34+
35+
--fcc-editable-region--
36+
```
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: 66b5928b86e907fdfbf34e56
3+
title: Step 2
4+
challengeType: 1
5+
dashedName: step-2
6+
---
7+
8+
# --description--
9+
10+
Now it is time to set the bot's name.
11+
12+
Create a variable called `botName` and assign it the string value of `"teacherBot"`.
13+
14+
# --hints--
15+
16+
You should have a variable called `botName`.
17+
18+
```js
19+
assert.isNotNull(botName);
20+
```
21+
22+
Your `botName` variable should be a string.
23+
24+
```js
25+
assert.isString(botName);
26+
```
27+
28+
Your `botName` variable should have the value of `"teacherBot"`.
29+
30+
```js
31+
assert.strictEqual(botName, "teacherBot");
32+
```
33+
34+
# --seed--
35+
36+
## --seed-contents--
37+
38+
```js
39+
console.log("Hi there!");
40+
41+
--fcc-editable-region--
42+
43+
--fcc-editable-region--
44+
```
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
id: 66b59829dba144ff1351220f
3+
title: Step 3
4+
challengeType: 1
5+
dashedName: step-3
6+
---
7+
8+
# --description--
9+
10+
Now it is time to create a greeting using the `botName` variable.
11+
12+
In the previous lecture videos, you learned how to concatenate strings using template literals like this:
13+
14+
```js
15+
const name = "John";
16+
17+
// "Hello, John!"
18+
`Hello, ${name}!`;
19+
```
20+
21+
Start by creating a variable called `greeting`.
22+
23+
Next, using template literal syntax, assign a string that says `My name is`, followed by the `botName` variable, and ending with a period (`.`).
24+
25+
Finally, log the `greeting` variable to the console.
26+
27+
# --hints--
28+
29+
You should have a variable called `greeting`.
30+
31+
```js
32+
assert.isNotNull(greeting);
33+
```
34+
35+
You should assign a string to your `greeting` variable.
36+
37+
```js
38+
assert.isString(greeting);
39+
```
40+
41+
You should use template literals to concatenate the string `My name is` with the `botName` variable followed by a period (`.`).
42+
43+
```js
44+
assert.equal(greeting, "My name is teacherBot.");
45+
```
46+
47+
You should have a `console` statement that logs the `greeting` variable to the console.
48+
49+
```js
50+
assert.match(code, /console.log\(.*greeting.*\)/);
51+
```
52+
53+
# --seed--
54+
55+
## --seed-contents--
56+
57+
```js
58+
console.log("Hi there!");
59+
60+
const botName = "teacherBot";
61+
62+
--fcc-editable-region--
63+
64+
--fcc-editable-region--
65+
```
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
id: 66b59b12a745e10011158f7b
3+
title: Step 4
4+
challengeType: 1
5+
dashedName: step-4
6+
---
7+
8+
# --description--
9+
10+
The next step is to create a few more variables that will be used in future bot messages.
11+
12+
Create a variable called `subject` and assign it the string value `"JavaScript"`.
13+
14+
Then create a variable called `topic` and assign it the string value `"strings"`.
15+
16+
# --hints--
17+
18+
You should have a variable called `subject`.
19+
20+
```js
21+
assert.isNotNull(subject);
22+
```
23+
24+
You should assign a string to your `subject` variable.
25+
26+
```js
27+
assert.isString(subject);
28+
```
29+
30+
You should assign the string `"JavaScript"` to your `subject` variable.
31+
32+
```js
33+
assert.equal(subject, "JavaScript");
34+
```
35+
36+
You should have a variable called `topic`.
37+
38+
```js
39+
assert.isNotNull(topic);
40+
```
41+
42+
You should assign a string to your `topic` variable.
43+
44+
```js
45+
assert.isString(topic);
46+
```
47+
48+
You should assign the string `"strings"` to your `topic` variable.
49+
50+
```js
51+
assert.equal(topic, "strings");
52+
```
53+
54+
# --seed--
55+
56+
## --seed-contents--
57+
58+
```js
59+
console.log("Hi there!");
60+
61+
const botName = "teacherBot";
62+
63+
const greeting = `My name is ${botName}.`;
64+
console.log(greeting);
65+
66+
--fcc-editable-region--
67+
68+
--fcc-editable-region--
69+
```

0 commit comments

Comments
 (0)