media_question: Check for values before using them

Don't blindly use the indexes directly in the code, instead gracefully
fallback for non mandatory parameters and throw a Exception over the
mandatory one. Same for course_id set by ::updateCourse().