Final answer:
The bias where an individual attributes successes to internal factors and failures to external factors is known as self-serving bias.
Step-by-step explanation:
The type of bias described is the self-serving bias. This cognitive bias leads individuals to attribute their successes to internal or personal factors while attributing failures to external or situational factors. When a student credits hard work for good test results but blames the difficulty of a test or bad luck when failing, it demonstrates a classic example of self-serving bias. This helps to protect an individual's self-esteem by taking credit for positive outcomes and deflecting blame for negative ones.