Is a usage-based (as opposed to time-based) free trial allowed for a non-renewing subscription?

Hi, I'm developing an app that involves the user solving problems. I want my app to have a free trial, but I'd like that trial to expire after the user has solved a certain number of problems, as opposed to after some pre-specified time period. When the trial expires, they'll need to either purchase a non-renewing subscription, else some functionality limitations will be imposed.

Given the above, I have two questions:

  1. I know that a time-based free trial is permitted by Apple, but is a usage-based free trial - as described above - allowed?

  2. If a usage-based free trial is allowed, are there any specific details relating to how this trial (and/or the subscription) should be communicated to the user?