/**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("assessment");
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php";
     $node_object = ilSCORM2004NodeFactory::getInstance($this->slm_object, $a_set["child"], false);
     $tr_data = $node_object->getObjectives();
     // learning objectives
     foreach ($tr_data as $data) {
         $this->tpl->setCurrentBlock("objective");
         $this->tpl->setVariable("TXT_LEARNING_OBJECTIVE", ilSCORM2004Sco::convertLists($data->getObjectiveID()));
         $this->tpl->setVariable("IMG_LOBJ", ilUtil::getImagePath("icon_lobj.svg"));
         $this->tpl->parseCurrentBlock();
     }
     // pages
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $childs = $this->tree->getChilds($a_set["child"]);
     foreach ($childs as $child) {
         // get question ids
         include_once "./Services/COPage/classes/class.ilPCQuestion.php";
         $qids = ilPCQuestion::_getQuestionIdsForPage("sahs", $child["child"]);
         if (count($qids) > 0) {
             // output questions
             foreach ($qids as $qid) {
                 $this->tpl->setCurrentBlock("question");
                 //$qtitle = assQuestion::_getTitle($qid);
                 $qtype = assQuestion::_getQuestionType($qid);
                 //$qtext = assQuestion::_getQuestionText($qid);
                 $qtext = assQuestion::_getQuestionTitle($qid);
                 $this->tpl->setVariable("TXT_QUESTION", $qtext);
                 $this->tpl->setVariable("TXT_QTYPE", $lng->txt($qtype));
                 $this->tpl->setVariable("IMG_QST", ilUtil::getImagePath("icon_tst.svg"));
                 $this->tpl->parseCurrentBlock();
             }
             // output page title
             $page_title = ilSCORM2004Node::_lookupTitle($child["child"]);
             $this->tpl->setCurrentBlock("page");
             $this->tpl->setVariable("TXT_PAGE_TITLE", $page_title);
             $this->tpl->setVariable("IMG_PAGE", ilUtil::getImagePath("icon_pg.svg"));
             $ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id", $child["child"]);
             $this->tpl->setVariable("HREF_EDIT_PAGE", $ilCtrl->getLinkTargetByClass("ilscorm2004pagenodegui", "edit"));
             $this->tpl->parseCurrentBlock();
         }
     }
     // sco title
     $this->tpl->setVariable("TXT_SCO_TITLE", $a_set["title"]);
     $this->tpl->setVariable("IMG_SCO", ilUtil::getImagePath("icon_sco.svg"));
     $ilCtrl->setParameterByClass("ilscorm2004scogui", "obj_id", $a_set["child"]);
     $this->tpl->setVariable("HREF_EDIT_SCO", $ilCtrl->getLinkTargetByClass("ilscorm2004scogui", "showProperties"));
 }
 /**
  * Set tabs
  */
 function setTabs()
 {
     if ($this->getSelfAssessmentMode()) {
         return;
     }
     global $ilTabs, $ilCtrl, $lng;
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     if ($this->content_obj != "") {
         $q_ref = $this->content_obj->getQuestionReference();
     }
     if ($q_ref != "") {
         $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
         if (!($inst_id > 0)) {
             $q_id = ilInternalLink::_extractObjIdOfTarget($q_ref);
         }
     }
     $ilTabs->addTarget("question", $ilCtrl->getLinkTarget($this, "edit"), array("editQuestion", "save", "cancel", "addSuggestedSolution", "cancelExplorer", "linkChilds", "removeSuggestedSolution", "addPair", "addTerm", "delete", "deleteTerms", "editMode", "upload", "saveEdit", "uploadingImage", "uploadingImagemap", "addArea", "deletearea", "saveShape", "back", "saveEdit", "changeGapType", "createGaps", "addItem", "addYesNo", "addTrueFalse", "toggleGraphicalAnswers", "setMediaMode"), "");
     if ($q_id > 0) {
         if (assQuestion::_getQuestionType($q_id) != "assTextQuestion") {
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
             $tabCommands = assQuestionGUI::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
             $tabLink = ilUtil::appendUrlParameterString($ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW), "q_id=" . (int) $q_id);
             $ilTabs->addTarget('feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
         }
     }
 }
