setStatus()

The function setStatus() sets the interview status and triggers a panel redirect, if a “Panel Redirects” element was included in the questionnaire or if a suitable redirect was specified by means of option('redirect.*', ...).

By default, calling setStatus() with 'quota full', 'screenout', or 'quality fail' stops the execution of the current PHP code.

void setStatus(string statusCode, [bool continue])

The parameter statusCode must be passed as a string with one of the following values.

The interview status is available in the dataset as variable STATUS. If multiple statuses were stored for the interview, the first one in the following order is returned.

Quality Fail for Fast Completion

The following example code for the last questionnaire page marks the questionnaire as “quality fail” if the respondent took less than 300 seconds (5 minutes) to complete it. Otherwise, the case is counted as “complete”.

if(caseTime('hitherto') < 300) {
  setStatus('quality fail');
}
setStatus('complete');