本文整理汇总了PHP中assQuestion::_instantiateQuestion方法的典型用法代码示例。如果您正苦于以下问题:PHP assQuestion::_instantiateQuestion方法的具体用法?PHP assQuestion::_instantiateQuestion怎么用?PHP assQuestion::_instantiateQuestion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assQuestion
的用法示例。
在下文中一共展示了assQuestion::_instantiateQuestion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getQuestion
/**
* @return iQuestionCondition
*/
public function getQuestion()
{
if ($this->question === null && $this->questionId) {
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
$this->question = assQuestion::_instantiateQuestion($this->questionId);
}
return $this->question;
}
示例2: purgeQuestionIds
private function purgeQuestionIds($questionIds)
{
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
foreach ($questionIds as $questionId) {
$question = assQuestion::_instantiateQuestion($questionId);
$question->delete($questionId);
}
}
示例3: newQuestionCopies
/**
* Replaces existing question content elements with
* new copies
*/
function newQuestionCopies(&$temp_dom)
{
// Get question IDs
$path = "//Question";
$xpc = xpath_new_context($temp_dom);
$res =& xpath_eval($xpc, $path);
$q_ids = array();
include_once "./Services/Link/classes/class.ilInternalLink.php";
for ($i = 0; $i < count($res->nodeset); $i++) {
$qref = $res->nodeset[$i]->get_attribute("QRef");
$inst_id = ilInternalLink::_extractInstOfTarget($qref);
$q_id = ilInternalLink::_extractObjIdOfTarget($qref);
if (!($inst_id > 0)) {
if ($q_id > 0) {
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$question = assQuestion::_instantiateQuestion($q_id);
// check due to #16557
if (is_object($question)) {
// check if page for question exists
// due to a bug in early 4.2.x version this is possible
if (!ilPageObject::_exists("qpl", $q_id)) {
$question->createPageObject();
}
// now copy this question and change reference to
// new question id
$duplicate_id = $question->duplicate(false);
$res->nodeset[$i]->set_attribute("QRef", "il__qst_" . $duplicate_id);
}
}
}
}
}
示例4: syncOriginalCmd
private function syncOriginalCmd()
{
$questionId = (int) $_POST['question_id'];
if ($this->isTestQuestion($questionId) && $this->isSyncOriginalPossibleAndAllowed($questionId)) {
$question = assQuestion::_instantiateQuestion($questionId);
$question->syncSkillAssignments($question->getObjId(), $question->getId(), $question->lookupParentObjId($question->getOriginalId()), $question->getOriginalId());
ilUtil::sendSuccess($this->lng->txt('qpl_qst_skl_assign_synced_to_orig'), true);
}
$this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
}
示例5: exportXMLPageObjects
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;
}
include_once "./Services/COPage/classes/class.ilPCQuestion.php";
$q_ids = ilPCQuestion::_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::_instantiateQuestion($q_id);
// see #16557
if (is_object($q_obj)) {
$qti_file = fopen($a_target_dir . "/qti_" . $q_id . ".xml", "w");
fwrite($qti_file, $q_obj->toXML());
fclose($qti_file);
}
}
}
unset($page_obj);
}
}