Inhaltsverzeichnis

caseTime()

int caseTime(string pageID)

Determines the amount of time spent on a particular page, or the time the participant has spent on the questionnaire so far. The time for each one is determined in seconds.

Note: If a participant visits a page multiple times (e.g. because responses were missing, or by clicking on the “Back” button, the amount of time spent on the page will be added up.

Note: If the questionnaire jumps to another page by using goToPage(), the time spent on the page shown first will be counted. Therefore, ig there is a filter on page “one” which forwards the participant directly to page “two”, the time spent on page “one” will nevertheless be saved.

Example 2

If the participant needed less than 10 seconds for the previous page, the following PHP code redisplays the page – along with the text element “too_quick”.

if (caseTime('previous') < 10) {
  repeatPage('too_quick');
}

Example 2

The following PHP code starts the questionnaire again (without deleting previous responses), if the participant needed less than 1 minute for the previous pages.

This example assumes the first page has the ID “start”.

if (caseTime('hitherto') < 60) {
  text('please_check'); // information message
  setNextPage('start'); // after "Next" go to page "start"
  pageStop(); // do not display any further content on the page
}