Are amounts paid from a 529 for qualified education expenses taxable if the student drops out of school or withdrawals from classes?

 I used my son's 529 to pay for tuition--he was enrolled part-time at the time of enrollment. He then withdrew from his courses over half way through the semester. The University refunded about 25% of the tuition (qualified education expenses) and I re-contributed the refund back into his 529 within 60 days. My question relates to the portion that was NOT refunded. Is that amount still deemed having been paid for qualified expenses (i.e., NOT taxable)?