private function getDelivery()
    {
        $returnValue = null;
        //passed as aprameter
        if ($this->hasRequestParameter('delivery')) {
            $returnValue = new core_kernel_classes_Resource($this->getRequestParameter('delivery'));
        } else {
            
            $launchData = LtiService::singleton()->getLtiSession()->getLaunchData();

            /** @var LtiLaunchDataService $launchDataService */
            $launchDataService = $this->getServiceLocator()->get(LtiLaunchDataService::SERVICE_ID);
            $returnValue = $launchDataService->findDeliveryFromLaunchData($launchData);
        }
        return $returnValue;
    }