Because Xiaoding scored 13 points more than Xiaoming, Xiaoding made one less mistake than Xiaoming.
So Xiaoding made three mistakes and Xiaoming made four.
So Xiaoding did the right thing for 7 and Xiaoming did the right thing for 6.
Don't ask questions