Yeah, it's hard to make them quit horsing around.

I wish they were actively taught how to stay on task instead of being shamed into it.

I mean they're being handed over / bring their own computer / have their phone at hand, and anyway they probably have all of that at home, and will have at work someday.

From that state of affair the best thing to do is to try and give then the tools to best manage and navigate the situation, not yell "stay on task" at them (which is AFAIK basically the only course of action) which is wholly unproductive.