wringer
A machine with rollers that squeeze water from wet clothes.
A wringer is a device with two rolling cylinders that squeeze water out of wet clothes. Before washing machines had spin cycles, people used wringers to press laundry between the rollers, forcing out excess water so clothes would dry faster. You fed a dripping shirt into the wringer, turned a crank, and watched the rollers squeeze it flat as water streamed out the bottom.
Using a wringer required care: if you weren't paying attention, you could catch your fingers between the rollers (which hurt, though the rollers were designed to pop apart if that happened). This experience gave us the expression put through the wringer, meaning to endure a difficult, exhausting ordeal.
When you say a math test put you through the wringer, you mean it squeezed every bit of knowledge out of you, leaving you wrung out and exhausted, just like those old rollers squeezed every drop of water from the laundry. A stressful week of final exams might put students through the wringer. A difficult job interview could put an applicant through the wringer.
While modern washing machines have made wringer devices mostly obsolete, the phrase lives on, perfectly capturing that feeling of being pressed, tested, and thoroughly worked over by a challenging experience.