Exemple #3
0
 /**
  * checks wether the obligation for question with given id is possible or not
  * 
  * @param integer $questionId
  * @return boolean $obligationPossible
  */
 public static function isQuestionObligationPossible($questionId)
 {
     require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
     $classConcreteQuestion = assQuestion::_getQuestionType($questionId);
     assQuestion::_includeClass($classConcreteQuestion, 0);
     // static binder is not at work yet (in PHP < 5.3)
     //$obligationPossible = $classConcreteQuestion::isObligationPossible();
     $obligationPossible = call_user_func(array($classConcreteQuestion, 'isObligationPossible'), $questionId);
     return $obligationPossible;
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $ilTabs, $lng, $ilAccess, $tpl;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     //$this->ctrl->addTab("clipboard", $this->ctrl->getLinkTargetByClass("ilEditClipboardGUI", "view")
     //	, "view", "ilEditClipboardGUI");
     $this->getTabs();
     $ilCtrl->setReturn($this, "edit");
     //echo "-".$next_class."-";
     switch ($next_class) {
         case 'ilmdeditorgui':
             //$this->setTabs();
             $ilTabs->setTabActive("meta_data");
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->meta_data_rep_obj_id, $this->meta_data_sub_obj_id, $this->meta_data_type);
             if (is_object($this->meta_data_observer_obj)) {
                 $md_gui->addObserver($this->meta_data_observer_obj, $this->meta_data_observer_func, "General");
             }
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ileditclipboardgui":
             //$this->tabs_gui->clearTargets();
             //$this->ctrl->setReturn($this, "view");
             $clip_gui = new ilEditClipboardGUI();
             $clip_gui->setPageBackTitle($this->page_back_title);
             //$ret =& $clip_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($clip_gui);
             break;
             // notes
         // notes
         case "ilnotegui":
             switch ($_GET["notes_mode"]) {
                 default:
                     $html = $this->edit();
                     $ilTabs->setTabActive("edit");
                     return $html;
             }
             break;
         case 'ilpublicuserprofilegui':
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             break;
         case "ilpageeditorgui":
             if (!$this->getEnableEditing()) {
                 ilUtil::sendFailure($lng->txt("permission_denied"), true);
                 $ilCtrl->redirect($this, "preview");
             }
             $page_editor = new ilPageEditorGUI($this->getPageObject(), $this);
             $page_editor->setLocator($this->locator);
             $page_editor->setHeader($this->getHeader());
             $page_editor->setPageBackTitle($this->page_back_title);
             $page_editor->setIntLinkReturn($this->int_link_return);
             //$page_editor->executeCommand();
             $ret =& $this->ctrl->forwardCommand($page_editor);
             break;
         case 'ilnewsitemgui':
             include_once "./Services/News/classes/class.ilNewsItemGUI.php";
             $news_item_gui = new ilNewsItemGUI();
             $news_item_gui->setEnableEdit(true);
             $news_item_gui->setContextObjId($this->news_obj_id);
             $news_item_gui->setContextObjType($this->news_obj_type);
             $news_item_gui->setContextSubObjId($this->obj->getId());
             $news_item_gui->setContextSubObjType("pg");
             $ret = $ilCtrl->forwardCommand($news_item_gui);
             break;
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             break;
         case "ilpropertyformgui":
             include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
             $form = $this->initOpenedContentForm();
             $this->ctrl->forwardCommand($form);
             break;
         case "ilinternallinkgui":
             $this->lng->loadLanguageModule("content");
             require_once "./Services/Link/classes/class.ilInternalLinkGUI.php";
             $link_gui = new ilInternalLinkGUI("Media_Media", 0);
             //$link_gui->filterLinkType("RepositoryItem");
             $link_gui->filterLinkType("PageObject_FAQ");
             $link_gui->filterLinkType("GlossaryItem");
             $link_gui->filterLinkType("Media_Media");
             $link_gui->filterLinkType("Media_FAQ");
             $link_gui->setFilterWhiteList(true);
             $link_gui->setMode("asynch");
             $ilCtrl->forwardCommand($link_gui);
             break;
         case "ilquestioneditgui":
             $this->setQEditTabs("question");
             include_once "./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php";
             $edit_gui = new ilQuestionEditGUI();
             $edit_gui->setPageConfig($this->getPageConfig());
             //			    $edit_gui->addNewIdListener($this, "setNewQuestionId");
             $edit_gui->setSelfAssessmentEditingMode(true);
             $ret = $ilCtrl->forwardCommand($edit_gui);
             $this->tpl->setContent($ret);
             break;
         case 'ilassquestionfeedbackeditinggui':
             $this->onFeedbackEditingForwarding();
             // set tabs
             $this->setQEditTabs("feedback");
             // load required lang mods
             $lng->loadLanguageModule("assessment");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI(assQuestion::_getQuestionType((int) $_GET['q_id']), (int) $_GET['q_id']);
             $questionGUI->object->setObjId(0);
             $questionGUI->object->setSelfAssessmentEditingMode(true);
             $questionGUI->object->setPreventRteUsage($this->getPageConfig()->getPreventRteUsage());
             // forward to ilAssQuestionFeedbackGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
             $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
             $ilCtrl->forwardCommand($gui);
             break;
             /*			case "ilpagemultilanggui":
             				$ilCtrl->setReturn($this, "edit");
             				include_once("./Services/COPage/classes/class.ilPageMultiLangGUI.php");
             				$ml_gui = new ilPageMultiLangGUI($this->getPageObject()->getParentType(), $this->getPageObject()->getParentId(),
             					$this->getPageConfig()->getSinglePageMode());
             				//$this->setTabs("settings");
             				//$this->setSubTabs("cont_multilinguality");
             				$ret = $this->ctrl->forwardCommand($ml_gui);
             				break;*/
         /*			case "ilpagemultilanggui":
         				$ilCtrl->setReturn($this, "edit");
         				include_once("./Services/COPage/classes/class.ilPageMultiLangGUI.php");
         				$ml_gui = new ilPageMultiLangGUI($this->getPageObject()->getParentType(), $this->getPageObject()->getParentId(),
         					$this->getPageConfig()->getSinglePageMode());
         				//$this->setTabs("settings");
         				//$this->setSubTabs("cont_multilinguality");
         				$ret = $this->ctrl->forwardCommand($ml_gui);
         				break;*/
         default:
             $cmd = $this->ctrl->getCmd("preview");
             $ret = $this->{$cmd}();
             break;
     }
     //echo "+$ret+";
     return $ret;
 }
