Fixed grade computation in php grade model.