Hey student-
I may be a little late entering the discussion about fungus gnats.....
But there are two surefire ways to get rid if them for good if they are to return:
One way is to buy those
mosquito dunks they sell at any hardware store, mix per instructions, and apply to the soil during your next plain watering feeding. I have used these several times in soil and hydro rez's, works 100%, no side effects, although I'm not sure about the long term effects of using such. *twitch* *twitch*
Another way is to apply any pyrethrum-based insecticide. It has a half life of only 15 mins, so you can apply this stuff on the regs up til the day you harvest. It kills any undesirable visitor on contact, although it lacks the staying power mosquito dunks have. Another drawback is that it lacks the ability to penetrate the soil to kill the larvae.
OH YEAH-
Neem oil. That's another way. Good and safe. I'm not editing this.
There. Now you have a few ways to manage those buggers.