With a test-particle simulation , we investigate the effect of large-scale coronal magnetic fields on electron acceleration at an outward-propagating coronal shock with a circular front . The coronal field is approximated by an analytical solution with a streamer-like magnetic field featured by partially open magnetic field and a current sheet at the equator atop the closed region . We show that the large-scale shock-field configuration , especially the relative curvature of the shock and the magnetic field line across which the shock is sweeping , plays an important role in the efficiency of electron acceleration . At low shock altitudes , when the shock curvature is larger than that of magnetic field lines , the electrons are mainly accelerated at the shock flanks ; at higher altitudes , when the shock curvature is smaller , the electrons are mainly accelerated at the shock nose around the top of closed field lines . The above process reveals the shift of efficient electron acceleration region along the shock front during its propagation . It is also found that in general the electron acceleration at the shock flank is not so efficient as that at the top of closed field since at the top a collapsing magnetic trap can be formed . In addition , we find that the energy spectra of electrons is power-law like , first hardening then softening with the spectral index varying in a range of -3 to -6 . Physical interpretations of the results and implications on the study of solar radio bursts are discussed .