/** * Returns the pass overview for a given active ID * * @return string HTML code of the pass overview * @access public * * @deprecated */ public function getPassOverview($active_id, $targetclass = "", $targetcommand = "", $short = FALSE, $hide_details = FALSE) { require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; require_once 'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php'; $table = new ilTestPassOverviewTableGUI($this, '', $short ? ilTestPassOverviewTableGUI::CONTEXT_SHORT : ilTestPassOverviewTableGUI::CONTEXT_LONG, isset($_GET['pdf']) && $_GET['pdf'] == 1); $data = array(); $counted_pass = $this->object->_getResultPass($active_id); $reached_pass = $this->object->_getPass($active_id); for ($pass = 0; $pass <= $reached_pass; $pass++) { $row = array(); $finishdate = $this->object->getPassFinishDate($active_id, $pass); if ($finishdate > 0) { if (!$short) { $result_array =& $this->object->getTestResult($active_id, $pass); if (!$result_array['pass']['total_max_points']) { $percentage = 0; } else { $percentage = $result_array['pass']['total_reached_points'] / $result_array['pass']['total_max_points'] * 100; } $total_max = $result_array['pass']['total_max_points']; $total_reached = $result_array['pass']['total_reached_points']; $total_requested_hints = $result_array['pass']['total_requested_hints']; } if (!$hide_details) { if (strlen($targetclass) && strlen($targetcommand)) { $this->ctrl->setParameterByClass($targetclass, 'active_id', $active_id); $this->ctrl->setParameterByClass($targetclass, 'pass', $pass); $aslgui = new ilAdvancedSelectionListGUI(); $aslgui->setListTitle($this->lng->txt('actions')); $aslgui->setId($pass); $aslgui->addItem($this->lng->txt('tst_pass_details'), 'tst_pass_details', $this->ctrl->getLinkTargetByClass($targetclass, $targetcommand)); if ($this->object->isPassDeletionAllowed()) { $aslgui->addItem($this->lng->txt('delete'), 'tst_pass_delete', $this->ctrl->getLinkTargetByClass($targetclass, 'confirmDeletePass')); } $row['pass_details'] = $aslgui->getHTML(); } } if (!$short) { if ($pass == $counted_pass) { $row['scored'] = '⊗'; } else { $row['scored'] = ''; } } $row['pass'] = $pass + 1; $row['date'] = $finishdate; if (!$short) { $row['answered'] = $this->object->getAnsweredQuestionCount($active_id, $pass) . ' ' . strtolower($this->lng->txt('of')) . ' ' . (count($result_array) - 2); if ($this->object->isOfferingQuestionHintsEnabled()) { $row['hints'] = $total_requested_hints; } $row['reached'] = $total_reached . ' ' . strtolower($this->lng->txt('of')) . ' ' . $total_max; $row['percentage'] = $percentage; } $data[] = $row; } } $table->setData($data); return $table->getHTML(); }
private function addScoringSettingsFormSection(ilPropertyFormGUI $form) { $fields = array('count_system', 'mc_scoring', 'score_cutting', 'pass_scoring', 'pass_deletion_allowed'); if ($this->isSectionHeaderRequired($fields)) { // scoring settings $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt('test_scoring')); $form->addItem($header); } // scoring system $count_system = new ilRadioGroupInputGUI($this->lng->txt('tst_text_count_system'), 'count_system'); $count_system->addOption($opt = new ilRadioOption($this->lng->txt('tst_count_partial_solutions'), 0, '')); $opt->setInfo($this->lng->txt('tst_count_partial_solutions_desc')); $count_system->addOption($opt = new ilRadioOption($this->lng->txt('tst_count_correct_solutions'), 1, '')); $opt->setInfo($this->lng->txt('tst_count_correct_solutions_desc')); $count_system->setValue($this->testOBJ->getCountSystem()); $form->addItem($count_system); // mc questions $mc_scoring = new ilRadioGroupInputGUI($this->lng->txt('tst_score_mcmr_questions'), 'mc_scoring'); $mc_scoring->addOption($opt = new ilRadioOption($this->lng->txt('tst_score_mcmr_zero_points_when_unanswered'), 0, '')); $opt->setInfo($this->lng->txt('tst_score_mcmr_zero_points_when_unanswered_desc')); $mc_scoring->addOption($opt = new ilRadioOption($this->lng->txt('tst_score_mcmr_use_scoring_system'), 1, '')); $opt->setInfo($this->lng->txt('tst_score_mcmr_use_scoring_system_desc')); $mc_scoring->setValue($this->testOBJ->getMCScoring()); $form->addItem($mc_scoring); // score cutting $score_cutting = new ilRadioGroupInputGUI($this->lng->txt('tst_score_cutting'), 'score_cutting'); $score_cutting->addOption($opt = new ilRadioOption($this->lng->txt('tst_score_cut_question'), 0, '')); $opt->setInfo($this->lng->txt('tst_score_cut_question_desc')); $score_cutting->addOption($opt = new ilRadioOption($this->lng->txt('tst_score_cut_test'), 1, '')); $opt->setInfo($this->lng->txt('tst_score_cut_test_desc')); $score_cutting->setValue($this->testOBJ->getScoreCutting()); $form->addItem($score_cutting); // pass scoring $pass_scoring = new ilRadioGroupInputGUI($this->lng->txt('tst_pass_scoring'), 'pass_scoring'); $pass_scoring->addOption($opt = new ilRadioOption($this->lng->txt('tst_pass_last_pass'), 0, '')); $opt->setInfo($this->lng->txt('tst_pass_last_pass_desc')); $pass_scoring->addOption($opt = new ilRadioOption($this->lng->txt('tst_pass_best_pass'), 1, '')); $opt->setInfo($this->lng->txt('tst_pass_best_pass_desc')); $pass_scoring->setValue($this->testOBJ->getPassScoring()); $form->addItem($pass_scoring); // deletion of test results $passDeletion = new ilRadioGroupInputGUI($this->lng->txt('tst_pass_deletion'), 'pass_deletion_allowed'); $passDeletion->addOption(new ilRadioOption($this->lng->txt('tst_pass_deletion_not_allowed'), 0, '')); $passDeletion->addOption(new ilRadioOption($this->lng->txt('tst_pass_deletion_allowed'), 1, '')); $passDeletion->setValue($this->testOBJ->isPassDeletionAllowed()); $form->addItem($passDeletion); // disable scoring settings if (!$this->areScoringSettingsWritable()) { $count_system->setDisabled(true); $mc_scoring->setDisabled(true); $score_cutting->setDisabled(true); $pass_scoring->setDisabled(true); } }
/** * @param $testSession * @param $testSequence * @return bool */ private function isDeleteDynamicTestResultsButtonRequired($testSession, $testSequence) { if (!$testSession->getActiveId()) { return false; } if (!$this->object->isDynamicTest()) { return false; } if (!$this->object->isPassDeletionAllowed()) { return false; } if (!$testSequence->hasStarted($testSession)) { return false; } return true; }
/** * Returns the pass overview for a given active ID * * @return string HTML code of the pass overview * @access public * * @deprecated */ function getPassOverview($active_id, $targetclass = "", $targetcommand = "", $short = FALSE, $hide_details = FALSE) { global $ilUser; if ($short) { $template = new ilTemplate("tpl.il_as_tst_pass_overview_short.html", TRUE, TRUE, "Modules/Test"); } else { $template = new ilTemplate("tpl.il_as_tst_pass_overview.html", TRUE, TRUE, "Modules/Test"); } $color_class = array("tblrow1", "tblrow2"); $counter = 0; $user_id = $this->object->_getUserIdFromActiveId($active_id); $counted_pass = $this->object->_getResultPass($active_id); $reached_pass = $this->object->_getPass($active_id); $result_percentage = 0; $result_total_reached = 0; $result_total_max = 0; for ($pass = 0; $pass <= $reached_pass; $pass++) { $finishdate = $this->object->getPassFinishDate($active_id, $pass); if ($finishdate > 0) { if (!$short) { $result_array =& $this->object->getTestResult($active_id, $pass); if (!$result_array["pass"]["total_max_points"]) { $percentage = 0; } else { $percentage = $result_array["pass"]["total_reached_points"] / $result_array["pass"]["total_max_points"] * 100; } $total_max = $result_array["pass"]["total_max_points"]; $total_reached = $result_array["pass"]["total_reached_points"]; $total_requested_hints = $result_array["pass"]["total_requested_hints"]; } if (!$hide_details) { if (strlen($targetclass) && strlen($targetcommand)) { $this->ctrl->setParameterByClass($targetclass, "active_id", $active_id); $this->ctrl->setParameterByClass($targetclass, "pass", $pass); $template->setCurrentBlock("pass_details"); require_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $aslgui = new ilAdvancedSelectionListGUI(); $aslgui->setListTitle($this->lng->txt("actions")); $aslgui->setId($pass); $aslgui->addItem($this->lng->txt("tst_pass_details"), 'tst_pass_details', $this->ctrl->getLinkTargetByClass($targetclass, $targetcommand)); if ($this->object->isPassDeletionAllowed()) { $aslgui->addItem($this->lng->txt("delete"), 'tst_pass_delete', $this->ctrl->getLinkTargetByClass($targetclass, 'confirmDeletePass')); } // Suppress output of advanced selection list for pdf-generation as solution for Mantis #9359 if (!($_GET['pdf'] == 1)) { $template->setVariable("TEXT_PASS_DETAILS", $aslgui->getHTML()); } $template->parseCurrentBlock(); } } $template->setCurrentBlock("result_row"); if ($pass == $counted_pass && !$short) { $template->setVariable("COLOR_CLASS", "tblrowmarked"); $template->setVariable("VALUE_SCORED", "⊗"); if (!$result_array["test"]["total_max_points"]) { $result_percentage = 0; } else { $result_percentage = $result_array["test"]["total_reached_points"] / $result_array["test"]["total_max_points"] * 100; } $result_total_max = $result_array["test"]["total_max_points"]; $result_total_reached = $result_array["test"]["total_reached_points"]; } else { $template->setVariable("COLOR_CLASS", $color_class[$pass % 2]); } $template->setVariable("VALUE_PASS", $pass + 1); $template->setVariable("VALUE_DATE", ilDatePresentation::formatDate(new ilDate($finishdate, IL_CAL_UNIX))); if (!$short) { $template->setVariable("VALUE_ANSWERED", $this->object->getAnsweredQuestionCount($active_id, $pass) . " " . strtolower($this->lng->txt("of")) . " " . (count($result_array) - 2)); if ($this->object->isOfferingQuestionHintsEnabled()) { $template->setVariable("VALUE_HINTS", $total_requested_hints); } $template->setVariable("VALUE_REACHED", $total_reached . " " . strtolower($this->lng->txt("of")) . " " . $total_max); $template->setVariable("VALUE_PERCENTAGE", sprintf("%.2f", $percentage) . "%"); } $template->parseCurrentBlock(); } } $template->setVariable("PASS_COUNTER", $this->lng->txt("pass")); $template->setVariable("DATE", $this->lng->txt("date")); if (!$short) { $template->setVariable("PASS_SCORED", $this->lng->txt("scored_pass")); $template->setVariable("ANSWERED_QUESTIONS", $this->lng->txt("tst_answered_questions")); if ($this->object->isOfferingQuestionHintsEnabled()) { $template->setVariable("REQUESTED_HINTS", $this->lng->txt("tst_question_hints_requested_hint_count_header")); } $template->setVariable("REACHED_POINTS", $this->lng->txt("tst_reached_points")); $template->setVariable("PERCENTAGE_CORRECT", $this->lng->txt("tst_percent_solved")); } $template->parseCurrentBlock(); return $template->get(); }
/** * Display and fill the scoring settings form of the test * * @access public */ function scoringObject($checkonly = FALSE) { global $ilAccess; if (!$ilAccess->checkAccess("write", "", $this->ref_id)) { // allow only write access ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true); $this->ctrl->redirect($this, "infoScreen"); } // using template? $template_settings = null; $template = $this->object->getTemplate(); if ($template) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; include_once "Modules/Test/classes/class.ilObjAssessmentFolderGUI.php"; $template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig()); $template_settings = $template->getSettings(); } $save = strcmp($this->ctrl->getCmd(), "saveScoring") == 0 ? TRUE : FALSE; $total = $this->object->evalTotalPersons(); $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("test_properties_scoring"); // scoring properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("scoring")); $form->addItem($header); // scoring system $count_system = new ilRadioGroupInputGUI($this->lng->txt("tst_text_count_system"), "count_system"); $count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_partial_solutions"), 0, '')); $count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_correct_solutions"), 1, '')); $count_system->setValue($this->object->getCountSystem()); $count_system->setInfo($this->lng->txt("tst_count_system_description")); if ($total) { $count_system->setDisabled(true); } $form->addItem($count_system); // mc questions $mc_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_score_mcmr_questions"), "mc_scoring"); $mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_zero_points_when_unanswered"), 0, '')); $mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_use_scoring_system"), 1, '')); $mc_scoring->setValue($this->object->getMCScoring()); $mc_scoring->setInfo($this->lng->txt("tst_score_mcmr_questions_description")); if ($total) { $mc_scoring->setDisabled(true); } $form->addItem($mc_scoring); // score cutting $score_cutting = new ilRadioGroupInputGUI($this->lng->txt("tst_score_cutting"), "score_cutting"); $score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_question"), 0, '')); $score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_test"), 1, '')); $score_cutting->setValue($this->object->getScoreCutting()); $score_cutting->setInfo($this->lng->txt("tst_score_cutting_description")); if ($total) { $score_cutting->setDisabled(true); } $form->addItem($score_cutting); // pass scoring $pass_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_scoring"), "pass_scoring"); $pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_last_pass"), 0, '')); $pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_best_pass"), 1, '')); $pass_scoring->setValue($this->object->getPassScoring()); $pass_scoring->setInfo($this->lng->txt("tst_pass_scoring_description")); if ($total) { $pass_scoring->setDisabled(true); } $form->addItem($pass_scoring); // enable obligations $checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt("tst_setting_enable_obligations_label"), "obligations_enabled"); $checkBoxEnableObligations->setChecked($this->object->areObligationsEnabled()); $checkBoxEnableObligations->setInfo($this->lng->txt("tst_setting_enable_obligations_info")); if ($total) { $checkBoxEnableObligations->setDisabled(true); } $form->addItem($checkBoxEnableObligations); // offer hints $checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt("tst_setting_offer_hints_label"), "offer_hints"); $checkBoxOfferHints->setChecked($this->object->isOfferingQuestionHintsEnabled()); $checkBoxOfferHints->setInfo($this->lng->txt("tst_setting_offer_hints_info")); if ($total) { $checkBoxOfferHints->setDisabled(true); } $form->addItem($checkBoxOfferHints); // instant feedback $instant_feedback = new ilCheckboxGroupInputGUI($this->lng->txt("tst_instant_feedback"), "instant_feedback"); $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_answer_specific"), 'instant_feedback_specific', '')); $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_answer_generic"), 'instant_feedback_generic', '')); $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_results"), 'instant_feedback_points', '')); $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_solution"), 'instant_feedback_solution', '')); $values = array(); if ($this->object->getSpecificAnswerFeedback()) { array_push($values, 'instant_feedback_specific'); } if ($this->object->getGenericAnswerFeedback()) { array_push($values, 'instant_feedback_generic'); } if ($this->object->getAnswerFeedbackPoints()) { array_push($values, 'instant_feedback_points'); } if ($this->object->getInstantFeedbackSolution()) { array_push($values, 'instant_feedback_solution'); } $instant_feedback->setValue($values); $instant_feedback->setInfo($this->lng->txt("tst_instant_feedback_description")); $form->addItem($instant_feedback); // access to test results $results_access = new ilRadioGroupInputGUI($this->lng->txt("tst_results_access"), "results_access"); $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_always"), 2, '')); $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_finished"), 1, '')); $results_access_date_limitation = new ilRadioOption($this->lng->txt("tst_results_access_date"), 3, ''); $results_access->addOption($results_access_date_limitation); $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_never"), 4, '')); $results_access->setValue($this->object->getScoreReporting()); $results_access->setInfo($this->lng->txt("tst_results_access_description")); // access date $reporting_date = new ilDateTimeInputGUI('', 'reporting_date'); $reporting_date->setShowDate(true); $reporting_date->setShowTime(true); if (strlen($this->object->getReportingDate())) { $reporting_date->setDate(new ilDateTime($this->object->getReportingDate(), IL_CAL_TIMESTAMP)); } else { $reporting_date->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $results_access_date_limitation->addSubItem($reporting_date); $form->addItem($results_access); $results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt("tst_results_print_best_solution"), "print_bs_with_res"); $results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info')); $results_print_best_solution->setValue(1); $results_print_best_solution->setChecked((bool) $this->object->isBestSolutionPrintedWithResult()); $form->addItem($results_print_best_solution); // results presentation $results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt("tst_results_presentation"), "results_presentation"); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_pass_details"), 'pass_details', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_details"), 'solution_details', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_printview"), 'solution_printview', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_feedback"), 'solution_feedback', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_answers_only"), 'solution_answers_only', '')); $signatureOption = new ilCheckboxOption($this->lng->txt("tst_show_solution_signature"), 'solution_signature', ''); $results_presentation->addOption($signatureOption); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_suggested"), 'solution_suggested', '')); $values = array(); if ($this->object->getShowPassDetails()) { array_push($values, 'pass_details'); } if ($this->object->getShowSolutionDetails()) { array_push($values, 'solution_details'); } if ($this->object->getShowSolutionPrintview()) { array_push($values, 'solution_printview'); } if ($this->object->getShowSolutionFeedback()) { array_push($values, 'solution_feedback'); } if ($this->object->getShowSolutionAnswersOnly()) { array_push($values, 'solution_answers_only'); } if ($this->object->getShowSolutionSignature()) { array_push($values, 'solution_signature'); } if ($this->object->getShowSolutionSuggested()) { array_push($values, 'solution_suggested'); } $results_presentation->setValue($values); $results_presentation->setInfo($this->lng->txt("tst_results_presentation_description")); if ($this->object->getAnonymity()) { $signatureOption->setDisabled(true); } $form->addItem($results_presentation); // deletion of test results $passDeletion = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_deletion"), "pass_deletion_allowed"); $passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_not_allowed"), 0, '')); $passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_allowed"), 1, '')); $passDeletion->setValue($this->object->isPassDeletionAllowed()); $form->addItem($passDeletion); // export settings $export_settings = new ilCheckboxGroupInputGUI($this->lng->txt("tst_export_settings"), "export_settings"); $export_settings->addOption(new ilCheckboxOption($this->lng->txt("tst_exp_sc_short"), 'exp_sc_short', '')); $values = array(); if ($this->object->getExportSettingsSingleChoiceShort()) { array_push($values, 'exp_sc_short'); } $export_settings->setValue($values); $form->addItem($export_settings); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $form->addCommandButton("saveScoring", $this->lng->txt("save")); } // remove items when using template if ($template_settings) { foreach ($template_settings as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } $errors = false; if ($save) { $errors = !$form->checkInput(); $form->setValuesByPost(); if ($errors) { $checkonly = false; } } if (!$checkonly) { $this->tpl->setVariable("ADM_CONTENT", $form->getHTML()); } return $errors; }
/** * Returns the pass overview for a given active ID * * @return string HTML code of the pass overview * @access public * * @deprecated */ public function getPassOverview(ilTestSession $testSession, $targetclass = "", $targetcommand = "", $short = FALSE, $hide_details = FALSE) { $active_id = $testSession->getActiveId(); require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; require_once 'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php'; $table = new ilTestPassOverviewTableGUI($this, '', $short ? ilTestPassOverviewTableGUI::CONTEXT_SHORT : ilTestPassOverviewTableGUI::CONTEXT_LONG, isset($_GET['pdf']) && $_GET['pdf'] == 1); $considerHiddenQuestions = true; if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) { $considerHiddenQuestions = false; $table->setObjectiveOrientedPresentationEnabled(true); require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php'; $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession); } $table->init(); $data = array(); $counted_pass = $this->object->_getResultPass($active_id); $reached_pass = $this->object->_getPass($active_id); require_once 'Modules/Test/classes/class.ilTestPassesSelector.php'; $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object); $testPassesSelector->setActiveId($active_id); $lastFinishedPass = $this->testSessionFactory->getSession($active_id)->getLastFinishedPass(); $testPassesSelector->setLastFinishedPass($lastFinishedPass); foreach ($testPassesSelector->getReportablePasses() as $pass) { $row = array(); $considerOptionalQuestions = true; if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) { $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass); $testSequence->loadFromDb(); $testSequence->loadQuestions(); if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) { $considerOptionalQuestions = false; } $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions); $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions); $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence); $objectivesList->loadObjectivesTitles(); $row['objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions()); } if (!$short) { $result_array =& $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions, $considerOptionalQuestions); if (!$result_array['pass']['total_max_points']) { $percentage = 0; } else { $percentage = $result_array['pass']['total_reached_points'] / $result_array['pass']['total_max_points'] * 100; } $total_max = $result_array['pass']['total_max_points']; $total_reached = $result_array['pass']['total_reached_points']; $total_requested_hints = $result_array['pass']['total_requested_hints']; } if (!$hide_details) { if (strlen($targetclass) && strlen($targetcommand)) { $this->ctrl->setParameterByClass($targetclass, 'active_id', $active_id); $this->ctrl->setParameterByClass($targetclass, 'pass', $pass); $aslgui = new ilAdvancedSelectionListGUI(); $aslgui->setListTitle($this->lng->txt('actions')); $aslgui->setId($pass); $aslgui->addItem($this->lng->txt('tst_pass_details'), 'tst_pass_details', $this->ctrl->getLinkTargetByClass($targetclass, $targetcommand)); if ($this->object->isPassDeletionAllowed() && $pass != $counted_pass) { $aslgui->addItem($this->lng->txt('delete'), 'tst_pass_delete', $this->ctrl->getLinkTargetByClass($targetclass, 'confirmDeletePass')); } $row['pass_details'] = $aslgui->getHTML(); } } if (!$short) { if ($pass == $counted_pass) { $row['scored'] = '⊗'; } else { $row['scored'] = ''; } } $row['pass'] = $pass + 1; $row['date'] = $this->object->getPassFinishDate($active_id, $pass); if (!$short) { $row['answered'] = $result_array['pass']['num_workedthrough'] . ' ' . strtolower($this->lng->txt('of')) . ' ' . (count($result_array) - 2); if ($this->object->isOfferingQuestionHintsEnabled()) { $row['hints'] = $total_requested_hints; } $row['reached'] = $total_reached . ' ' . strtolower($this->lng->txt('of')) . ' ' . $total_max; $row['percentage'] = $percentage; } $data[] = $row; } $table->setData($data); return $table->getHTML(); }