Self-serving bias is the tendency to attribute one's successes to internal factors (such as ability or effort) and one's failures to external factors (such as bad luck or other people's mistakes). In this case, the student is attributing their high test grade to their own diligent study habits (internal factor) and their low test grade to the poorly worded questions (external factor).