コード例 #1
0
 /**
  * Display the session history of the current test center
  */
 public function sessionHistory()
 {
     $testCenter = $this->getCurrentTestCenter();
     $delivery = $this->getCurrentDelivery(false);
     $sessions = $this->getRequestParameter('session');
     $requestOptions = $this->getRequestOptions(['sortby' => 'timestamp', 'sortorder' => 'desc', 'periodStart' => '', 'periodEnd' => '', 'detailed' => false]);
     if (!is_array($sessions)) {
         $sessions = $sessions ? explode(',', $sessions) : [];
     }
     $breadcrumbs = [BreadcrumbsHelper::testCenters(), BreadcrumbsHelper::testCenter($testCenter, TestCenterHelper::getTestCenters()), BreadcrumbsHelper::deliveries($testCenter, [BreadcrumbsHelper::diagnostics($testCenter)])];
     $viewData = ['testCenter' => $testCenter->getUri(), 'set' => TestCenterHelper::getSessionHistory($sessions, true, $requestOptions), 'sessions' => $sessions, 'sortBy' => $requestOptions['sortBy'], 'sortOrder' => $requestOptions['sortOrder'], 'periodStart' => $requestOptions['periodStart'], 'periodEnd' => $requestOptions['periodEnd']];
     if ($delivery) {
         $breadcrumbs[] = BreadcrumbsHelper::deliveryMonitoring($testCenter, $delivery, DeliveryHelper::getDeliveries($testCenter));
         $viewData['delivery'] = $delivery->getUri();
     } else {
         $breadcrumbs[] = BreadcrumbsHelper::deliveryMonitoringAll($testCenter, DeliveryHelper::getDeliveries($testCenter));
     }
     $breadcrumbs[] = BreadcrumbsHelper::sessionHistory($testCenter, $delivery, $sessions);
     if (count($sessions) > 1) {
         $title = __('Detailed Session History of a selection');
     } else {
         $deliveryExecution = \taoDelivery_models_classes_execution_ServiceProxy::singleton()->getDeliveryExecution($sessions[0]);
         $title = __('Detailed Session History of %s', $deliveryExecution->getLabel());
     }
     $this->setData('title', $title);
     $this->composeView('session-history', $viewData, $breadcrumbs);
 }
コード例 #2
0
 /**
  * Displays the index page of the extension: list all available deliveries.
  */
 public function index()
 {
     $testCenters = TestCenterHelper::getTestCenters();
     $data = array('list' => $testCenters);
     if (tao_helpers_Request::isAjax()) {
         $this->returnJson($data);
     } else {
         $this->setData('select-message', $this->convert('Please select one or more test site to manage proctors'));
         $this->composeView('proctorManager-index', $data, array(BreadcrumbsHelper::testCenters(), BreadcrumbsHelper::proctorManager()), 'pages/proctorManager.tpl');
     }
 }
コード例 #3
0
 /**
  * Displays the three action box for the test center
  */
 public function testCenter()
 {
     $testCenters = TestCenterHelper::getTestCenters();
     $testCenter = $this->getCurrentTestCenter();
     $data = array('testCenter' => $testCenter->getUri(), 'title' => sprintf($this->convert('Test site %s'), $testCenter->getLabel()), 'list' => TestCenterHelper::getTestCenterActions($testCenter));
     if (\tao_helpers_Request::isAjax()) {
         $this->returnJson($data);
     } else {
         $this->composeView('testcenters-testcenter', $data, array(BreadcrumbsHelper::testCenters(), BreadcrumbsHelper::testCenter($testCenter, $testCenters)));
     }
 }
コード例 #4
0
 /**
  * Lists the available test takers to assign to a delivery
  *
  * @throws \Exception
  * @throws \common_Exception
  * @throws \oat\oatbox\service\ServiceNotFoundException
  */
 public function testTakers()
 {
     $delivery = $this->getCurrentDelivery();
     $testCenter = $this->getCurrentTestCenter();
     try {
         $requestOptions = $this->getRequestOptions();
         $testTakers = DeliveryHelper::getAvailableTestTakers($delivery, $testCenter, $requestOptions);
         $this->composeView('delivery-testtakers', array('delivery' => $delivery->getUri(), 'testCenter' => $testCenter->getUri(), 'set' => $testTakers), array(BreadcrumbsHelper::testCenters(), BreadcrumbsHelper::testCenter($testCenter, TestCenterHelper::getTestCenters()), BreadcrumbsHelper::deliveries($testCenter, array(BreadcrumbsHelper::diagnostics($testCenter))), BreadcrumbsHelper::deliveryMonitoring($testCenter, $delivery, DeliveryHelper::getDeliveries($testCenter)), BreadcrumbsHelper::manageTestTakers($testCenter, $delivery, 'testTakers')));
     } catch (ServiceNotFoundException $e) {
         \common_Logger::w('No delivery service defined for proctoring');
         $this->returnError('Proctoring interface not available');
     }
 }
コード例 #5
0
 /**
  * Display the diagnostic runner
  */
 public function diagnostic()
 {
     $testCenter = $this->getCurrentTestCenter();
     $this->setData('title', __('Readiness Check for test site %s', $testCenter->getLabel()));
     $this->composeView('diagnostic-runner', array('testCenter' => $testCenter->getUri(), 'config' => TestCenterHelper::getDiagnosticConfig($testCenter)), array(BreadcrumbsHelper::testCenters(), BreadcrumbsHelper::testCenter($testCenter, TestCenterHelper::getTestCenters()), BreadcrumbsHelper::diagnostics($testCenter, array(BreadcrumbsHelper::deliveries($testCenter)))));
 }