0 votes
in SoSci Survey (English) by s208019 (160 points)
edited by SoSci Survey

Hi,
We are programming a fairly complex multi-day survey. We randomly show words paired with other stimuli and created some functions for this. However, currently we are unable to save any of the information in the data. I have created an internal variable and tried to use the putList() function, but the data entries for IV02 remain empty...

Here is an excerpt from the code:

// Create a schedule for the number of days
function createSchedule($numDays, $numOld, $numNew, &$specialItems, &$specialItemsSchedule, $valenceCondition, &$words) {
    $schedule = array();
    for ($i = 0; $i < $numDays; $i++) {
        $daySpecialItems = array();
        if (array_key_exists($i, $specialItemsSchedule)) {
            $daySpecialItems[] = &$specialItems[$specialItemsSchedule[$i]];
        }
        $schedule[] = createDay($numOld, $numNew, $daySpecialItems, $valenceCondition, $words);
      putList('IV02_01', $schedule);
    }
    return $schedule;
}

1 Answer

0 votes
by SoSci Survey (327k points)

putList() is intended to save an array to multiple internal variables, so please place is below the }, and only name the question, not the variable itself, that is:

        $schedule[] = createDay($numOld, $numNew, $daySpecialItems, $valenceCondition, $words);
    }
    putList('IV02', $schedule);
    return $schedule;
}

You may also want to add a debug() to see, if $schedule works properly:

        $schedule[] = createDay($numOld, $numNew, $daySpecialItems, $valenceCondition, $words);
    }
    putList('IV02', $schedule);
    debug($schedule);
    return $schedule;
}

And most importantly, make sure not (!) to drag the IV02 question on the page. It that still does not work, please post the debug information from that page.

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

...