0 votes
in SoSci Survey (English) by s210296 (270 points)

Hi,

I put a quota to survey
Pls let know where I get inform about quota.
Thx in advance.

1 Answer

0 votes
by SoSci Survey (297k points)

You can create another questionnaire, basically using the PHP code from your quota, and show the counts via html().

You can also download the data and run the scripts from your stats software to get the quotas.

by s210296 (270 points)
Many thx for your response.

One question to your first option:
Means I have to create a questionnaire, add one page with PHP code
and I will see the result in preview view?
2nd question: How will be my PHP code?
Looking forward to hearing form you
by SoSci Survey (297k points)
> Means I have to create a questionnaire, add one page with PHP code
and I will see the result in preview view?

Not automatically. You will have to put some statistic()-lines on that new page in the new questionnaire, and use html() to display the stats:

> How will be my PHP code?

Let's say, this is your code in the quota-check:

$casesAge    = statistic('count', 'SD03_01', $ageGroup);
$casesGender = statistic('count', 'SD03_02', $gender);

Now, you have 3 age groups (1-3) and 2 gender groups (1-2), then your quota-view-PHP may look like this:

foreach ($ageGroup in [1,2,3]) {
  html('<p>Age group '.$ageGroup.' = '.statistic('count', 'SD03_01', $ageGroup).'</p>');
}
foreach ($gender in [1,2]) {
  html('<p>Gender '.$gender.' = '.statistic('count', 'SD03_02', $gender ).'</p>');
}
by s210296 (270 points)
I have in the original questionaire AB following

PHP-CODE
$quotaIND = [
  1 >= 195,
  2 >=1950
];


$IND = value('ZS30');

$casesIND   = statistic('count', 'ZS30');
debug($casesIND);

if (($casesIND >= $quotaIND))
{
 redirect('https://survey.maximiles.com/quotasfull?p=89490_f1bc75ab&m=%reference%');
};

I have put now in the new questionaire XY following

PHP CODE:
foreach ($IND in [1,2]) {
  html(<p>IND $IND = statistic('count', 'ZS02', $OKR)</p>);
}



Warning: in the new quesitionaire XY
Warnung
Warnung: Unerwartetes Element: in - fehlt hier vielleicht ein Semikolon (;) oder Anführungszeichen?
foreach ($IND in

Warnung: Unerwartetes Element: $IND - fehlt hier vielleicht ein Semikolon (;) oder Anführungszeichen?
html(<p>IND $IND

There must be sth wrong with the synatx, or what do you think?
by SoSci Survey (297k points)
> $casesIND   = statistic('count', 'ZS30');

I do not think that this will work properly ... what have you stored in ZS30 ?

If it actually works, then your PHP code for the stats was quite simple:

$casesIND   = statistic('count', 'ZS30');
html('<p>Cases IND: '.$casesIND.'</p>');

> Warnung: Unerwartetes Element: in - fehlt hier vielleicht ein Semikolon (;) oder Anführungszeichen?

Da fehlen die Anführungszeichen:

html('<p>IND $IND = '.statistic('count', 'ZS02', $OKR).'</p>');

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

...