public function initFilter()
 {
     $this->setDisableFilterHiding(true);
     include_once 'Services/Form/classes/class.ilSelectInputGUI.php';
     $available_questions = new ilSelectInputGUI($this->lng->txt('question'), 'question');
     $select_questions = array();
     if (!$this->getParentObject()->object->isRandomTest()) {
         $questions = $this->getParentObject()->object->getTestQuestions();
     } else {
         $questions = $this->getParentObject()->object->getPotentialRandomTestQuestions();
     }
     $scoring = ilObjAssessmentFolder::_getManualScoring();
     foreach ($questions as $data) {
         include_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
         $info = assQuestion::_getQuestionInfo($data['question_id']);
         $type = $info["question_type_fi"];
         if (in_array($type, $scoring)) {
             $maxpoints = assQuestion::_getMaximumPoints($data["question_id"]);
             if ($maxpoints == 1) {
                 $maxpoints = ' (' . $maxpoints . ' ' . $this->lng->txt('point') . ')';
             } else {
                 $maxpoints = ' (' . $maxpoints . ' ' . $this->lng->txt('points') . ')';
             }
             $select_questions[$data["question_id"]] = $data['title'] . $maxpoints . ' [' . $this->lng->txt('question_id_short') . ': ' . $data["question_id"] . ']';
         }
     }
     if (!$select_questions) {
         $select_questions[0] = $this->lng->txt('tst_no_scorable_qst_available');
     }
     $available_questions->setOptions(array('' => $this->lng->txt('please_choose')) + $select_questions);
     $this->addFilterItem($available_questions);
     $available_questions->readFromSession();
     $this->filter['question'] = $available_questions->getValue();
     $pass = new ilSelectInputGUI($this->lng->txt('pass'), 'pass');
     $passes = array();
     $max_pass = $this->getParentObject()->object->getMaxPassOfTest();
     for ($i = 1; $i <= $max_pass; $i++) {
         $passes[$i] = $i;
     }
     $pass->setOptions($passes);
     $this->addFilterItem($pass);
     $pass->readFromSession();
     $this->filter['pass'] = $pass->getValue();
 }
Пример #2
0
 public function getTestParticipantsForManualScoring($filter = NULL)
 {
     global $ilDB;
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     $scoring = ilObjAssessmentFolder::_getManualScoring();
     if (count($scoring) == 0) {
         return array();
     }
     $participants =& $this->getTestParticipants();
     $filtered_participants = array();
     foreach ($participants as $active_id => $participant) {
         $qstType_IN_manScoreableQstTypes = $ilDB->in('qpl_questions.question_type_fi', $scoring, false, 'integer');
         $queryString = "\n\t\t\t\tSELECT\t\ttst_test_result.manual\n\t\t\t\t\n\t\t\t\tFROM\t\ttst_test_result\n\t\t\t\t\n\t\t\t\tINNER JOIN\tqpl_questions\n\t\t\t\tON\t\t\ttst_test_result.question_fi = qpl_questions.question_id\n\t\t\t\n\t\t\t\tWHERE\t\ttst_test_result.active_fi = %s\n\t\t\t\tAND\t\t\t{$qstType_IN_manScoreableQstTypes}\n\t\t\t";
         $result = $ilDB->queryF($queryString, array("integer"), array($active_id));
         $count = $result->numRows();
         if ($count > 0) {
             switch ($filter) {
                 case 1:
                     // only active users
                     if ($participant->active) {
                         $filtered_participants[$active_id] = $participant;
                     }
                     break;
                 case 2:
                     // only inactive users
                     if (!$participant->active) {
                         $filtered_participants[$active_id] = $participant;
                     }
                     break;
                 case 3:
                     // all users
                     $filtered_participants[$active_id] = $participant;
                     break;
                 case 4:
                     // already scored participants
                     //$found = 0;
                     //while ($row = $ilDB->fetchAssoc($result))
                     //{
                     //	if ($row["manual"]) $found++;
                     //}
                     //if ($found == $count)
                     //{
                     //$filtered_participants[$active_id] = $participant;
                     //}
                     //else
                     //{
                     $assessmentSetting = new ilSetting("assessment");
                     $manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
                     if ($manscoring_done) {
                         $filtered_participants[$active_id] = $participant;
                     }
                     //}
                     break;
                 case 5:
                     // unscored participants
                     //$found = 0;
                     //while ($row = $ilDB->fetchAssoc($result))
                     //{
                     //	if ($row["manual"]) $found++;
                     //}
                     //if ($found == 0)
                     //{
                     $assessmentSetting = new ilSetting("assessment");
                     $manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
                     if (!$manscoring_done) {
                         $filtered_participants[$active_id] = $participant;
                     }
                     //}
                     break;
                 case 6:
                     // partially scored participants
                     $found = 0;
                     while ($row = $ilDB->fetchAssoc($result)) {
                         if ($row["manual"]) {
                             $found++;
                         }
                     }
                     if ($found > 0 && $found < $count) {
                         $filtered_participants[$active_id] = $participant;
                     }
                     break;
                 default:
                     $filtered_participants[$active_id] = $participant;
                     break;
             }
         }
     }
     return $filtered_participants;
 }
