0 votes
in SoSci Survey (dt.) by s123037 (125 points)

Hi there,
I want to implement a trial structure where first a picture is presented for 10 sec, then the next page is automatically shown on wich there are ratings. This is to be repeated 40x in total and the presentation order of the trials should be rotated per participant.

Here is what I have done:
1. On the very first page, I have a PHP code accessing the "Zufallsgenerator" to rotate the survey pages:

question('AA01');  // Zettel in zufälliger Reihenfolge ziehen
$pages = valueList('AA01', NULL, 'label');  // Gezogene Zettel auslesen
setPageOrder($pages);  // Seiten als Seitenabfolge definieren

2a. Each "picture page" has a timer consisting of PHP code:

$time0 = time();

$timer = 10;  // Der Teilnehmer hat 10 Sekunden Zeit zur Bearbeitung
if (time() >= $time0 + $timer) {
  goToPage('next');
}
// Die verbleibende Zeit muss auch dem JavaScript-Code bekannt gemacht werden
$remain = $time0 + $timer - time();
replace('%remain%', $remain);

2b. followed by HTML code:

<script type="text/javascript">
<!--
 
// Funktion zur Weiterleitung
function weiter() {
  // Den Teilnehmer zur nächsten Seite weiterleiten
  SoSciTools.submitPage();
}
 
// Weiter-Knopf ausblenden (optional)
SoSciTools.submitButtonsHide();
 
// Initialisierung der Weiterleitung
SoSciTools.attachEvent(window, "load", function(evt) {
  // Timer für automatische Weiterleitung starten
  window.setTimeout(weiter, %remain% * 1000);
});
 
// -->
</script>

I have tested the rotation and the timer separately, there all worked fine. Using both together, however, the rotation does mysterious things, e.g., presenting trials more than once. I am assuming that both functions influence the page order in some way and one is overwriting the other. But I don't know how to fix it... Could you help?

Thank you!

1 Answer

0 votes
by SoSci Survey (328k points)
selected by s123037
 
Best answer

e.g., presenting trials more than once.

I am quite sure that this is not related to the timer code. I think there's the page "where to continue" missing in this line:

setPageOrder($pages); 

If the page after the rotation part is "part2" then change this to

setPageOrder($pages, 'part2'); 
by s123037 (125 points)
Yes, that's it. Thank you!

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

...