I would imagine that publishing the idea would leave the friend liable for legal action.
It is highly (as dangrossman has already pointed out) that your friend has already signed something that assigns all IP created during a course.
This only works if the patent has not been applied for yet. Is this the case?
That's true for most non-U.S. countries. In the U.S. and a very few other countries, however, an inventor has a one-year grace period after publication (or offer for sale, or "public" use) in which to file a patent application. See http://en.wikipedia.org/wiki/Novelty_(patent).