With observations of the Interface Region Imaging Spectrograph ( IRIS ) , we study chromospheric heating and evaporation during an M1.6 flare SOL2015-03-12T11:50 . At the flare ribbons , the Mg ii 2791.59 Å line shows quasi-periodic short-duration red-wing enhancement , which is likely related to repetitive chromospheric condensation as a result of episodic heating . On the contrary , the Si iv 1402.77 Å line reveals a persistent red-wing asymmetry in both the impulsive and decay phases , suggesting that this line responds to both cooling downflows and chromospheric condensation . The first two episodes of red-wing enhancement occurred around 11:42 UT and 11:45 UT , when two moving brightenings indicative of heating fronts crossed the IRIS slit . The greatly enhanced red wings of the Si iv and Mg ii lines at these occasions are accompanied by an obvious increase in the line intensities and the HXR flux , suggesting two episodes of energy injection into the lower atmosphere in the form of nonthermal electrons . The Mg ii k/h ratio has a small value of \sim 1.2 at the ribbons and decreases to \sim 1.1 at these two occasions . Correspondingly , the Fe xxi 1354 Å line reveals two episodes of chromospheric evaporation , which is characterized as a smooth decrease of the blue shift from \sim 300 km s ^ { -1 } to nearly zero within \sim 3 minutes . The Fe xxi 1354 Å line is entirely blueshifted in the first episode , while appears to contain a nearly stationary component and a blueshifted component in the second episode . More episodes of blueshifted Fe xxi emission is found around the northern ribbon in the decay phase , though no obvious response is detected in the Si iv and Mg ii emission . We have also examined the Fe xxi emission at the flare loop top and identified a secondary component with a \sim 200 km s ^ { -1 } red shift , which possibly results from the downward moving reconnection outflow . Our analysis also suggests a reference wavelength of 1354.0878 \pm 0.0072 Å for this Fe xxi line .