/**
  * ilTestOutputGUI constructor
  *
  * @param ilObjTest $a_object
  */
 public function __construct($a_object)
 {
     parent::ilTestServiceGUI($a_object);
     $this->ref_id = $_GET["ref_id"];
     global $rbacsystem, $ilUser;
     require_once 'Modules/Test/classes/class.ilTestPasswordChecker.php';
     $this->passwordChecker = new ilTestPasswordChecker($rbacsystem, $ilUser, $this->object);
     $this->processLocker = null;
     $this->assSettings = null;
 }
Exemplo n.º 2
0
 /**
  * @param $show_pass_details
  * @param $show_answers
  * @param $show_reached_points
  * @param $show_user_results
  *
  * @return ilTemplate
  */
 public function createUserResults($show_pass_details, $show_answers, $show_reached_points, $show_user_results)
 {
     global $ilTabs, $ilDB;
     $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'participants'));
     if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
         require_once 'Services/Link/classes/class.ilLink.php';
         $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
         $ilTabs->setBack2Target($this->lng->txt('back_to_objective_container'), $courseLink);
     }
     $template = new ilTemplate("tpl.il_as_tst_participants_result_output.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, $this->ctrl->getCmd()));
     $this->ctrl->setParameter($this, 'pdf', '');
     if ($show_answers) {
         if (isset($_GET['show_best_solutions'])) {
             $_SESSION['tst_results_show_best_solutions'] = true;
         } elseif (isset($_GET['hide_best_solutions'])) {
             $_SESSION['tst_results_show_best_solutions'] = false;
         } elseif (!isset($_SESSION['tst_results_show_best_solutions'])) {
             $_SESSION['tst_results_show_best_solutions'] = false;
         }
         if ($_SESSION['tst_results_show_best_solutions']) {
             $this->ctrl->setParameter($this, 'hide_best_solutions', '1');
             $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'showUserAnswers'));
             $this->ctrl->setParameter($this, 'hide_best_solutions', '');
         } else {
             $this->ctrl->setParameter($this, 'show_best_solutions', '1');
             $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'showUserAnswers'));
             $this->ctrl->setParameterByClass('', 'show_best_solutions', '');
         }
     }
     require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
     $participantData = new ilTestParticipantData($ilDB, $this->lng);
     if ($this->object->getFixedParticipants()) {
         $participantData->setUserIds($show_user_results);
     } else {
         $participantData->setActiveIds($show_user_results);
     }
     $participantData->load($this->object->getTestId());
     $toolbar->setParticipantSelectorOptions($participantData->getOptionArray($show_user_results));
     $toolbar->build();
     $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
     include_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
     $serviceGUI = new ilTestServiceGUI($this->object);
     $serviceGUI->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
     $serviceGUI->setParticipantData($participantData);
     $count = 0;
     foreach ($show_user_results as $key => $active_id) {
         $count++;
         $results = "";
         if ($this->object->getFixedParticipants()) {
             $active_id = $this->object->getActiveIdOfUser($active_id);
         }
         if ($active_id > 0) {
             $results = $serviceGUI->getResultsOfUserOutput($this->testSessionFactory->getSession($active_id), $active_id, $this->object->_getResultPass($active_id), $this, $show_pass_details, $show_answers, FALSE, $show_reached_points);
         }
         if ($count < count($show_user_results)) {
             $template->touchBlock("break");
         }
         $template->setCurrentBlock("user_result");
         $template->setVariable("USER_RESULT", $results);
         $template->parseCurrentBlock();
     }
     if ($this->isPdfDeliveryRequest()) {
         require_once 'class.ilTestPDFGenerator.php';
         ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
     } else {
         return $template;
     }
 }
Exemplo n.º 3
0
 /**
  * @param $activeId
  * @param $pass
  * @return string
  */
 private function renderOverviewContent($activeId, $pass)
 {
     $results = $this->testOBJ->getTestResult($activeId, $pass, false, $this->isConsiderHiddenQuestionsEnabled());
     $gui = new ilTestServiceGUI($this);
     return $gui->getPassListOfAnswers($results, $activeId, $pass, true, false, false, true);
 }
Exemplo n.º 4
0
 /**
  * ilTestScoringGUI constructor
  *
  * The constructor takes the test object reference as parameter 
  *
  * @param object $a_object Associated ilObjTest class
  * @access public
  */
 function ilTestScoringGUI(ilObjTest $a_object)
 {
     parent::ilTestServiceGUI($a_object);
 }
 /**
  * ilTestOutputGUI constructor
  *
  * @param object $a_object Associated ilObjSurvey class
  * @access public
  */
 function __construct($a_object)
 {
     parent::ilTestServiceGUI($a_object);
     $this->ref_id = $_GET["ref_id"];
 }
 /**
  * ilTestEvaluationGUI constructor
  *
  * The constructor takes possible arguments an creates an instance of the 
  * ilTestEvaluationGUI object.
  *
  * @param ilObjTest $a_object Associated ilObjTest class
  */
 public function __construct(ilObjTest $a_object)
 {
     parent::ilTestServiceGUI($a_object);
 }
 /**
 * ilTestEvaluationGUI constructor
 *
 * The constructor takes possible arguments an creates an instance of the 
 * ilTestEvaluationGUI object.
 *
 * @param object $a_object Associated ilObjTest class
 * @access public
 */
 function ilTestEvaluationGUI($a_object)
 {
     global $ilAccess;
     parent::ilTestServiceGUI($a_object);
 }
Exemplo n.º 8
0
 /**
  * @param $show_pass_details
  * @param $show_answers
  * @param $show_reached_points
  * @param $show_user_results
  *
  * @return ilTemplate
  */
 public function createUserResults($show_pass_details, $show_answers, $show_reached_points, $show_user_results)
 {
     $template = new ilTemplate("tpl.il_as_tst_participants_result_output.html", TRUE, TRUE, "Modules/Test");
     include_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
     $serviceGUI = new ilTestServiceGUI($this->object);
     $count = 0;
     foreach ($show_user_results as $key => $active_id) {
         $count++;
         $results = "";
         if ($this->object->getFixedParticipants()) {
             $active_id = $this->object->getActiveIdOfUser($active_id);
         }
         if ($active_id > 0) {
             $results = $serviceGUI->getResultsOfUserOutput($this->testSessionFactory->getSession($active_id), $active_id, $this->object->_getResultPass($active_id), $show_pass_details, $show_answers, FALSE, $show_reached_points);
         }
         if ($count < count($show_user_results)) {
             $template->touchBlock("break");
         }
         $template->setCurrentBlock("user_result");
         $template->setVariable("USER_RESULT", $results);
         $template->parseCurrentBlock();
     }
     $template->setVariable("BACK_TEXT", $this->lng->txt("back"));
     $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "participants"));
     $template->setVariable("PRINT_TEXT", $this->lng->txt("print"));
     $template->setVariable("PRINT_URL", "javascript:window.print();");
     return $template;
 }
 public function __construct(ilTestOutputGUI $testOutputGUI, ilObjTest $testOBJ, ilTestSession $testSession)
 {
     $this->testOutputGUI = $testOutputGUI;
     $this->testSession = $testSession;
     parent::ilTestServiceGUI($testOBJ);
 }