Fixed median calculation in lecturer controller