fix some OK-related issues that caused certain post actions to fail

the reuse of the course_id variable name for dealing with course keys led to a bug, and it's generally misleading.  this fixes the bug and renames the variable everywhere for clarity.

@gwprice 
@dan-f (optional)