It was James’ last year at Hogwarts. He and the other marauders decided it was time to grow up, and so they put they’re pranking days behind them and instead focused on school and their upcoming test. 