MDL-39876 update_course_record function to update global COURSE