# Pet Quiz Help needed

**URL:** <https://discourse.codecombat.com/t/pet-quiz-help-needed/33790>\
**Category:** Level Help\
**Created:** [September 11, 2022, 4:18pm UTC](https://discourse.codecombat.com/t/pet-quiz-help-needed/33790 "2022-09-11T16:18:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Turnerkid](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/turnerkid/32/29546_2.png) [@Turnerkid](https://discourse.codecombat.com/u/Turnerkid)\
**Post date:** [September 11, 2022, 4:18pm UTC](https://discourse.codecombat.com/t/pet-quiz-help-needed/33790/1 "2022-09-11T16:18:29Z")

</div>

I don’t know what is the problem can someone help me out here.

// Write an event handler function called onHear

// Complete the onHear function  
function onHear(event) {  
// The pet should say something in onHear.  
pet.on(“spawn”, onSpawn);  
pet.on(“hear”, onHear);  
pet.say(“yes”);  
pet.say(“yes”);  
pet.say(“5”);  
pet.say(“Orange and White”);  
pet.say (“Anything Meaty”)  
}  
hero.say(“Do you understand me?”);  
pet.say(“yes”);  
hero.say(“Are you a cougar?”);  
pet.say(“yes”);  
hero.say(“How old are you?”);  
pet.say(“5”);  
// Ask two more questions.  
hero.say(“What color is your fur”);  
pet.say(“Orange and White”);  
hero.say(“What food do you like to eat”);  
pet.say (“Anything Meaty”)

---

<div class="post-metadata">

**Author:** ![Aya](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/aya/32/42680_2.png) [@Aya](https://discourse.codecombat.com/u/Aya)\
**Post date:** [September 11, 2022, 5:49pm UTC](https://discourse.codecombat.com/t/pet-quiz-help-needed/33790/2 "2022-09-11T17:49:28Z")

</div>

The aim of this level is to use the `pet.on("activity", nameOfFunction)`

The function should have only one statement, which is the pet.say(" ")

So thats 2 lines of code for the function

The line under that should be basically the pet.on method where the activity is “hear” and the nameOfFunction is onHear (like i explained up)

Then write down the five questions your hero is gonna say without using pet.say, just five lines of code for the questions

In total 2 lines for the function one line for the pet.on and 5 lines for the questions

PS. Please format your code the next time you want to post it here using \</\> in the editor, thanks 🙂

---

<div class="post-metadata">

**Author:** ![Turnerkid](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/turnerkid/32/29546_2.png) [@Turnerkid](https://discourse.codecombat.com/u/Turnerkid)\
**Post date:** [September 24, 2022, 11:10pm UTC](https://discourse.codecombat.com/t/pet-quiz-help-needed/33790/3 "2022-09-24T23:10:21Z")

</div>

I’m not sure how to format it.

---

<div class="post-metadata">

**Author:** ![Aya](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/aya/32/42680_2.png) [@Aya](https://discourse.codecombat.com/u/Aya)\
**Post date:** [September 25, 2022, 4:56am UTC](https://discourse.codecombat.com/t/pet-quiz-help-needed/33790/4 "2022-09-25T04:56:14Z")

</div>

using this button:

 ![Screenshot 2021-08-24 12.35.14](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/3/c/3c215fa51daac29c4dee042c92f597e6b9a39662.png)

---

<div class="post-metadata">

**Author:** ![MarmiteOnToast](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/marmiteontoast/32/46649_2.png) [@MarmiteOnToast](https://discourse.codecombat.com/u/MarmiteOnToast)\
**Post date:** [September 25, 2022, 6:37am UTC](https://discourse.codecombat.com/t/pet-quiz-help-needed/33790/5 "2022-09-25T06:37:31Z")

</div>

Highlight the code, then:

> [@Aya](#):
>
> using this button:
> 
> ![Screenshot 2021-08-24 12.35.14](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/3/c/3c215fa51daac29c4dee042c92f597e6b9a39662.png)
