Skip to content

Commit 98f2170

Browse files
committed
Add fifth and final mini-quiz
1 parent c3f22c9 commit 98f2170

File tree

6 files changed

+27
-52
lines changed

6 files changed

+27
-52
lines changed

pages/lessons/projects/4.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ be tested and understood by humans writing these tests.
665665
Easy to test!
666666
- `imageSVGOf()` just concatenates three values into a string. Also easy to
667667
test.
668-
- `finalJSON` also just concatenates multiple values into a string, and like the
668+
- `finalJSON()` also just concatenates multiple values into a string, and like the
669669
method says, it creates a string that represents the final JSON blob.
670670
- Notice that none of these methods does the Base64 encoding, which immediately
671671
makes it impossible for a human to interpret the results and that makes for a
@@ -902,7 +902,7 @@ while refactoring to make sure we didn't break things along the way, and it's
902902
helpful at the end to ensure the `tokenURI()` method continues to work without
903903
fail when code changes.
904904

905-
<SideDrawer buttonText="Checkpoint Questions" title="Testing the SVG">
905+
<SideDrawer buttonText="Checkpoint Questions" title="Refactoring Code and Testing SVG">
906906
<Question question="lesson-4/5-SVG-test/Q1" />
907907
<Question question="lesson-4/5-SVG-test/Q2" />
908908
<Question question="lesson-4/5-SVG-test/Q3" />
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
{
2-
"question": "",
2+
"question": "Refactoring the original 'tokenURI()' method into helper functions improves:",
33
"options": [
44
{
5-
"answer": "",
5+
"answer": "code readability",
66
"correct": true
77
},
88
{
9-
"answer": ""
9+
"answer": "performance optimization"
1010
},
1111
{
12-
"answer": "",
13-
"correct": true
14-
},
15-
{
16-
"answer": ""
12+
"answer": "maintaining backward compatibility"
1713
},
1814
{
19-
"answer": ""
15+
"answer": "ease of testing",
16+
"correct": true
2017
}
2118
]
2219
}
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"question": "",
2+
"question": "Why is the 'imageSVGOf()' method is easy to test?",
33
"options": [
44
{
5-
"answer": "",
6-
"correct": true
5+
"answer": "Because it doesn't perform any concatenation."
76
},
87
{
9-
"answer": ""
8+
"answer": "It simply calls other helper methods."
109
},
1110
{
12-
"answer": "",
13-
"correct": true
11+
"answer": "It just returns the image of the SVG."
1412
},
1513
{
16-
"answer": ""
17-
},
18-
{
19-
"answer": ""
14+
"answer": "It only concatenates three values into a string.",
15+
"correct": true
2016
}
2117
]
2218
}
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"question": "",
2+
"question": "What do 'tierNameOf()', 'imageSVGOf()', and 'finalJSON()' methods do?",
33
"options": [
44
{
5-
"answer": "",
6-
"correct": true
5+
"answer": "Break down the contract deployment into stages"
76
},
87
{
9-
"answer": ""
8+
"answer": "Handle token minting more easily"
109
},
1110
{
12-
"answer": "",
11+
"answer": "Generate SVG images and token metadata",
1312
"correct": true
1413
},
1514
{
16-
"answer": ""
17-
},
18-
{
19-
"answer": ""
15+
"answer": "Create a token wallet"
2016
}
2117
]
2218
}
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
{
2-
"question": "",
2+
"question": "What could happen if tests were not run after refactoring the contract?",
33
"options": [
44
{
5-
"answer": "",
6-
"correct": true
7-
},
8-
{
9-
"answer": ""
5+
"answer": "The contract would consume more gas"
106
},
117
{
12-
"answer": "",
8+
"answer": "Undetected bugs and issues could be introduced",
139
"correct": true
1410
},
1511
{
16-
"answer": ""
17-
},
18-
{
19-
"answer": ""
12+
"answer": "The contract would be reverted to a previous state"
2013
}
2114
]
2215
}
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
{
2-
"question": "",
2+
"question": "What is the purpose of the 'finalJSON()' method in the refactored contract?",
33
"options": [
44
{
5-
"answer": "",
5+
"answer": "To concatenate the JSON properties for the final JSON blob.",
66
"correct": true
77
},
88
{
9-
"answer": ""
9+
"answer": "To encode the SVG strings into the conclusive Base64 format."
1010
},
1111
{
12-
"answer": "",
13-
"correct": true
14-
},
15-
{
16-
"answer": ""
17-
},
18-
{
19-
"answer": ""
12+
"answer": "To return the complete SVG image with all the final attributes."
2013
}
2114
]
2215
}

0 commit comments

Comments
 (0)