Unit 6 Lesson 2 - Level 8B (Chatbot)

Anyone else having problems with the test on this level?

Here’s my current project code:

I tried a few different ways to solve it, including guarding against not finding a match and, in that case, not adding anything to the result String.

Students are also having problems with the test on 8A.

The expected test result seems to match the output of the test of my code, but the error seems to be in the class they use for testing the level (ChatBotTest.Java).

On a second pass through, it looks like the problem is that there’s duplicate words with different parts of speech. The test expects the last entry to be returned when mine returns the first entry.

@a112032 Mr. Johnson-Myers - thank you for you post. I am wondering if you compared your solution’s logic with the Example solution?

The solution example works as intended. Please let us know if this helps.
Sylvia

1 Like

Interesting, thanks. I see the difference now - they return a String for multiple matches where we were returning the first match.

The message from failing the test was not very clear.

Thanks for taking the time to look at this.

1 Like

@a112032 - You are welcome. I will share you insights with the curriculum team.
Sylvia