How to get stars while training?

What’s the algorithm to get or miss stars while riding a training?
For example, is it based on the average power versus the required one for the training segment?
Or is it depending on how much time the rider gets “increase power”? Does “reduce power” also count?
What if almost always at a higher power than required?
Thanks.

Here is all about Zwift WO credits from Zwift Insider.

An excerpt of this page says:

HALF STARS, NO STARS

If you don’t hit your wattage accurately enough, you will be rewarded a half star instead of a full star. Half stars are worth 70% of the XP you would have been rewarded if you had received the full star.

We’re not sure where the threshold is for receiving a half star instead of a full star, but in our basic tests if you power was more than ~12% off the target you went to a half star.

If you really mess up the interval, you’ll receive no star–which is worth approximately 1XP per minute of interval length.

Thanks David for pointing that.
One thing is still not clear: “if your power was more than ~12% off the target…”, is it only below the target, or also above it? And is it 12% of the time off the target, or the average power on the interval is 12% off?

In my experience over target will get the same treatment as under target. It’s early in the morning still but it seems to me average power encompasses both time and power.

I like to have my iPad in front of me on the Workout section. The power speedometer is real large and it easier to keep the needle in the proper band. Plus the whole u-shaped speedometer flashes the color for the interval when you are in the zone. It helps to keep me focused and in the zone.