This is a problem that I’ve also struggled with over the years. Ultimately, the solution is for students to value knowledge as they ought, and that’s a battle I continue to have my ups and downs with. But there are a few things I’ve found helpful for encouraging timely test preparation and discouraging those last-minute lingerings over the textbook and notes.
That latter problem, with which I am all too familiar, has almost entirely disappeared for me since I’ve started doing two things. First, I’ve established the expectation that the direction for students to clear their desks must be followed IMMEDIATELY. Second, those who fail to follow this instruction promptly may not be given their quiz or test for several minutes, negating any advantage they may have gained by their dawdling.
To encourage better studying, I’ve found that it helps to give more and better study-skills instruction. Some students don’t study because they don’t know how to do it effectively, so it seems like a waste of time. This is very much a work in progress for me and something I need to keep improving in, but what I’ve done so far has given good results.
Finally, for several years I’ve been gradually replacing many of my tests with open-book essays and similar projects. This really separates the students who do their best and know their stuff from those who don’t. Waiting until the last minute on these things is simply disastrous, virtually without exception.