Hi Chris, this type of question appears to be a popular item of late.
Here's a solution I hope you find helpful ...
Create a quota question and call it QTAds with the following settings applied:
Value=1 / Cell Name=Ad1 / Cell Limit=100 / Qualification=ListValue(CompleteConList,1)=1
Value=2 / Cell Name=Ad2 / Cell Limit=100 / Qualification=ListValue(CompleteConList,1)=2
Value=3 / Cell Name=Ad3 / Cell Limit=100 / Qualification=ListValue(CompleteConList,1)=3
Value=4 / Cell Name=Ad4 / Cell Limit=100 / Qualification=ListValue(CompleteConList,1)=4
*Note: I will explain the "Qualification" below.
Create a parent list called AdList. It will look like this ...
1-Ad 1
2-Ad 2
3-Ad 3
4-Ad 4
Now create a constructed list called AdConList which will use AdList as the parent list. Insert this Perl script ...
Begin Unverified Perl
my $i=1;
for($i=1; $i<=4; $i++)
{
if (ISQUOTACELLOPEN("QTAds",$i)==1)
{
ADD("AdList",$i);
}
RANDOMIZE();
}
End Unverified
This constructed list selects all ad's that have an open quota and randomises them.
Now create another parent list and call it CompleteList. It will look like this ...
1-[%QuotaCellCompletes(QTAds,1)%]
2-[%QuotaCellCompletes(QTAds,2)%]
3-[%QuotaCellCompletes(QTAds,3)%]
4-[%QuotaCellCompletes(QTAds,4)%]
This parent list reads in all 4 completes counts for each quota.
Now moving onto the last constructed list. Call it CompleteConList. It will use the CompleteList as the parent list ...
Mirror(AdConList)
SortByLabel()
This constructed list will select the open quotas only and sort them from lowest to highest based on their completes count. The first item on the list will be the quota (or ad) that requires the most number of competes at the time to reach their target of 100.
In your skips for each ad (or ad block of questions), use the following conditions ...
Ask Ad 1 if: ListValue(CompleteConList,1)=1
Ask Ad 2 if: ListValue(CompleteConList,1)=2
Ask Ad 3 if: ListValue(CompleteConList,1)=3
Ask Ad 4 if: ListValue(CompleteConList,1)=4
So this solution reaches out and selects ad's that have open quotas only and then selects from that list, the ad that requires the most filling at the time.
Good luck!