public function prepare_simulated_post_data($simulatedresponses) {
        $simulatedpostdata = array();
        $simulatedpostdata['slots'] = implode(',', array_keys($simulatedresponses));
        foreach ($simulatedresponses as $slot => $responsedata) {
            $slotresponse = array();

            // Behaviour vars should not be processed by question type, just add prefix.
            $behaviourvars = $this->get_question_attempt($slot)->get_behaviour()->get_expected_data();
            foreach (array_keys($responsedata) as $responsedatakey) {
                if ($responsedatakey{0} === '-') {
                    $behaviourvarname = substr($responsedatakey, 1);
                    if (isset($behaviourvars[$behaviourvarname])) {
                        // Expected behaviour var found.
                        if ($responsedata[$responsedatakey]) {
                            // Only set the behaviour var if the column value from the cvs file is non zero.
                            // The behaviours only look at whether the var is set or not they don't look at the value.
                            $slotresponse[$responsedatakey] = $responsedata[$responsedatakey];
                        }
                    }
                    // Remove both expected and unexpected vars from data passed to question type.
                    unset($responsedata[$responsedatakey]);
                }
            }

            $slotresponse += $this->get_question($slot)->prepare_simulated_post_data($responsedata);
            $slotresponse[':sequencecheck'] = $this->get_question_attempt($slot)->get_sequence_check_count();

            // Add this slot's prefix to slot data.
            $prefix = $this->get_field_prefix($slot);
            foreach ($slotresponse as $key => $value) {
                $simulatedpostdata[$prefix.$key] = $value;
            }
        }
        return $simulatedpostdata;
    }