# Build a Quiz Game - Build a Quiz Game

**URL:** <https://forum.freecodecamp.org/t/build-a-quiz-game-build-a-quiz-game/788605>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [May 12, 2026, 10:52am UTC](https://forum.freecodecamp.org/t/build-a-quiz-game-build-a-quiz-game/788605 "2026-05-12T10:52:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![User\_9621](https://avatars.discourse-cdn.com/v4/letter/u/7c8e57/32.png) [@User\_9621](https://forum.freecodecamp.org/u/User_9621)\
**Post date:** [May 12, 2026, 10:52am UTC](https://forum.freecodecamp.org/t/build-a-quiz-game-build-a-quiz-game/788605/1 "2026-05-12T10:52:04Z")

</div>

### Tell us what’s happening:

My tests 11, 13 and 14 keep failing and I can’t seem to find the issue.  
Can someone help me out?

### Your code so far

```js
const questions = [];

const question1 = {
  category: "MCQ", 
  question: "What is your name?", 
  choices:["Ajak", "Garang", "Mathiang"],
  answer: "Ajak"
}
const question2 = {
  category: "MCQ", 
  question: "Which school do you go to?", 
  choices:["JKUAT", "USIU", "KU"],
  answer: "USIU"
}
const question3 = {
  category: "MCQ", 
  question: "Which sport do you play?", 
  choices:["Basketball", "Football", "Netball"],
  answer: "Basketball"
}
const question4 = {
  category: "MCQ", 
  question: "Who is your role model?", 
  choices:["Jordan", "Lebron", "Giannis"],
  answer: "Giannis"
}
const question5 = {
  category: "MCQ", 
  question: "Where do you live?", 
  choices:["School", "Qwetu", "Queens"],
  answer: "Qwetu"
}
questions.push(question1, question2, question3, question4, question5);
// console.log(questions)

function getRandomQuestion(questions){
  const random = Math.floor(Math.random()*questions.length)
  return questions[random]
}
// console.log(getRandomQuestion(questions))
function getRandomComputerChoice(choices){
  const random = Math.floor(Math.random()* choices.length)
  return choices[random]
}
// console.log(getRandomComputerChoice(questions[1].choices))

function getResults(questionsObj, compChoice){
if(questionsObj.answer === compChoice){
  return "The computer's choice is correct!"
}else{
  return `The computer's choice is wrong. The correct answer is ${questionsObj.answer}`
}
}

```

### Your browser information:

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0`

### Challenge Information:

Build a Quiz Game - Build a Quiz Game

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-v9/lab-quiz-game/lab-quiz-game)**
>
> Learn to Code — For Free

Github Link: [freeCodeCamp/curriculum/challenges/english/blocks/lab-quiz-game/66f17db06803d11a1bd19a20.md at main · freeCodeCamp/freeCodeCamp · GitHub](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/lab-quiz-game/66f17db06803d11a1bd19a20.md)

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [May 12, 2026, 11:53am UTC](https://forum.freecodecamp.org/t/build-a-quiz-game-build-a-quiz-game/788605/2 "2026-05-12T11:53:40Z")

</div>

Hi @User_9621,

Please check the message you return when the computer choice is not correct. It should match _exactly_ to the instructions. Otherwise, good job.

Happy coding!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [June 9, 2026, 11:54am UTC](https://forum.freecodecamp.org/t/build-a-quiz-game-build-a-quiz-game/788605/3 "2026-06-09T11:54:38Z")

</div>

Closed on June 9, 2026, 11:54am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
