I'd say - publish the idea and make use of it. You cannot (in theory) patent anything that was already published somewhere.
In the US and Canada, you have a one year grace period. It's absolutely standard for researchers to publish a peer-reviewed paper and then patent within that grace period.
It is highly (as dangrossman has already pointed out) that your friend has already signed something that assigns all IP created during a course.