This is an interesting test... perhaps even SCOTUS worthy. I cannot find any SCOTUS case in which speech to a political manner was compelled by a graded assignment that would be used to promote the Professors political position to a law maker. As you attend a State Funded University, the professor is a State Employee and cannot compel speech as part of his job under the 1st and 14th Amendment. It's not only illegal, it's damn near unconstitutional.
As I have read, you have already turned in the assignment, and if you have not received a grade, I would request your envelops returned to you and not mailed to the elected officials (presumably two senators and a congressional representative?). I would also petition the department head and the school administration, protesting the assignment as a grade for the course.
Following that, you would likely want to get into contact with advocacy groups that deal with oversteps of college teachers. For this situation, I would highly recommend Campus Reform, which is a right leaning organization, but has a big media presences. I would also reach out to your two Senators, which, lucky you, are two very important Senators. Your senior leadership is Mitch McChonnell, current Senate Majority Leader, and Rand Paul, who is a big name among the Libertarian wing of the Republican Party (and will be quite outspoken on any issue like this).
This will put pressure from both the internal and external sources to remove the grade from your score. Should that not be valid, you will need to ask yourself if you are ready to fight this in court?