From db2adaee3da130d5d147a7dc0b71dff0e2c4f85e Mon Sep 17 00:00:00 2001 From: c0d1ng_ma5ter Date: Fri, 21 Mar 2025 10:36:21 -0600 Subject: [PATCH] fix(curriculum): Clarify quiz game instructions and tests (#59355) Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> --- .../lab-quiz-game/66f17db06803d11a1bd19a20.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/25-front-end-development/lab-quiz-game/66f17db06803d11a1bd19a20.md b/curriculum/challenges/english/25-front-end-development/lab-quiz-game/66f17db06803d11a1bd19a20.md index df9da32b087..dfc9a4e3112 100644 --- a/curriculum/challenges/english/25-front-end-development/lab-quiz-game/66f17db06803d11a1bd19a20.md +++ b/curriculum/challenges/english/25-front-end-development/lab-quiz-game/66f17db06803d11a1bd19a20.md @@ -19,7 +19,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab 1. The `answer` key should have the value of a string, representing the correct answer to the question. Also, the value of `answer` should be included in the `choices` array. 1. You should have a function named `getRandomQuestion` that takes an array of questions as a parameter and returns a random question object from the array. 1. You should have a function named `getRandomComputerChoice` that takes the array of the available choices as a parameter, and returns a random answer to the selected question. -1. You should have a function named `getResults` that takes the selected question object and the computer choice as its parameters and returns `The computer's choice is correct!` if the answer is correct. Otherwise, it returns `The computer's choice is wrong. The correct answer is: `, where `` is the value of the correct answer to the chosen question. +1. You should have a function named `getResults` that takes the question object as the first parameter and the computer's choice as the second parameter. The function should return `The computer's choice is correct!` if the answer is correct. Otherwise, it returns `The computer's choice is wrong. The correct answer is: `, where `` is the value of the correct answer to the chosen question. # --hints-- @@ -108,6 +108,13 @@ You should have a function named `getResults`. assert.isFunction(getResults); ``` +Your `getResults` function should take the question object as the first parameter and the computer's choice as the second parameter. + +```js +assert.equal(getResults(questions[0], questions[0].answer), `The computer's choice is correct!`); +assert.notEqual(getResults(questions[0].answer, questions[0]), `The computer's choice is correct!`); +``` + If the computer choice matches the answer, `getResults` should return `The computer's choice is correct!` ```js