protected function storeVariable(
        QtiRunnerServiceContext $context,
        $itemUri,
        \taoResultServer_models_classes_Variable $metaVariable,
        $itemId = null
    ) {
        $sessionId = $context->getTestSession()->getSessionId();

        $testUri = $context->getTestDefinitionUri();

        /** @var DeliveryServerService $deliveryServerService */
        $deliveryServerService = $this->getServiceManager()->get(DeliveryServerService::SERVICE_ID);
        $resultStore = $deliveryServerService->getResultStoreWrapper($sessionId);

        if (!is_null($itemUri)) {
            $resultStore->storeItemVariable($testUri, $itemUri, $metaVariable, $this->getTransmissionId($context, $itemId));
        } else {
            $resultStore->storeTestVariable($testUri, $metaVariable, $sessionId);
        }

        return true;
    }