/** * Terminates delivery executions * * @throws \common_Exception * @throws \oat\oatbox\service\ServiceNotFoundException */ public function terminateExecutions() { $deliveryExecution = $this->getRequestParameter('execution'); $reason = $this->getRequestParameter('reason'); if (!is_array($deliveryExecution)) { $deliveryExecution = array($deliveryExecution); } try { $terminated = DeliveryHelper::terminateExecutions($deliveryExecution, $reason); $notTerminated = array_diff($deliveryExecution, $terminated); $this->returnJson(array('success' => !count($notTerminated), 'processed' => $terminated, 'unprocessed' => $notTerminated)); } catch (ServiceNotFoundException $e) { \common_Logger::w('No delivery service defined for proctoring'); $this->returnError('Proctoring interface not available'); } }