Hi,
I have a project that includes 4 different questionnaire versions (each shown to a different participant group). All versions are managed within the same project.
I would like to:
Set a quota of 35 completed responses per questionnaire version.
I tried the code below in PHP, and it works fine (except that the count is wrong!! ).
// Completed questionnaires count
**$finished = statistic('count', 'FINISHED');**
//Filter for quota stop
**if ($finished >= 20) {**
// Text display
**text('A014');**
// Hide Next button
**buttonHide();**
// Show no further content from this page
**pageStop();
}**
However:
Even though I only have 2 completed responses, the quota limit triggers at 19.
In the dataset view, all responses across all versions appear together, and it’s unclear how the statistic() function filters them internally.
My questions:
How can I ensure that statistic() only counts the completed responses (FINISHED=1) for each specific questionnaire version, not across the whole project?
Is there a recommended way to manage quotas independently for each version, especially if they are in the same project?
I only want to stop each survey once it reaches 35 completed responses.
Thank you for any guidance!