This is a common confusion. See the Tips for the "Adj. Intro" skill on the Duolingo website. Study everything under the "Summary of Simple Phrase Structures" heading.
Also, here's a link to the notes for many of the course skills on one web page:
This is the third time I've gone through this part of the course. In the past, I've found links to tips and notes helpful, because users who access the course through the app have no way of knowing they even exist. Finding links in the comment section has been invaluable, however, the links of yours that i have clicked on all take me to the menu screen, not to the tips and notes. Honestly, repeating this part of the course 3 times now has been helpful, but these links you have posted aren't working for me. Im not sure why. You have appeared agitated in some threads that people don't seem to be using them. This may explain why.
You can spell it either way. The one yod is traditional, and if you have nikkud you have to use one yod. The two yod version is what it called "ktiv maleh" where we add a few letters as a hint for pronunciation to compensate for the missing nikkud.
In this case the extra yod is used as a hint that the nun has a hirik and thus the word is pronounced Ag-vah-ni-yah rather than Ag-van-yah (which is a rather common mispronunciation)
I used two yods this time, and was told it was a "typo" and I should have used one. Other times I have used one yod, and was told that was a typo and I should have used two. I have absolutely no idea when DL expects "עגבניה" to have one yod and when to have two. It almost seems random. :-(
It's not technically random, but it is effectively random. Duolingo is not some artificial intelligence that understands Hebrew. Instead, it has a list of correct translations that the creators of the tree for a particular language typed in. If for one sentence they typed עגבניה and for another they typed עגבנייה, then that is what you get. It's not Duolingo that is random, it's the people.