To date, most resource allocation proposals in elastic optical networks have focused either on routing and spectrum assignment (RSA, assuming fixed coding scheme and modulation format) or routing, modulation level and spectrum assignment (RMLSA, assuming a fixed coding scheme). Recent research has studied the impact of adaptive assignment of the code rate, without adapting the modulation format (RCSA algorithm). In this paper, we report for the first time the impact that adapting both the code rate as well as the modulation format has on the blocking performance. To do so, we present a new RCMLSA algorithm and evaluate it in terms of blocking by means of simulation. We compared the performance of our RCMLSA algorithm to that of RMLSA and RCSA algorithms. Results obtained for the NSFNet topology show that our RCMLSA algorithm performs better than the RCSA and RMLSA proposals, with a decrease in blocking of more than one order of magnitude (for traffic loads lower than 0.7) with respect to the RCSA.