/**
  * 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_s.png"));
         $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
         $qids = ilSCORM2004Page::_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("comment_question.png"));
                 $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_s.png"));
             $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_s.png"));
     $ilCtrl->setParameterByClass("ilscorm2004scogui", "obj_id", $a_set["child"]);
     $this->tpl->setVariable("HREF_EDIT_SCO", $ilCtrl->getLinkTargetByClass("ilscorm2004scogui", "showProperties"));
 }
コード例 #2
0
 function exportXMLPageObjects($a_target_dir, &$a_xml_writer, $a_inst, &$expLog)
 {
     global $ilBench;
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php";
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
     $tree = new ilTree($this->slm_id);
     $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $tree->setTreeTablePK("slm_id");
     $pages = $tree->getSubTree($tree->getNodeData($this->getId()), true, 'page');
     foreach ($pages as $page) {
         $expLog->write(date("[y-m-d H:i:s] ") . "Page Object " . $page["obj_id"]);
         // export xml to writer object
         $page_obj = new ilSCORM2004Page($page["obj_id"]);
         $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
         //collect media objects
         $mob_ids = $page_obj->getMediaObjectIds();
         foreach ($mob_ids as $mob_id) {
             $this->mob_ids[$mob_id] = $mob_id;
         }
         // collect all file items
         $file_ids = $page_obj->getFileItemIds();
         foreach ($file_ids as $file_id) {
             $this->file_ids[$file_id] = $file_id;
         }
         $q_ids = ilSCORM2004Page::_getQuestionIdsForPage("sahs", $page["obj_id"]);
         if (count($q_ids) > 0) {
             include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
             foreach ($q_ids as $q_id) {
                 $q_obj =& assQuestion::_instanciateQuestion($q_id);
                 $qti_file = fopen($a_target_dir . "/qti_" . $q_id . ".xml", "w");
                 fwrite($qti_file, $q_obj->toXML());
                 fclose($qti_file);
             }
         }
         unset($page_obj);
     }
 }
コード例 #3
0
 function sahs_questions()
 {
     global $tpl, $lng, $ilCtrl;
     $this->setTabs();
     $this->setLocator();
     include_once "./Services/Table/classes/class.ilTableGUI.php";
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     include_once "./Services/COPage/classes/class.ilPCQuestionGUI.php";
     // load template for table
     $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
     $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.scormeditor_sco_question.html", "Modules/Scorm2004");
     $tbl = new ilTableGUI();
     $tbl->setTitle("Questions for " . $this->node_object->getTitle());
     $tbl->setHeaderNames(array("Question", "Page"));
     $cols = array("question", "page");
     $tbl->setHeaderVars($cols, $header_params);
     $tbl->setColumnWidth(array("50%", "50%"));
     $tbl->disable("sort");
     $tbl->disable("footer");
     $tree = new ilTree($this->slm_object->getId());
     $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $tree->setTreeTablePK("slm_id");
     foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
         // get question ids
         $qids = ilSCORM2004Page::_getQuestionIdsForPage("sahs", $page["obj_id"]);
         if (count($qids) > 0) {
             // output questions
             foreach ($qids as $qid) {
                 $tpl->setCurrentBlock("tbl_content");
                 $tpl->setVariable("TXT_PAGE_TITLE", $page["title"]);
                 $ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id", $page["obj_id"]);
                 $tpl->setVariable("HREF_EDIT_PAGE", $ilCtrl->getLinkTargetByClass("ilscorm2004pagenodegui", "edit"));
                 $qtitle = assQuestion::_getTitle($qid);
                 $tpl->setVariable("TXT_QUESTION", $qtitle);
                 $ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id", $page["obj_id"]);
                 //$tpl->setVariable("HREF_EDIT_QUESTION", $ilCtrl->getLinkTargetByClass("ilscorm2004pagenodegui", "edit"));
                 $tpl->setVariable("CSS_ROW", ilUtil::switchColor($i++, "tblrow1", "tblrow2"));
                 $tpl->parseCurrentBlock();
             }
         }
     }
     $tbl->render();
 }