I can't be certain of the chemical involved here as there is more than one possibility.
My first choice would be phenylthiocarbamide (PTC), which fits in with what Catso said. PTC powder can be either tasteless or very bitter to those genetically predisposed. PTC is soluble in water and polar organic solvents and you may have tasted the powder dissolved in water. Pregnancy however, is not a factor in the ability to taste the chemical.
Another good contender is 6-n-propylthiouracil (PROP) which has the novel property of being able to distinguish between "tasters" and "supertasters". This substance in solution can either taste very acrid or be as tasteless as water depending on a person's genetic profile. Supertasters usually have an aversion to grapefruit juice.
Naringin, which is the bitter component of grapefruit juice, also has similar properties in the pure form - it's taste can vary between slightly bitter to horrendously acrid.
There are also some other more obscure chemicals with similar properties.
Research has shown that the ability to taste these substances during the first trimester of pregnancy may have helped women avoid certain harmful foods. Scientists have found that more women than men can detect the bitter taste of PROP and other chemicals with similar properties. As many substances that are potentially harmful to the foetus (but not an adult), are bitter or acrid in taste, nature may be minimising the risks involved.
As far as the pregnancy issues mentioned by Jayemm go -sorry, it sounds a very useful test, but your teacher was having you on. It's purely a matter of genetics.