A quantitative study relating observed shear in photospheric magnetic fields to repeated flaring