Exemple #5
0
 /**
  * Creates an instance of a question gui with a given question id
  *
  * @param 	integer	$a_question_id
  *
  * @return 	\assQuestionGUI	The question gui instance
  */
 public static function instantiateQuestionGUI($a_question_id)
 {
     global $ilCtrl, $ilDB, $lng, $ilUser;
     if (strcmp($a_question_id, "") != 0) {
         $question_type = assQuestion::_getQuestionType($a_question_id);
         assQuestion::_includeClass($question_type, 1);
         $question_type_gui = self::getGuiClassNameByQuestionType($question_type);
         $question_gui = new $question_type_gui();
         $question_gui->object->loadFromDb($a_question_id);
         $feedbackObjectClassname = self::getFeedbackClassNameByQuestionType($question_type);
         $question_gui->object->feedbackOBJ = new $feedbackObjectClassname($question_gui->object, $ilCtrl, $ilDB, $lng);
         $assSettings = new ilSetting('assessment');
         require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
         $processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
         $processLockerFactory->setQuestionId($question_gui->object->getId());
         $processLockerFactory->setUserId($ilUser->getId());
         include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
         $processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
         $question_gui->object->setProcessLocker($processLockerFactory->getLocker());
     } else {
         global $ilLog;
         $ilLog->write('Instantiate question called without question id. (instantiateQuestionGUI@assQuestion)', $ilLog->WARNING);
         return null;
     }
     return $question_gui;
 }
 /**
  * Set tabs
  */
 function setTabs()
 {
     global $ilTabs, $ilCtrl, $lng;
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     if ($this->content_obj != "") {
         $q_ref = $this->content_obj->getQuestionReference();
     }
     if ($q_ref != "") {
         $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
         if (!($inst_id > 0)) {
             $q_id = ilInternalLink::_extractObjIdOfTarget($q_ref);
         }
     }
     $ilTabs->addTarget("question", $ilCtrl->getLinkTarget($this, "edit"), array("editQuestion", "save", "cancel", "addSuggestedSolution", "cancelExplorer", "linkChilds", "removeSuggestedSolution", "addPair", "addTerm", "delete", "deleteTerms", "editMode", "upload", "saveEdit", "uploadingImage", "uploadingImagemap", "addArea", "deletearea", "saveShape", "back", "saveEdit", "changeGapType", "createGaps", "addItem", "addYesNo", "addTrueFalse", "toggleGraphicalAnswers", "setMediaMode"), "");
     if ($q_id > 0) {
         if (assQuestion::_getQuestionType($q_id) != "assTextQuestion") {
             $ilTabs->addTarget("feedback", $ilCtrl->getLinkTarget($this, "feedback"), array("feedback", "saveFeedback"), "");
         }
     }
 }
 /**
  * Creates an instance of a question gui with a given question id
  *
  * @param 	integer	$a_question_id
  *
  * @return 	\assQuestionGUI	The question gui instance
  */
 public static function instantiateQuestionGUI($a_question_id)
 {
     global $ilCtrl, $ilDB, $lng;
     if (strcmp($a_question_id, "") != 0) {
         $question_type = assQuestion::_getQuestionType($a_question_id);
         $question_type_gui = $question_type . "GUI";
         assQuestion::_includeClass($question_type, 1);
         $question_gui = new $question_type_gui();
         $question_gui->object->loadFromDb($a_question_id);
         $feedbackObjectClassname = str_replace('ass', 'ilAss', $question_type) . 'Feedback';
         require_once "Modules/TestQuestionPool/classes/feedback/class.{$feedbackObjectClassname}.php";
         $question_gui->object->feedbackOBJ = new $feedbackObjectClassname($question_gui->object, $ilCtrl, $ilDB, $lng);
     } else {
         global $ilLog;
         $ilLog->write('Instantiate question called without question id. (instantiateQuestionGUI@assQuestion)', $ilLog->WARNING);
         return null;
     }
     return $question_gui;
 }
 /**
 * Creates an instance of a question gui with a given question id
 *
 * @param integer $question_id The question id
 * @return object The question gui instance
 * @access public
 */
 function &_instanciateQuestionGUI($question_id)
 {
     if (strcmp($question_id, "") != 0) {
         $question_type = assQuestion::_getQuestionType($question_id);
         $question_type_gui = $question_type . "GUI";
         assQuestion::_includeClass($question_type, 1);
         $question_gui = new $question_type_gui();
         $question_gui->object->loadFromDb($question_id);
         return $question_gui;
     }
 }