* @package taoDelivery */ class DeliveryServerService extends \oat\taoDelivery\model\execution\DeliveryServerService { /** * (non-PHPdoc) * @see \oat\taoDelivery\model\execution\DeliveryServerService::getResumableStates() */ public function getResumableStates() { return array_merge( parent::getResumableStates(), [ DeliveryExecution::STATE_AWAITING ,DeliveryExecution::STATE_AUTHORIZED ] ); } /** * @param DeliveryDeliveryExecution $deliveryExecution * @throws common_exception_NotFound * @throws InvalidServiceManagerException */ public function revoke(DeliveryDeliveryExecution $deliveryExecution) { if($deliveryExecution->getState()->getUri() !== DeliveryExecution::STATE_PAUSED){ /** @var DeliveryExecutionStateService $deliveryExecutionStateService */ $deliveryExecutionStateService = $this->getServiceLocator()->get(DeliveryExecutionStateService::SERVICE_ID); //do not remove these comments, this is used to generate the translation in .po file // __('Assessment has been paused due to attempt to switch to another window/tab.'); $deliveryExecutionStateService->pauseExecution( $deliveryExecution, [ 'reasons' => ['category' => 'focus-loss'], 'comment' => 'Assessment has been paused due to attempt to switch to another window/tab.', ] ); } } }