when you have an advancement give command in a function it and it fails all the other commands to be executed in that function after that command fail.
e.g if in a function you had
advancement grant @a only story/obtain_armor
the chat would have
but not 2 or 3 if all the players have all ready gotten story/obtain_armor
but if other wise it would have
in the chat