“They elected Prof. Palmer the head of that department for the second time.”, “the head of that department” is a direct object.
“They elected Prof. Palmer the head of that department for the second time.”, “the head of that department” is a direct object.