This worm is Ascaris. From an infectious disease doctor:
"The clue is the size- if you can see it move and it looks like an earth worm, it’s ascsaris! In dirt, kids get it from licking their dirty fingers! The adult looks like an earthworm and it causes the symptoms described with the worst cases causing bowel obstruction."
I am wondering which parasite is this actually? --
trichuris trichiura can present with rectal prolapse in kids which perhaps accounts for why this boy thought he defacated in his pants
The gravid female pinworms (Enterobius vermicularis) migrate through the colon towards the rectum at a rate of 12 to 14 cm per hour.They emerge from the anus, and while moving on the skin near the anus, the female pinworms deposit eggs either through (1) contracting and expelling the eggs, (2) dying and then disintegrating, or (3) bodily rupture due to the host scratching the worm. After depositing the eggs, the female becomes opaque and dies.The female emerges from the anus to obtain the oxygen necessary for the maturation of the eggs.