Ejemplo n.º 1
0
 /**
  * Output of the pass overview for a test called by a test participant
  *
  * @global ilTabsGUI $ilTabs
  */
 function outUserResultsOverview()
 {
     global $ilUser, $ilTabs;
     $ilTabs->setBackTarget($this->lng->txt('tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen'));
     $testSession = $this->testSessionFactory->getSession();
     $active_id = $testSession->getActiveId();
     $user_id = $ilUser->getId();
     $uname = $this->object->userLookupFullName($user_id, TRUE);
     if (!$this->object->canShowTestResults($testSession, $ilUser->getId())) {
         $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
     }
     $templatehead = new ilTemplate("tpl.il_as_tst_results_participants.html", TRUE, TRUE, "Modules/Test");
     $template = new ilTemplate("tpl.il_as_tst_results_participant.html", TRUE, TRUE, "Modules/Test");
     require_once 'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
     $toolbar = new ilTestResultsToolbarGUI($this->ctrl, $this->tpl, $this->lng);
     $this->ctrl->setParameter($this, 'pdf', '1');
     $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, 'outUserResultsOverview'));
     $this->ctrl->setParameter($this, 'pdf', '');
     include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
     if ($this->object->canShowCertificate($testSession, $user_id, $active_id)) {
         $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
     }
     $toolbar->build();
     $templatehead->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
     $hide_details = !$this->object->getShowPassDetails();
     #if ($hide_details)
     #{
     #	$executable = $this->object->isExecutable($testSession, $ilUser->getId());
     #	if (!$executable["executable"]) $hide_details = FALSE;
     #}
     $template->setCurrentBlock("pass_overview");
     $overview = $this->getPassOverview($active_id, "iltestevaluationgui", "outUserPassDetails", FALSE, $hide_details);
     $template->setVariable("PASS_OVERVIEW", $overview);
     $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results_overview"));
     $template->parseCurrentBlock();
     $user_data = $this->getResultsUserdata($testSession, $active_id, TRUE);
     if ($this->object->getAnonymity()) {
         $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
     } else {
         $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
         $template->setVariable("USER_DATA", $user_data);
     }
     if ($this->isGradingMessageRequired()) {
         $template->setCurrentBlock('grading_message');
         $template->setVariable('GRADING_MESSAGE', $this->getGradingMessage($active_id));
         $template->parseCurrentBlock();
     }
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
     if ($this->object->getShowSolutionAnswersOnly()) {
         $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
     }
     $templatehead->setVariable("RESULTS_PARTICIPANT", $template->get());
     if ($this->isPdfDeliveryRequest()) {
         //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
         require_once 'class.ilTestPDFGenerator.php';
         ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
         //$this->object->deliverPDFfromHTML($template->get(), sprintf($this->lng->txt("tst_result_user_name"), $uname));
     } else {
         $this->tpl->setContent($templatehead->get());
     }
 }