Modifiers are those words that are placed in a sentence so as to modify or change the frame of the sentence.
Misplaced modifiers are those modifiers that are placed/ used in a sentence but works in such a way that they modify other words rather than the intended word.
In the given sentence "<em>they almost worked all day on the assignment</em>", the modifier "almost" is used as a modifying word for the word "they" instead of the intended "worked". The emphasis will be on the word "work" rather than "they". The right sentence will read like "<em>they worked almost all day on the assignment</em>".
Thus, the sentence with the misplaced modifier is option B.