public function printRubric()
    {
        if (!$this->hasRequestParameter('id')) {
            throw new \common_exception_MissingParameter('id');
        }
        $idList = $this->getRequestParameter('id');
        if (!is_array($idList)) {
            $idList = [$idList];
        }
        $result = [];

        /** @var $assessmentResultsService AssessmentResultsService */
        $assessmentResultsService = $this->getServiceManager()->get(AssessmentResultsService::SERVICE_ID);

        foreach ($idList as $deliveryExecutionId) {
            $deliveryExecution = ServiceProxy::singleton()->getDeliveryExecution($deliveryExecutionId);
            $deliveryData = $assessmentResultsService->getDeliveryData($deliveryExecution);

            if (!$deliveryData['end']) {
                continue;
            }
            $result[] = [
                'testData' => $assessmentResultsService->getTestData($deliveryExecution),
                'rubricContent' => $assessmentResultsService->getPrintableRubric($deliveryExecution),
                'testTakerData' => $assessmentResultsService->getTestTakerData($deliveryExecution),
                'deliveryData' => $deliveryData,
            ];
        }

        $this->setData('rubrics', $result);
        $this->setData('content-template', 'Reporting/print_rubric.tpl');
        $this->setView('Reporting/layout.tpl');
    }
public function printRubric()
    {
        if (!$this->hasRequestParameter('id')) {
            throw new \common_exception_MissingParameter('id');
        }
        $idList = $this->getRequestParameter('id');
        if (!is_array($idList)) {
            $idList = [$idList];
        }
        $result = [];

        /** @var $assessmentResultsService AssessmentResultsService */
        $assessmentResultsService = $this->getServiceManager()->get(AssessmentResultsService::SERVICE_ID);

        foreach ($idList as $deliveryExecutionId) {
            $deliveryExecution = ServiceProxy::singleton()->getDeliveryExecution($deliveryExecutionId);
            $deliveryData = $assessmentResultsService->getDeliveryData($deliveryExecution);

            if (!$deliveryData['end']) {
                continue;
            }
            $result[] = [
                'testData' => $assessmentResultsService->getTestData($deliveryExecution),
                'rubricContent' => $assessmentResultsService->getPrintableRubric($deliveryExecution),
                'testTakerData' => $assessmentResultsService->getTestTakerData($deliveryExecution),
                'deliveryData' => $deliveryData,
            ];
        }

        $this->setData('rubrics', $result);
        $this->setData('content-template', 'Reporting/print_rubric.tpl');
        $this->setView('Reporting/layout.tpl');
    }
public function printRubric ( ) { if ( ! $ this -> hasRequestParameter ( 'id' ) ) { throw new \ common_exception_MissingParameter ( 'id' ) ; } $ idList = $ this -> getRequestParameter ( 'id' ) ; if ( ! is_array ( $ idList ) ) { $ idList = [ $ idList ] ; } $ result = [ ] ; /** @var $assessmentResultsService AssessmentResultsService */ $ assessmentResultsService = $ this -> getServiceManager ( ) -> get ( AssessmentResultsService :: SERVICE_ID ) ; foreach ( $ idList as $ deliveryExecutionId ) { $ deliveryExecution = ServiceProxy :: singleton ( ) -> getDeliveryExecution ( $ deliveryExecutionId ) ; $ deliveryData = $ assessmentResultsService -> getDeliveryData ( $ deliveryExecution ) ; if ( ! $ deliveryData [ 'end' ] ) { continue ; } $ result [ ] = [ 'testData' => $ assessmentResultsService -> getTestData ( $ deliveryExecution ) , 'rubricContent' => $ assessmentResultsService -> getPrintableRubric ( $ deliveryExecution ) , 'testTakerData' => $ assessmentResultsService -> getTestTakerData ( $ deliveryExecution ) , 'deliveryData' => $ deliveryData , ] ; } $ this -> setData ( 'rubrics' , $ result ) ; $ this -> setData ( 'content-template' , 'Reporting/print_rubric.tpl' ) ; $ this -> setView ( 'Reporting/layout.tpl' ) ; }
Render printable rubrics

@throws \common_exception_Error
@throws \common_exception_MissingParameter
@throws \oat\oatbox\service\ServiceNotFoundException
Render printable rubrics