Quasi-periodic Pulsations before and during a Solar Flare in AR 12242