public function transmitItemVariable($variables, $transmissionId, $itemUri = '', $testUri = '') {

        $itemVariableSet = [];

        if (is_array($variables) === false) {
            $variables = [$variables];
        }

        foreach ($variables as $variable) {
            $identifier = $variable->getIdentifier();

            if ($variable instanceof OutcomeVariable) {
                $value = $variable->getValue();

                $resultVariable = new taoResultServer_models_classes_OutcomeVariable();
                $resultVariable->setIdentifier($identifier);
                $resultVariable->setBaseType(BaseType::getNameByConstant($variable->getBaseType()));
                $resultVariable->setCardinality(Cardinality::getNameByConstant($variable->getCardinality()));
                $resultVariable->setValue(self::transformValue($value));

                $itemVariableSet[] = $resultVariable;
            }
            else if ($variable instanceof ResponseVariable) {
                // ResponseVariable.
                $value = $variable->getValue();

                $resultVariable = new taoResultServer_models_classes_ResponseVariable();
                $resultVariable->setIdentifier($identifier);
                $resultVariable->setBaseType(BaseType::getNameByConstant($variable->getBaseType()));
                $resultVariable->setCardinality(Cardinality::getNameByConstant($variable->getCardinality()));
                $resultVariable->setCandidateResponse(self::transformValue($value));

                // The fact that the response is correct must not be sent for built-in
                // response variables 'duration' and 'numAttempts'.
                if (!in_array($identifier, array('duration', 'numAttempts', 'comment'))) {
                    $resultVariable->setCorrectResponse($variable->isCorrect());
                }

                $itemVariableSet[] = $resultVariable;
            }
        }

        try {
            common_Logger::d("Sending Item Variables to result server.");
            $this->getResultStorage()->storeItemVariables($testUri, $itemUri, $itemVariableSet, $transmissionId);
        }
        catch (Exception $e) {
            $msg = "An error occured while transmitting one or more Outcome/Response Variable(s) to the target result server.";
            $code = taoQtiCommon_helpers_ResultTransmissionException::OUTCOME;
            throw new taoQtiCommon_helpers_ResultTransmissionException($msg, $code);
        }
    }