After the close of business on the last day for candidates to file for office, the filing officer shall determine by lot the order in which the names of those candidates will appear on all ballots. The determination shall be done publicly and may be witnessed by the media and by any candidate. If no primary is required, the names shall appear on the general election ballot in the order determined by lot.