The little screens next to each switch match the colours of the bookcases they control.
With Serra's puzzle, it's worth mentioning that (1) each time you try to Rock Smash the wrong section of wall, all of your party takes damage, but that (2) the puzzle doesn't reset if you go to heal, so if you want to dump your Rock Smasher in the PC before you battle her you can.