Learning past tense with Rosetta Stone
了 functions both as aspectual and modal particle, in the former case it occurs after the verb, in the latter at the end of the sentence. In images 1,3 the completed aspect of the action is referred to, in images 2,4 了 occurs at the end of the sentence to indicate a change（the emergence of a new situation, change in understanding, opinion,ideas, or action, express urging, advice or reminder (quotation from 外国人实用汉语语法)).
In fact in case of #2,4 it could occur twice： 我买了一本词典了，她买了药了 to indicate both aspect and change, but instead of using 了 twice (to indicate both aspect and mood (modal particle use)，it often 
(usually, especially in the case of short sentences ?)
only occurs at the end of the sentence.