MDL-31776 - lib: Alternate name fields - update of gradebook sql query.