public function getDeliveryTimer($deliveryExecution)
    {
        if (is_string($deliveryExecution)) {
            $deliveryExecution = $this->getDeliveryExecutionById($deliveryExecution);
        }

        /** @var TestSessionService $testSessionService */
        $testSessionService = $this->getServiceLocator()->get(TestSessionService::SERVICE_ID);

        $testSession = $testSessionService->getTestSession($deliveryExecution);
        if ($testSession instanceof TestSession) {
            $timer = $testSession->getTimer();
        } else {
            $qtiTimerFactory = $this->getServiceLocator()->get(QtiTimerFactory::SERVICE_ID);
            $timer = $qtiTimerFactory->getTimer($deliveryExecution->getIdentifier(), $deliveryExecution->getUserIdentifier());
        }

        return $timer;
    }
public function getDeliveryTimer($deliveryExecution)
    {
        if (is_string($deliveryExecution)) {
            $deliveryExecution = $this->getDeliveryExecutionById($deliveryExecution);
        }

        /** @var TestSessionService $testSessionService */
        $testSessionService = $this->getServiceLocator()->get(TestSessionService::SERVICE_ID);

        $testSession = $testSessionService->getTestSession($deliveryExecution);
        if ($testSession instanceof TestSession) {
            $timer = $testSession->getTimer();
        } else {
            $qtiTimerFactory = $this->getServiceLocator()->get(QtiTimerFactory::SERVICE_ID);
            $timer = $qtiTimerFactory->getTimer($deliveryExecution->getIdentifier(), $deliveryExecution->getUserIdentifier());
        }

        return $timer;
    }
public function getDeliveryTimer ( $ deliveryExecution ) { if ( is_string ( $ deliveryExecution ) ) { $ deliveryExecution = $ this -> getDeliveryExecutionById ( $ deliveryExecution ) ; } /** @var TestSessionService $testSessionService */ $ testSessionService = $ this -> getServiceLocator ( ) -> get ( TestSessionService :: SERVICE_ID ) ; $ testSession = $ testSessionService -> getTestSession ( $ deliveryExecution ) ; if ( $ testSession instanceof TestSession ) { $ timer = $ testSession -> getTimer ( ) ; } else { $ qtiTimerFactory = $ this -> getServiceLocator ( ) -> get ( QtiTimerFactory :: SERVICE_ID ) ; $ timer = $ qtiTimerFactory -> getTimer ( $ deliveryExecution -> getIdentifier ( ) , $ deliveryExecution -> getUserIdentifier ( ) ) ; } return $ timer ; }
Gets the delivery time counter

@param DeliveryExecutionInterface $deliveryExecution
@return QtiTimer
@throws \common_exception_Error
@throws \common_exception_MissingParameter
@throws \common_exception_NotFound
Gets the delivery time counter