MDL-43068 course&gradebook: fix use of new API in old branches.