529 distributions and support test / earned income

My daughter has funded her own 529 plan and is now in college. She uses her 529 distributions for the majority of her support (70%) with 20% of her support coming from a part time job and 10% being provided by her parents.

 

She files her own taxes and cannot be claimed by us as a dependent (since 90% of her support came from her own sources). 

 

In order to determine whether she gets a refundable or non-refundable education credit, she needs to indicate if less than half her support was from earned income. Do we consider only her 20% support from the part time job (ie <50%), do we consider both 529 and part time job as earned income (90%, ie >50%)?

 

Or do we ignore the 529 distributions and only consider the remaining 30% as support for this AOTC credit (in which case more than 50% was from earned income)? This would not seem right since we have to account for 529 distributions in the support test for dependent status. 

 

I am leaning to the first scenario: only the part time job counts as earned income so the AOTC will be non-refundable but that would suggest that working to pay for college before you enroll is less beneficial than working while you are enrolled....