fix(curriculum): step 78 and step 80 too strict checking fix (#55847)

This commit is contained in:
Gagan Bhullar
2024-08-20 01:29:17 -06:00
committed by GitHub
parent a49fca2ab0
commit 70be2fa4ee
2 changed files with 2 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ Inside the `animate` function, add a condition to check if the right key was pre
You should have an `if` statement that checks if the right key was pressed and if the `isCheckpointCollisionDetectionActive` is true.
```js
assert.match(code, /if\s*\(\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*\)\s*{\s*(.*?)\s*}/);
assert.match(code, /if\s*\(((\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*)|(\s*isCheckpointCollisionDetectionActive\s*&&\s*keys\.rightKey\.pressed\s*))\)\s*{\s*(.*?)\s*}/);
```
# --seed--

View File

@@ -18,7 +18,7 @@ Inside the loop, use the addition assignment operator to add 5 to the platform's
You should have a condition that checks if the left key was pressed and if `isCheckpointCollisionDetectionActive` is true.
```js
assert.match(code, /if\s*\(\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*\)\s*{\s*platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*platform\.position\.x\s*-=\s*5\s*;\s*}\s*\)\s*;?\s*}\s*else\s+if\s*\(\s*keys\.leftKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*\)\s*{.*}\s*\)\s*;?/s);
assert.match(code, /if\s*\(((\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*)|(\s*isCheckpointCollisionDetectionActive\s*&&\s*keys\.rightKey\.pressed\s*))\)\s*{\s*platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*platform\.position\.x\s*-=\s*5\s*;\s*}\s*\)\s*;?\s*}\s*else\s+if\s*\(((\s*keys\.leftKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*)|(\s*isCheckpointCollisionDetectionActive\s*&&\s*keys\.leftKey\.pressed\s*))\)\s*{.*}\s*\)\s*;?/s);
```