0 votes
in SoSci Survey (dt.) by s242672 (110 points)

I am trying to goive my participants direct feedback on their response behaviour in the training phase.

The question type is "Zuordnungsaufgabe mit Reaktionszeit": I display an image and ask them to press k or s accordingly.

Following the instructions I added a PHP-element, my code for this page looks like this:

<!-- Seite 9 -->
<page intID="5">
<question id="BI03" intID="6" />
<php intID="466"><![CDATA[
if (value('BI03_01') == 1) {
    text('FB01'); // Answer correct
    } else {
    text('FB02'); // Answer wrong

Unfortunately, whenI test the page it loads the page moves on to displaying FB02 and then moves on to the next page before I even got a chance to press any key.

Could you please help?
Many thanks

1 Answer

0 votes
by SoSci Survey (290k points)

You cannot use PHP code on the same page as your question - please see the manual on PHP filters for that.

If oyu like to show some feedback on the same page, you'll have to work with JavaScript. And of course, you'll have to remove timeouts in the Assignent Task question, if it proceeds too quickly.

by s242672 (110 points)
edited by s242672
thank you for this! I added two items to my question and try to navigate to item 2 if option 1 is pressed (a picture saying "richtig") or to item 3 (a picture saying "falsch") if option 2 if chosen. This seems to work fine. Thanks.
Now when they pressed option 1 or option 2 I would like to move on to the next question after 0.5s. Would you be able to help with this, too?
Many thanks.

<script type="text/javascript">
// Filterfunktion
function selFilter(item, option) {
  // Der erste Filter reagiert, wenn bei Stimulus 1 die Option links (1) ausgewählt wurde
  if (item == 1 && option == 1) {
    // Weiter mit Item Nr. 2
    return 2;
  } else if (item == 1 && option == 2) {
    // Weiter mit Item Nr. 3
    return 3;
// Die Zuordnungsaufgabe wird erst aktiviert, wenn die Seite vollständig geladen ist.
// Daher muss man attachEvent() verwenden, um die Callback-Funktion erst nach Abschluss
// des Ladevorgangs zuzuweisen.
// Wichtig: Statt assignmentAB01 muss hier "assignment" plus die Kennung der Frage verwendet werden
SoSciTools.attachEvent(window, "load", function() {
// -->
by SoSci Survey (290k points)
Did you already set a pause of 500ms between the stimuli in the question?
by s242672 (110 points)
No, because I do not want a pause between the stimuli. After the keypress after Stimulus 1 I would like stimulus 2/3 to be displayed without delay. Stimulus 2/3 should disappear after .5s. Like a timeout condition. A bit like the option in your example just without the additional if statement.

// Der dritte Filter soll erst ab Stimulus Nr. 3 reagieren
  if (item >= 3) {
    // Wird die rechte Kategorie (2) angeklickt, ist die Frage zu Ende
    if (option == 2) {
      // Ende
      return -1;
by SoSci Survey (290k points)
You can give setPrimeTimes() a try - the prime is kind of a delay as well, but I am not 100% sure, if the new times wil be used when set dynamically during the task.

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