0 votes
ago in SoSci Survey (English) by s332786 (130 points)
edited ago by SoSci Survey

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!

1 Answer

0 votes
ago by SoSci Survey (349k points)

How can I ensure that statistic() only counts the completed responses (FINISHED=1) for each specific questionnaire version, not across the whole project?

Set a filter for the statistic() function, please:

statistic('filter', null, 'QUESTNNR="alpha"');
$finished = statistic('count', 'FINISHED');

Is there a recommended way to manage quotas independently for each version, especially if they are in the same project?

A very simple choice would be using the new Quota element, available under "New Question". In order to just count completed questionnaires, you should also create an "internal variable" with defined options (1=complete) and set the variable via put() on the first last page of the questionnaire. Just above the quota element.

put('IV01_01', 1);

Then create 4 quota questions, one for each questionnaire, and check the counts for this variable.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...