Hi airborne
You are puzzled because typically the test questions are about airplanes gliding at best gliding speed (best gliding AoA, actually). In that case, weight makes no difference in gliding distance, only in gliding time (heavier, faster).
However, as said in the previous post, when two airplanes are gliding at a given airspeed, say 300 kt, the heavier glides more miles. Why? Because the heavier one is gliding at a more efficient angle of attack.
Gliding distance is proportional to the Lift-Drag ratio. The mor L/D, the more distance. Lift-Drag ratio is equal to Lift Coefficient-Drag Coefficient ratio. These depend solely on the angle of attack (well, mach number also has an influence...). Remember how weight, AoA and speed are related and you will see that heavier at constant speed means less AoA, and therefore (in the stable speed region, of course) more L/D.
I hope it helps.