fix(curriculum): fix Building a Dice Game - Step 14 - passing with incorrect code (#57513)

Co-authored-by: Naomi <accounts+github@nhcarrigan.com>
This commit is contained in:
Duong The Pham
2024-12-14 19:48:31 +07:00
committed by GitHub
parent b7b2cad1eb
commit 9c781da63b

View File

@@ -56,13 +56,18 @@ assert.strictEqual(scoreSpans[3].innerText, ", score = 30");
If no straight is rolled, your `checkForStraights` function should enable the final radio button, set the value to `0`, and update the displayed text to `, score = 0`.
```js
resetRadioOptions();
checkForStraights([1,1,1,1,1]);
assert.isTrue(scoreInputs[3].disabled);
assert.isTrue(scoreInputs[4].disabled);
assert.isFalse(scoreInputs[5].disabled);
assert.strictEqual(scoreInputs[5].value, "0");
assert.strictEqual(scoreSpans[5].innerText, ", score = 0");
const assertNoStraight = (_diceValuesArr) => {
resetRadioOptions();
checkForStraights(_diceValuesArr);
assert.isTrue(scoreInputs[3].disabled);
assert.isTrue(scoreInputs[4].disabled);
assert.isFalse(scoreInputs[5].disabled);
assert.strictEqual(scoreInputs[5].value, "0");
assert.strictEqual(scoreSpans[5].innerText, ", score = 0");
}
assertNoStraight([1,1,1,1,1]);
assertNoStraight([1,1,4,4,4]);
```
You should call the `checkForStraights` function when the `rollDiceBtn` is clicked.