Halfway through a scale, the student's attention has clearly gone somewhere else. They're getting through the notes, more or less. You could ask for another repetition, but it would help to give that repetition a job.
Maybe the goal is an even sound through a register change. Maybe it's hearing where the scale turns up in their piece. Pick something they can listen for.
Same scale, different question
Use a familiar scale so the student has room to think about something else. Try it legato, then staccato. Shape a crescendo toward the top. Change the rhythm or place an accent on every third note.
Ask what changed in the sound and what became harder to control. You now have a musical question to investigate rather than a set of notes to get out of the way.
Choose variations the student can manage. Thirds, unfamiliar articulations, and unusual rhythms can each be useful, but adding them all at once hides which skill needs attention.
If you use a timer
A timer can set a boundary without turning the scale into a race. Choose a comfortable tempo and decide what a good attempt should sound like. “Keep the sound even through the register change” is more useful than “as many as possible.”
After a mistake, pause and identify it. Adjust the task before another attempt. A timed challenge should leave room for that thinking, not reward pushing past the same problem repeatedly.
For a younger student, a map of keys learned or a choice of two challenges may add interest. Keep the scale's name and key attached so the game also builds musical vocabulary.
Find it in their music
If the student is learning music in D major, locate a passage using that scale. Compare its notes and fingering with the exercise. Then play the fragment in the piece's actual rhythm and articulation.
Don't assume that knowing the scale makes the passage automatic. It provides a familiar pattern to work from; the new context may still need practice.
Try “Choose a comfortable key, then choose one that needs work.” Or let the student choose between two articulations while you choose the key.
The choice can be small. It gives the student a decision to make while keeping the exercise connected to a teaching goal.
Before moving on, ask the student to name what improved or what they will try next time. “The top note stayed supported at the slower tempo” gives the next session a starting point.
If the scale is getting steadier and the student knows why you're working on it, you can move on. You don't have to make them love scales before they're allowed to enjoy the piece.
For help turning the result into a home assignment, see Why “Practice More” Is Useless Advice.