Пример #3
0
 /**
  * adds tabs to tab gui object
  *
  * @param ilTabsGUI $tabs_gui
  */
 function getTabs(&$tabs_gui)
 {
     global $ilAccess, $ilUser, $ilHelp;
     if (preg_match('/^ass(.*?)gui$/i', $this->ctrl->getNextClass($this))) {
         return;
     } else {
         if ($this->ctrl->getNextClass($this) == 'ilassquestionpagegui') {
             return;
         }
     }
     $ilHelp->setScreenIdComponent("tst");
     $hidden_tabs = array();
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         $template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
         $hidden_tabs = $template->getHiddenTabs();
     }
     // for local use in this f*****g sledge hammer method
     $curUserHasWriteAccess = $ilAccess->checkAccess("write", "", $this->ref_id);
     switch ($this->ctrl->getCmdClass()) {
         // no tabs .. no subtabs .. during test pass
         case 'iltestoutputgui':
             // tab handling happens within GUIs
         // tab handling happens within GUIs
         case 'iltestevaluationgui':
         case 'iltestevalobjectiveorientedgui':
             return;
         case 'ilmarkschemagui':
         case 'ilobjtestsettingsgeneralgui':
         case 'ilobjtestsettingsscoringresultsgui':
             if ($curUserHasWriteAccess) {
                 $this->getSettingsSubTabs($hidden_tabs);
             }
             break;
     }
     if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
         require_once 'Services/Link/classes/class.ilLink.php';
         $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
         $tabs_gui->setBackTarget($this->lng->txt('back_to_objective_container'), $courseLink);
     }
     switch ($this->ctrl->getCmd()) {
         case "resume":
         case "previous":
         case "next":
         case "summary":
         case "directfeedback":
         case "finishTest":
         case "outCorrectSolution":
         case "passDetails":
         case "showAnswersOfUser":
         case "outUserResultsOverview":
         case "backFromSummary":
         case "show_answers":
         case "setsolved":
         case "resetsolved":
         case "confirmFinish":
         case "outTestSummary":
         case "outQuestionSummary":
         case "gotoQuestion":
         case "selectImagemapRegion":
         case "confirmSubmitAnswers":
         case "finalSubmission":
         case "postpone":
         case "redirectQuestion":
         case "outUserPassDetails":
         case "checkPassword":
         case "exportCertificate":
         case "finishListOfAnswers":
         case "backConfirmFinish":
         case "showFinalStatement":
             return;
             break;
             /*case "browseForQuestions":
             		case "filter":
             		case "resetFilter":
             		case "resetTextFilter":
             		case "insertQuestions":
             			// #8497: resetfilter is also used in lp
             			if($this->ctrl->getNextClass($this) != "illearningprogressgui")
             			{
             				return $this->getBrowseForQuestionsTab($tabs_gui);
             			}				
             			break;*/
         /*case "browseForQuestions":
         		case "filter":
         		case "resetFilter":
         		case "resetTextFilter":
         		case "insertQuestions":
         			// #8497: resetfilter is also used in lp
         			if($this->ctrl->getNextClass($this) != "illearningprogressgui")
         			{
         				return $this->getBrowseForQuestionsTab($tabs_gui);
         			}				
         			break;*/
         case "scoring":
         case "certificate":
         case "certificateservice":
         case "certificateImport":
         case "certificateUpload":
         case "certificateEditor":
         case "certificateDelete":
         case "certificateSave":
         case "defaults":
         case "deleteDefaults":
         case "addDefaults":
         case "applyDefaults":
         case "inviteParticipants":
         case "searchParticipants":
             if ($curUserHasWriteAccess && in_array($this->ctrl->getCmdClass(), array('ilobjtestgui', 'ilcertificategui'))) {
                 $this->getSettingsSubTabs($hidden_tabs);
             }
             break;
         case "export":
         case "print":
             break;
         case "statistics":
         case "eval_a":
         case "detailedEvaluation":
         case "outEvaluation":
         case "singleResults":
         case "exportEvaluation":
         case "evalUserDetail":
         case "passDetails":
         case "outStatisticsResultsOverview":
         case "statisticsPassDetails":
             $this->getStatisticsSubTabs();
             break;
     }
     if (strcmp(strtolower(get_class($this->object)), "ilobjtest") == 0) {
         // questions tab
         if ($ilAccess->checkAccess("write", "", $this->ref_id) && !in_array('assQuestions', $hidden_tabs)) {
             $force_active = $_GET["up"] != "" || $_GET["down"] != "" ? true : false;
             if (!$force_active) {
                 if ($_GET["browse"] == 1) {
                     $force_active = true;
                 }
             }
             switch ($this->object->getQuestionSetType()) {
                 case ilObjTest::QUESTION_SET_TYPE_FIXED:
                     $target = $this->ctrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'showPage');
                     break;
                 case ilObjTest::QUESTION_SET_TYPE_RANDOM:
                     $target = $this->ctrl->getLinkTargetByClass('ilTestRandomQuestionSetConfigGUI');
                     break;
                 case ilObjTest::QUESTION_SET_TYPE_DYNAMIC:
                     $target = $this->ctrl->getLinkTargetByClass('ilObjTestDynamicQuestionSetConfigGUI');
                     break;
             }
             $tabs_gui->addTarget("assQuestions", $target, array("questions", "createQuestion", "randomselect", "back", "createRandomSelection", "cancelRandomSelect", "insertRandomSelection", "removeQuestions", "moveQuestions", "insertQuestionsBefore", "insertQuestionsAfter", "confirmRemoveQuestions", "cancelRemoveQuestions", "executeCreateQuestion", "cancelCreateQuestion", "addQuestionpool", "saveRandomQuestions", "saveQuestionSelectionMode", "print", "addsource", "removesource", "randomQuestions"), "", "", $force_active);
         }
         // info tab
         if ($ilAccess->checkAccess("read", "", $this->ref_id) && !in_array('info_short', $hidden_tabs)) {
             $tabs_gui->addTarget("info_short", $this->ctrl->getLinkTarget($this, 'infoScreen'), array("infoScreen", "outIntroductionPage", "showSummary", "setAnonymousId", "outUserListOfAnswerPasses", "redirectToInfoScreen"));
         }
         // settings tab
         if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
             if (!in_array('settings', $hidden_tabs)) {
                 $settingsCommands = array("marks", "showMarkSchema", "addMarkStep", "deleteMarkSteps", "addSimpleMarkSchema", "saveMarks", "certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave", "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport", "scoring", "defaults", "addDefaults", "deleteDefaults", "applyDefaults", "inviteParticipants", "saveFixedParticipantsStatus", "searchParticipants", "addParticipants");
                 require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
                 $reflection = new ReflectionClass('ilObjTestSettingsGeneralGUI');
                 foreach ($reflection->getConstants() as $name => $value) {
                     if (substr($name, 0, 4) == 'CMD_') {
                         $settingsCommands[] = $value;
                     }
                 }
                 require_once 'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php';
                 $reflection = new ReflectionClass('ilObjTestSettingsScoringResultsGUI');
                 foreach ($reflection->getConstants() as $name => $value) {
                     if (substr($name, 0, 4) == 'CMD_') {
                         $settingsCommands[] = $value;
                     }
                 }
                 $settingsCommands[] = "";
                 // DO NOT KNOW WHAT THIS IS DOING, BUT IT'S REQUIRED
                 $tabs_gui->addTarget("settings", $this->ctrl->getLinkTargetByClass('ilObjTestSettingsGeneralGUI'), $settingsCommands, array("ilmarkschemagui", "ilobjtestsettingsgeneralgui", "ilobjtestsettingsscoringresultsgui", "ilobjtestgui", "ilcertificategui"));
             }
             // skill service
             if ($this->object->isSkillServiceEnabled() && ilObjTest::isSkillManagementGloballyActivated()) {
                 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentsGUI.php';
                 $link = $this->ctrl->getLinkTargetByClass(array('ilTestSkillAdministrationGUI', 'ilAssQuestionSkillAssignmentsGUI'), ilAssQuestionSkillAssignmentsGUI::CMD_SHOW_SKILL_QUEST_ASSIGNS);
                 $tabs_gui->addTarget('tst_tab_competences', $link, array(), array());
             }
             if (!in_array('participants', $hidden_tabs)) {
                 // participants
                 $tabs_gui->addTarget("participants", $this->ctrl->getLinkTarget($this, 'participants'), array("participants", "saveClientIP", "removeParticipant", "showParticipantAnswersForAuthor", "deleteAllUserResults", "cancelDeleteAllUserData", "deleteSingleUserResults", "outParticipantsResultsOverview", "outParticipantsPassDetails", "showPassOverview", "showUserAnswers", "participantsAction", "showDetailedResults", 'timing', 'timingOverview', 'npResetFilter', 'npSetFilter', 'showTimingForm'), "");
             }
         }
         include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
         if (ilLearningProgressAccess::checkAccess($this->object->getRefId()) && !in_array('learning_progress', $hidden_tabs)) {
             $tabs_gui->addTarget('learning_progress', $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'), ''), '', array('illplistofobjectsgui', 'illplistofsettingsgui', 'illearningprogressgui', 'illplistofprogressgui'));
         }
         if ($ilAccess->checkAccess("write", "", $this->ref_id) && !in_array('manscoring', $hidden_tabs)) {
             include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
             $scoring = ilObjAssessmentFolder::_getManualScoring();
             if (count($scoring)) {
                 // scoring tab
                 $tabs_gui->addTarget("manscoring", $this->ctrl->getLinkTargetByClass('ilTestScoringGUI', 'showManScoringParticipantsTable'), array('showManScoringParticipantsTable', 'applyManScoringParticipantsFilter', 'resetManScoringParticipantsFilter', 'showManScoringParticipantScreen', 'showManScoringByQuestionParticipantsTable', 'applyManScoringByQuestionFilter', 'resetManScoringByQuestionFilter', 'saveManScoringByQuestion'), '');
             }
         }
         // Scoring Adjustment
         $setting = new ilSetting('assessment');
         $scoring_adjust_active = (bool) $setting->get('assessment_adjustments_enabled', false);
         if ($ilAccess->checkAccess("write", "", $this->ref_id) && $scoring_adjust_active && !in_array('scoringadjust', $hidden_tabs)) {
             // scoring tab
             $tabs_gui->addTarget("scoringadjust", $this->ctrl->getLinkTargetByClass('ilScoringAdjustmentGUI', 'showquestionlist'), array('showquestionlist', 'savescoringfortest', 'adjustscoringfortest'), '');
         }
         if (($ilAccess->checkAccess("tst_statistics", "", $this->ref_id) || $ilAccess->checkAccess("write", "", $this->ref_id)) && !in_array('statistics', $hidden_tabs)) {
             // statistics tab
             $tabs_gui->addTarget("statistics", $this->ctrl->getLinkTargetByClass("iltestevaluationgui", "outEvaluation"), array("statistics", "outEvaluation", "exportEvaluation", "detailedEvaluation", "eval_a", "evalUserDetail", "passDetails", "outStatisticsResultsOverview", "statisticsPassDetails", "singleResults"), "");
         }
         if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
             if (!in_array('history', $hidden_tabs)) {
                 // history
                 $tabs_gui->addTarget("history", $this->ctrl->getLinkTarget($this, 'history'), "history", "");
             }
             if (!in_array('meta_data', $hidden_tabs)) {
                 // meta data
                 $tabs_gui->addTarget("meta_data", $this->ctrl->getLinkTargetByClass('ilmdeditorgui', 'listSection'), "", "ilmdeditorgui");
             }
             if (!in_array('export', $hidden_tabs)) {
                 // export tab
                 $tabs_gui->addTarget("export", $this->ctrl->getLinkTargetByClass('iltestexportgui', ''), '', array('iltestexportgui'));
             }
         }
         if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id) && !in_array('permissions', $hidden_tabs)) {
             $tabs_gui->addTarget("perm_settings", $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), "perm"), array("perm", "info", "owner"), 'ilpermissiongui');
         }
     }
     if ($this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken()) {
         $hideTabs = array('settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export');
         foreach ($hideTabs as $tabId) {
             $tabs_gui->removeTab($tabId);
         }
     }
 }
 /**
  * Returns the list of answers of a users test pass and offers a scoring option
  *
  * @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult)
  * @param integer $active_id Active ID of the active user
  * @param integer $pass Test pass
  * @param boolean $show_solutions TRUE, if the solution output should be shown in the answers, FALSE otherwise
  * @return string HTML code of the list of answers
  * @access public
  * 
  * @deprecated
  */
 function getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions = FALSE)
 {
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $maintemplate = new ilTemplate("tpl.il_as_tst_list_of_answers.html", TRUE, TRUE, "Modules/Test");
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     $scoring = ilObjAssessmentFolder::_getManualScoring();
     $counter = 1;
     // output of questions with solutions
     foreach ($result_array as $question_data) {
         $question = $question_data["qid"];
         if (is_numeric($question)) {
             $question_gui = $this->object->createQuestionGUI("", $question);
             if (in_array($question_gui->object->getQuestionTypeID(), $scoring)) {
                 $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", TRUE, TRUE, "Modules/TestQuestionPool");
                 $scoretemplate = new ilTemplate("tpl.il_as_tst_manual_scoring_points.html", TRUE, TRUE, "Modules/Test");
                 #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question");
                 $template->setVariable("COUNTER_QUESTION", $counter . ". ");
                 $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
                 $points = $question_gui->object->getMaximumPoints();
                 if ($points == 1) {
                     $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("point"));
                 } else {
                     $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("points"));
                 }
                 $show_question_only = $this->object->getShowSolutionAnswersOnly() ? TRUE : FALSE;
                 $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_solutions, FALSE, $show_question_only, $this->object->getShowSolutionFeedback(), FALSE, TRUE);
                 $solout = $question_gui->object->getSuggestedSolutionOutput();
                 if (strlen($solout)) {
                     $scoretemplate->setCurrentBlock("suggested_solution");
                     $scoretemplate->setVariable("TEXT_SUGGESTED_SOLUTION", $this->lng->txt("solution_hint"));
                     $scoretemplate->setVariable("VALUE_SUGGESTED_SOLUTION", $solout);
                     $scoretemplate->parseCurrentBlock();
                 }
                 $scoretemplate->setCurrentBlock("feedback");
                 $scoretemplate->setVariable("FEEDBACK_NAME_INPUT", $question);
                 $feedback = $this->object->getManualFeedback($active_id, $question, $pass);
                 $scoretemplate->setVariable("VALUE_FEEDBACK", ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback, TRUE)));
                 $scoretemplate->setVariable("TEXT_MANUAL_FEEDBACK", $this->lng->txt("set_manual_feedback"));
                 $scoretemplate->parseCurrentBlock();
                 $scoretemplate->setVariable("NAME_INPUT", $question);
                 $this->ctrl->setParameter($this, "active_id", $active_id);
                 $this->ctrl->setParameter($this, "pass", $pass);
                 $scoretemplate->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "manscoring"));
                 $scoretemplate->setVariable("LABEL_INPUT", $this->lng->txt("tst_change_points_for_question"));
                 $scoretemplate->setVariable("VALUE_INPUT", " value=\"" . assQuestion::_getReachedPoints($active_id, $question_data["qid"], $pass) . "\"");
                 $scoretemplate->setVariable("VALUE_SAVE", $this->lng->txt("save"));
                 $template->setVariable("SOLUTION_OUTPUT", $result_output);
                 $maintemplate->setCurrentBlock("printview_question");
                 $maintemplate->setVariable("QUESTION_PRINTVIEW", $template->get());
                 $maintemplate->setVariable("QUESTION_SCORING", $scoretemplate->get());
                 $maintemplate->parseCurrentBlock();
             }
             $counter++;
         }
     }
     if ($counter == 1) {
         // no scorable questions found
         $maintemplate->setVariable("NO_QUESTIONS_FOUND", $this->lng->txt("manscoring_questions_not_found"));
     }
     $maintemplate->setVariable("RESULTS_OVERVIEW", sprintf($this->lng->txt("manscoring_results_pass"), $pass + 1));
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initDomEvent();
     return $maintemplate->get();
 }
 /**
  *
  */
 private function showManScoringByQuestionParticipantsTable($manPointsPost = array())
 {
     /**
      * @var $tpl      ilTemplate
      * @var $ilAccess ilAccessHandler
      */
     global $tpl, $ilAccess;
     if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
         ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true);
         $this->ctrl->redirectByClass('ilobjtestgui', 'infoScreen');
     }
     include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     include_once 'Services/YUI/classes/class.ilYuiUtil.php';
     ilYuiUtil::initPanel();
     ilYuiUtil::initOverlay();
     $mathJaxSetting = new ilSetting('MathJax');
     if ($mathJaxSetting->get("enable")) {
         $tpl->addJavaScript($mathJaxSetting->get("path_to_mathjax"));
     }
     $tpl->addJavascript('./Services/UIComponent/Overlay/js/ilOverlay.js');
     $tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
     $tpl->addJavaScript("./Services/Form/js/Form.js");
     $tpl->addCss($this->object->getTestStyleLocation("output"), "screen");
     require_once 'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
     $table = new ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI($this);
     $table->setManualScoringPointsPostData($manPointsPost);
     $qst_id = $table->getFilterItemByPostVar('question')->getValue();
     $pass_id = $table->getFilterItemByPostVar('pass')->getValue();
     $table_data = array();
     $selected_questionData = null;
     if (is_numeric($qst_id)) {
         $scoring = ilObjAssessmentFolder::_getManualScoring();
         $info = assQuestion::_getQuestionInfo($qst_id);
         $selected_questionData = $info;
         $type = $info["question_type_fi"];
         if (in_array($type, $scoring)) {
             $selected_questionData = $info;
         }
     }
     if ($selected_questionData && is_numeric($pass_id)) {
         $data = $this->object->getCompleteEvaluationData(FALSE);
         foreach ($data->getParticipants() as $active_id => $participant) {
             $testResultData = $this->object->getTestResult($active_id, $pass_id - 1);
             foreach ($testResultData as $questionData) {
                 if (!isset($questionData['qid']) || $questionData['qid'] != $selected_questionData['question_id']) {
                     continue;
                 }
                 $table_data[] = array('pass_id' => $pass_id - 1, 'active_id' => $active_id, 'qst_id' => $questionData['qid'], 'reached_points' => assQuestion::_getReachedPoints($active_id, $questionData['qid'], $pass_id - 1), 'maximum_points' => assQuestion::_getMaximumPoints($questionData['qid']), 'participant' => $participant);
             }
         }
     } else {
         $table->disable('header');
     }
     if ($selected_questionData) {
         $maxpoints = assQuestion::_getMaximumPoints($selected_questionData['question_id']);
         if ($maxpoints == 1) {
             $maxpoints = ' (' . $maxpoints . ' ' . $this->lng->txt('point') . ')';
         } else {
             $maxpoints = ' (' . $maxpoints . ' ' . $this->lng->txt('points') . ')';
         }
         $table->setTitle($this->lng->txt('tst_man_scoring_by_qst') . ': ' . $selected_questionData['title'] . $maxpoints . ' [' . $this->lng->txt('question_id_short') . ': ' . $selected_questionData['question_id'] . ']');
     } else {
         $table->setTitle($this->lng->txt('tst_man_scoring_by_qst'));
     }
     $table->setData($table_data);
     $tpl->setContent($table->getHTML());
 }
