Generally, cramping in the calves means that the rider needs to do more calf work. I like one-legged calf raises on a stair step a couple times a week, 1 set to exhaustion. Fix you right up. A second, less common cause for that is "ankling" or intentional contraction of the calf during the downstroke. This used to be all the rage and has now fallen into disrepute. Only do this during short power-ups. Otherwise, relax the calf on the downstroke.
Quad cramping is usually caused by insufficient back-pressure on the pedal at the bottom of the stroke. You want your hams and quads to cramp at the same time. If you train that way, it's possible to relax the quads, if they should cramp, and pedal only with the hams, and the reverse. Eventually, they both cramp and you're in a hurt. That's caused by insufficient training. If you're in shape, you don't cramp.