get_record('certificate', array('id'=> $cm->instance), '*', MUST_EXIST);