Пример #6
0
 /**
  * Returns the list of answers of a users test pass and offers a scoring option
  *
  * @access public
  * @param integer $active_id Active ID of the active user
  * @param integer $pass Test pass
  * @return string HTML code of the list of answers
  */
 public function getManScoringQuestionGuiList($activeId, $pass)
 {
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     $manScoringQuestionTypes = ilObjAssessmentFolder::_getManualScoring();
     $testResultData = $this->object->getTestResult($activeId, $pass);
     $manScoringQuestionGuiList = array();
     foreach ($testResultData as $questionData) {
         if (!isset($questionData['qid'])) {
             continue;
         }
         if (!isset($questionData['type'])) {
             throw new ilTestException('no question type given!');
         }
         $questionGUI = $this->object->createQuestionGUI("", $questionData['qid']);
         if (!in_array($questionGUI->object->getQuestionTypeID(), $manScoringQuestionTypes)) {
             continue;
         }
         $manScoringQuestionGuiList[$questionData['qid']] = $questionGUI;
     }
     return $manScoringQuestionGuiList;
 }
 /**
  * adds tabs to tab gui object
  *
  * @param	object		$tabs_gui		ilTabsGUI object
  */
 function getTabs(&$tabs_gui)
 {
     global $ilAccess, $ilUser, $ilHelp;
     if (preg_match('/^ass(.*?)gui$/i', $this->ctrl->getNextClass($this))) {
         return;
     } else {
         if ($this->ctrl->getNextClass($this) == 'ilpageobjectgui') {
             return;
         }
     }
     $ilHelp->setScreenIdComponent("tst");
     $hidden_tabs = array();
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         $template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
         $hidden_tabs = $template->getHiddenTabs();
     }
     if ($this->ctrl->getNextClass($this) == 'iltestoutputgui') {
         return;
     }
     switch ($this->ctrl->getCmd()) {
         case "resume":
         case "previous":
         case "next":
         case "summary":
         case "directfeedback":
         case "finishTest":
         case "outCorrectSolution":
         case "passDetails":
         case "showAnswersOfUser":
         case "outUserResultsOverview":
         case "backFromSummary":
         case "show_answers":
         case "setsolved":
         case "resetsolved":
         case "confirmFinish":
         case "outTestSummary":
         case "outQuestionSummary":
         case "gotoQuestion":
         case "selectImagemapRegion":
         case "confirmSubmitAnswers":
         case "finalSubmission":
         case "postpone":
         case "redirectQuestion":
         case "outUserPassDetails":
         case "checkPassword":
         case "exportCertificate":
         case "finishListOfAnswers":
         case "backConfirmFinish":
         case "showFinalStatement":
             return;
             break;
         case "browseForQuestions":
         case "filter":
         case "resetFilter":
         case "resetTextFilter":
         case "insertQuestions":
             // #8497: resetfilter is also used in lp
             if ($this->ctrl->getNextClass($this) != "illearningprogressgui") {
                 return $this->getBrowseForQuestionsTab($tabs_gui);
             }
             break;
         case "scoring":
         case "properties":
         case "marks":
         case "saveMarks":
         case "cancelMarks":
         case "addMarkStep":
         case "deleteMarkSteps":
         case "addSimpleMarkSchema":
         case "certificate":
         case "certificateservice":
         case "certificateImport":
         case "certificateUpload":
         case "certificateEditor":
         case "certificateDelete":
         case "certificateSave":
         case "defaults":
         case "deleteDefaults":
         case "addDefaults":
         case "applyDefaults":
         case "inviteParticipants":
         case "searchParticipants":
         case "":
             if ($ilAccess->checkAccess("write", "", $this->ref_id) && (strcmp($this->ctrl->getCmdClass(), "ilobjtestgui") == 0 || strcmp($this->ctrl->getCmdClass(), "ilcertificategui") == 0 || strlen($this->ctrl->getCmdClass()) == 0)) {
                 $this->getSettingsSubTabs($hidden_tabs);
             }
             break;
         case "export":
         case "print":
             break;
         case "statistics":
         case "eval_a":
         case "detailedEvaluation":
         case "outEvaluation":
         case "singleResults":
         case "exportEvaluation":
         case "evalUserDetail":
         case "passDetails":
         case "outStatisticsResultsOverview":
         case "statisticsPassDetails":
             $this->getStatisticsSubTabs();
             break;
     }
     if (strcmp(strtolower(get_class($this->object)), "ilobjtest") == 0) {
         // questions tab
         if ($ilAccess->checkAccess("write", "", $this->ref_id) && !in_array('assQuestions', $hidden_tabs)) {
             $force_active = $_GET["up"] != "" || $_GET["down"] != "" ? true : false;
             if (!$force_active) {
                 if ($_GET["browse"] == 1) {
                     $force_active = true;
                 }
                 if (preg_match("/deleteqpl_\\d+/", $this->ctrl->getCmd())) {
                     $force_active = true;
                 }
             }
             if ($this->object->isRandomTest()) {
                 $target = $this->ctrl->getLinkTarget($this, 'questions');
             } else {
                 $target = $this->ctrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'showPage');
             }
             $tabs_gui->addTarget("assQuestions", $target, array("questions", "browseForQuestions", "questionBrowser", "createQuestion", "randomselect", "filter", "resetFilter", "insertQuestions", "back", "createRandomSelection", "cancelRandomSelect", "insertRandomSelection", "removeQuestions", "moveQuestions", "insertQuestionsBefore", "insertQuestionsAfter", "confirmRemoveQuestions", "cancelRemoveQuestions", "executeCreateQuestion", "cancelCreateQuestion", "addQuestionpool", "saveRandomQuestions", "saveQuestionSelectionMode", "print", "addsource", "removesource", "randomQuestions"), "", "", $force_active);
         }
         // info tab
         if ($ilAccess->checkAccess("visible", "", $this->ref_id) && !in_array('info_short', $hidden_tabs)) {
             $tabs_gui->addTarget("info_short", $this->ctrl->getLinkTarget($this, 'infoScreen'), array("infoScreen", "outIntroductionPage", "showSummary", "setAnonymousId", "outUserListOfAnswerPasses", "redirectToInfoScreen"));
         }
         // settings tab
         if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
             if (!in_array('settings', $hidden_tabs)) {
                 $tabs_gui->addTarget("settings", $this->ctrl->getLinkTarget($this, 'properties'), array("properties", "saveProperties", "cancelProperties", "marks", "addMarkStep", "deleteMarkSteps", "addSimpleMarkSchema", "saveMarks", "cancelMarks", "certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave", "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport", "scoring", "defaults", "addDefaults", "deleteDefaults", "applyDefaults", "inviteParticipants", "saveFixedParticipantsStatus", "searchParticipants", "addParticipants", ""), array("", "ilobjtestgui", "ilcertificategui"));
             }
             if (!in_array('participants', $hidden_tabs)) {
                 // participants
                 $tabs_gui->addTarget("participants", $this->ctrl->getLinkTarget($this, 'participants'), array("participants", "saveClientIP", "removeParticipant", "showParticipantAnswersForAuthor", "deleteAllUserResults", "cancelDeleteAllUserData", "deleteSingleUserResults", "outParticipantsResultsOverview", "outParticipantsPassDetails", "showPassOverview", "showUserAnswers", "participantsAction", "showDetailedResults"), "");
             }
         }
         include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
         if (ilLearningProgressAccess::checkAccess($this->object->getRefId()) && !in_array('learning_progress', $hidden_tabs)) {
             $tabs_gui->addTarget('learning_progress', $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'), ''), '', array('illplistofobjectsgui', 'illplistofsettingsgui', 'illearningprogressgui', 'illplistofprogressgui'));
         }
         if ($ilAccess->checkAccess("write", "", $this->ref_id) && !in_array('manscoring', $hidden_tabs)) {
             include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
             $scoring = ilObjAssessmentFolder::_getManualScoring();
             if (count($scoring)) {
                 // scoring tab
                 $tabs_gui->addTarget("manscoring", $this->ctrl->getLinkTargetByClass('ilTestScoringGUI', 'showManScoringParticipantsTable'), array('showManScoringParticipantsTable', 'applyManScoringParticipantsFilter', 'resetManScoringParticipantsFilter', 'showManScoringParticipantScreen'), '');
             }
         }
         if (($ilAccess->checkAccess("tst_statistics", "", $this->ref_id) || $ilAccess->checkAccess("write", "", $this->ref_id)) && !in_array('statistics', $hidden_tabs)) {
             // statistics tab
             $tabs_gui->addTarget("statistics", $this->ctrl->getLinkTargetByClass("iltestevaluationgui", "outEvaluation"), array("statistics", "outEvaluation", "exportEvaluation", "detailedEvaluation", "eval_a", "evalUserDetail", "passDetails", "outStatisticsResultsOverview", "statisticsPassDetails", "singleResults"), "");
         }
         if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
             if (!in_array('history', $hidden_tabs)) {
                 // history
                 $tabs_gui->addTarget("history", $this->ctrl->getLinkTarget($this, 'history'), "history", "");
             }
             if (!in_array('meta_data', $hidden_tabs)) {
                 // meta data
                 $tabs_gui->addTarget("meta_data", $this->ctrl->getLinkTargetByClass('ilmdeditorgui', 'listSection'), "", "ilmdeditorgui");
             }
             if (!in_array('export', $hidden_tabs)) {
                 // export tab
                 $tabs_gui->addTarget("export", $this->ctrl->getLinkTarget($this, 'export'), array("export", "createExportFile", "confirmDeleteExportFile", "downloadExportFile", "deleteExportFile", "cancelDeleteExportFile"), "");
             }
         }
         if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id) && !in_array('permissions', $hidden_tabs)) {
             $tabs_gui->addTarget("perm_settings", $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), "perm"), array("perm", "info", "owner"), 'ilpermissiongui');
         }
     }
 }