/** * Removes a test taker from a delivery * * @throws \common_Exception * @throws \oat\oatbox\service\ServiceNotFoundException */ public function removeTestTakers() { $deliveryId = $this->getRequestParameter('delivery'); $testTakers = $this->getRequestParameter('testtaker'); $testCenterId = $this->getRequestParameter('testCenter'); if (!is_array($testTakers)) { $testTakers = array($testTakers); } try { $removed = DeliveryHelper::unassignTestTakers($testTakers, $deliveryId, $testCenterId); $notRemoved = array_diff($testTakers, $removed); $this->returnJson(array('success' => !count($notRemoved), 'processed' => $removed, 'unprocessed' => $notRemoved)); } catch (ServiceNotFoundException $e) { \common_Logger::w('No delivery service defined for proctoring'); $this->returnError('Proctoring interface not available'); } }