Skip to content

Commit 02f6e1a

Browse files
Ksound22jdwilkin4majestic-owl448Sembauke
authored
feat: adding recipes tracker workshop (freeCodeCamp#56456)
Co-authored-by: Jessica Wilkins <[email protected]> Co-authored-by: Ilenia <[email protected]> Co-authored-by: Sem Bauke <[email protected]>
1 parent f3f77d7 commit 02f6e1a

File tree

16 files changed

+1550
-1
lines changed

16 files changed

+1550
-1
lines changed

client/i18n/locales/english/intro.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,12 @@
22222222
"intro": ["Test what you've learned in this quiz on JavaScript Arrays."]
22232223
},
22242224
"dvnt": { "title": "164", "intro": [] },
2225-
"ekdb": { "title": "165", "intro": [] },
2225+
"workshop-recipe-tracker": {
2226+
"title": "Build a Recipe Tracker",
2227+
"intro": [
2228+
"In this workshop, you will review working with JavaScript objects by building a recipe tracker."
2229+
]
2230+
},
22262231
"lab-quiz-game": {
22272232
"title": "Build a Quiz Game",
22282233
"intro": ["For this lab, you will build a quiz game."]
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 Recipe Tracker
3+
block: workshop-recipe-tracker
4+
superBlock: front-end-development
5+
---
6+
7+
## Introduction to the Build a Recipe Tracker
8+
9+
This is a test for the new project-based curriculum.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "Build a Recipe Tracker",
3+
"isUpcomingChange": true,
4+
"usesMultifileEditor": true,
5+
"hasEditableBoundaries": true,
6+
"dashedName": "workshop-recipe-tracker",
7+
"order": 165,
8+
"superBlock": "front-end-development",
9+
"challengeOrder": [
10+
{
11+
"id": "66fbcdfed6848e48947dbbc9",
12+
"title": "Step 1"
13+
},
14+
{
15+
"id": "66fbcf750a62784cf11f562d",
16+
"title": "Step 2"
17+
},
18+
{
19+
"id": "66ff02792b3042a2b811f475",
20+
"title": "Step 3"
21+
},
22+
{
23+
"id": "66fbcf750a62784cf11f562e",
24+
"title": "Step 4"
25+
},
26+
{
27+
"id": "670e4f45f7116c0f216a5177",
28+
"title": "Step 5"
29+
},
30+
{
31+
"id": "66fbcf750a62784cf11f5630",
32+
"title": "Step 6"
33+
},
34+
{
35+
"id": "66fbcf750a62784cf11f5631",
36+
"title": "Step 7"
37+
},
38+
{
39+
"id": "66fbcf750a62784cf11f5632",
40+
"title": "Step 8"
41+
},
42+
{
43+
"id": "66fbcf750a62784cf11f5633",
44+
"title": "Step 9"
45+
},
46+
{
47+
"id": "66fbcf750a62784cf11f5634",
48+
"title": "Step 10"
49+
},
50+
{
51+
"id": "66fbcf750a62784cf11f5635",
52+
"title": "Step 11"
53+
},
54+
{
55+
"id": "66fbcf750a62784cf11f5636",
56+
"title": "Step 12"
57+
},
58+
{
59+
"id": "66fbcf750a62784cf11f5637",
60+
"title": "Step 13"
61+
}
62+
],
63+
"helpCategory": "JavaScript",
64+
"blockType": "workshop"
65+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
id: 66fbcdfed6848e48947dbbc9
3+
title: Step 1
4+
challengeType: 1
5+
dashedName: step-1
6+
---
7+
8+
# --description--
9+
10+
In this workshop, you will create a recipe tracker using JavaScript objects.
11+
12+
Start by creating an empty array named `recipes`. This is the array you'll push the recipe objects into later.
13+
14+
# --hints--
15+
16+
You should create an array named `recipes`.
17+
18+
```js
19+
assert.isArray(recipes)
20+
```
21+
22+
Your `recipes` array should be empty.
23+
24+
```js
25+
assert.isEmpty(recipes)
26+
```
27+
28+
# --seed--
29+
30+
## --seed-contents--
31+
32+
```js
33+
--fcc-editable-region--
34+
35+
--fcc-editable-region--
36+
```
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
id: 66fbcf750a62784cf11f562d
3+
title: Step 2
4+
challengeType: 1
5+
dashedName: step-2
6+
---
7+
8+
# --description--
9+
10+
Create an object named `recipe1`. Inside the `recipe1` object, create a `name` property with the value `"Spaghetti Carbonara"`.
11+
12+
Also inside the `recipe1` object, create an `ingredients` property with an array as the value. The array should have `spaghetti`, `Parmesan cheese`, `pancetta`, and `black pepper` inside it.
13+
14+
Create another `ratings` property with array value. The array should have `4`, `5`, `4`, and `5` inside it.
15+
16+
# --hints--
17+
18+
You should create an object named `recipe1`.
19+
20+
```js
21+
assert.isObject(recipe1)
22+
```
23+
24+
Your `recipe1` object should have a `name` property.
25+
26+
```js
27+
assert.property(recipe1, 'name');
28+
```
29+
30+
Your `name` property should be set to `Spaghetti Carbonara`.
31+
32+
```js
33+
assert.equal(recipe1.name, 'Spaghetti Carbonara');
34+
```
35+
36+
Your `recipe1` object should have an `ingredients` property.
37+
38+
```js
39+
assert.property(recipe1, 'ingredients');
40+
```
41+
42+
Your `ingredients` property should have an array value.
43+
44+
```js
45+
assert.isArray(recipe1.ingredients)
46+
```
47+
48+
The array value of your `ingredients` property should have `spaghetti`, `Parmesan cheese`, `pancetta`, and `black pepper` in it.
49+
50+
```js
51+
assert.deepEqual(recipe1.ingredients, ["spaghetti", "Parmesan cheese", "pancetta", "black pepper"]);
52+
```
53+
54+
Your `recipe1` object should have a `ratings` property.
55+
56+
```js
57+
assert.property(recipe1, "ratings");
58+
```
59+
60+
Your `ratings` property should have an array value.
61+
62+
```js
63+
assert.isArray(recipe1.ratings)
64+
```
65+
66+
The array value of your `ratings` property should have `4`, `5`, `4`, and `5` in it.
67+
68+
```js
69+
assert.deepEqual(recipe1.ratings, [4, 5, 4, 5]);
70+
```
71+
72+
# --seed--
73+
74+
## --seed-contents--
75+
76+
```js
77+
const recipes = [];
78+
--fcc-editable-region--
79+
80+
--fcc-editable-region--
81+
```
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
id: 66fbcf750a62784cf11f562e
3+
title: Step 4
4+
challengeType: 1
5+
dashedName: step-4
6+
---
7+
8+
# --description--
9+
10+
Create another `recipe2` object with the following properties and values:
11+
12+
| Key | Value |
13+
| ----------- | ------- |
14+
| `name` | `Chicken Curry` |
15+
| `ingredients` | `["chicken breast", "coconut milk", "curry powder", "onion", "garlic"]` |
16+
| `ratings` | `[4, 5, 5, 5]` |
17+
| `cookingTime` | `42` |
18+
| `totalIngredients` | `null` |
19+
| `difficultyLevel` | `''` |
20+
| `averageRating` | `null` |
21+
22+
# --hints--
23+
24+
You should create an object named `recipe2`.
25+
26+
```js
27+
assert.isObject(recipe2)
28+
```
29+
30+
Your `recipe2` object should have a `name` property.
31+
32+
```js
33+
assert.property(recipe2, "name");
34+
```
35+
36+
Your `name` property should be set to `Chicken Curry`.
37+
38+
```js
39+
assert.equal(recipe2.name, "Chicken Curry");
40+
```
41+
42+
Your `recipe2` object should have an `ingredients` property.
43+
44+
```js
45+
assert.property(recipe2, "ingredients");
46+
```
47+
48+
Your `ingredients` property should have an array value.
49+
50+
```js
51+
assert.isArray(recipe2.ingredients)
52+
```
53+
54+
The array value of your `ingredients` property should have `chicken breast`, `coconut milk`, `curry powder`, `onion` and `garlic` in it.
55+
56+
```js
57+
assert.deepEqual(recipe2.ingredients, ["chicken breast", "coconut milk", "curry powder", "onion", "garlic"]);
58+
```
59+
60+
Your `recipe2` object should have a `ratings` property.
61+
62+
```js
63+
assert.property(recipe2, "ratings");
64+
```
65+
66+
Your `ratings` property should have an array value.
67+
68+
```js
69+
assert.isArray(recipe2.ratings)
70+
```
71+
72+
The array value of your `ratings` property should have `4`, `5`, `5`, and `5` in it.
73+
74+
```js
75+
assert.deepEqual(recipe2.ratings, [4, 5, 5, 5]);
76+
```
77+
78+
Your `recipe2` object should have a `cookingTime` property.
79+
80+
```js
81+
assert.property(recipe2, "cookingTime");
82+
```
83+
84+
Your `cookingTime` property value should be a number.
85+
86+
```js
87+
assert.isNumber(recipe2.cookingTime);
88+
```
89+
90+
Your `cookingTime` property should be set to `42`.
91+
92+
```js
93+
assert.equal(recipe2.cookingTime, 42);
94+
```
95+
96+
Your `recipe2` object should have a `totalIngredients` property.
97+
98+
```js
99+
assert.property(recipe2, "totalIngredients");
100+
```
101+
102+
Your `totalIngredients` property should be set to `null`.
103+
104+
```js
105+
assert.isNull(recipe2.totalIngredients);
106+
```
107+
108+
Your `recipe2` object should have a `difficultyLevel` property.
109+
110+
```js
111+
assert.property(recipe2, "difficultyLevel");
112+
```
113+
114+
Your `difficultyLevel` property should be set to an empty string.
115+
116+
```js
117+
assert.deepEqual(recipe2.difficultyLevel, "");
118+
```
119+
120+
Your `recipe2` object should have an `averageRating` property.
121+
122+
```js
123+
assert.property(recipe2, "averageRating");
124+
```
125+
126+
Your `averageRating` property should be set to `null`.
127+
128+
```js
129+
assert.isNull(recipe2.averageRating);
130+
```
131+
132+
# --seed--
133+
134+
## --seed-contents--
135+
136+
```js
137+
const recipes = [];
138+
139+
const recipe1 = {
140+
name: 'Spaghetti Carbonara',
141+
ingredients: ['spaghetti', 'Parmesan cheese', 'pancetta', 'black pepper'],
142+
cookingTime: 22,
143+
totalIngredients: null,
144+
difficultyLevel: '',
145+
ratings: [4, 5, 4, 5],
146+
averageRating: null,
147+
};
148+
149+
--fcc-editable-region--
150+
151+
--fcc-editable-region--
152+
```

0 commit comments

Comments
 (0)