Inheritance diagram for ilObjQuestionPool:
Collaboration diagram for ilObjQuestionPool:Public Member Functions | |
| ilObjQuestionPool ($a_id=0, $a_call_by_reference=true) | |
| Constructor public. | |
| create ($a_upload=false) | |
| create questionpool object | |
| createReference () | |
| Creates a database reference id for the object. | |
| update () | |
| update object data | |
| updateMetaData () | |
| update meta data entry | |
| read ($a_force_db=false) | |
| read object data from db into object | |
| ilClone ($a_parent_ref) | |
| copy all entries of your object. | |
| delete () | |
| delete object and all related data | |
| deleteQuestionpool () | |
| initDefaultRoles () | |
| init default roles settings | |
| notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0) | |
| notifys an object about an event occured Based on the event happend, each object may decide how it reacts. | |
| deleteQuestion ($question_id) | |
| Deletes a question from the question pool. | |
| loadFromDb () | |
| Loads a ilObjQuestionpool object from a database. | |
| saveToDb () | |
| Saves a ilObjQuestionpool object to a database. | |
| getQuestiontype ($question_id) | |
| Returns the question type of a question with a given id. | |
| getDescription () | |
| get description of content object | |
| setDescription ($a_description) | |
| set description of content object | |
| getTitle () | |
| get title of glossary object | |
| setTitle ($a_title) | |
| set title of glossary object | |
| isInUse ($question_id) | |
| Checks whether the question is in use or not. | |
| & | createQuestion ($question_type, $question_id=-1) |
| duplicateQuestion ($question_id) | |
| Duplicates a question for a questionpool. | |
| copyQuestion ($question_id, $questionpool_to) | |
| Copies a question into another question pool. | |
| getQuestionsTable ($sortoptions, $filter_text, $sel_filter_type, $startrow=0) | |
| Calculates the data for the output of the questionpool. | |
| exportPagesXML (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions) | |
| export pages of test to xml (see ilias_co.dtd) | |
| exportXMLMetaData (&$a_xml_writer) | |
| export content objects meta data to xml (see ilias_co.dtd) | |
| modifyExportIdentifier ($a_tag, $a_param, $a_value) | |
| exportXMLPageObjects (&$a_xml_writer, $a_inst, &$expLog, $questions) | |
| export page objects to xml (see ilias_co.dtd) | |
| exportXMLMediaObjects (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog) | |
| export media objects to xml (see ilias_co.dtd) | |
| exportFileItems ($a_target_dir, &$expLog) | |
| export files of file itmes | |
| createExportDirectory () | |
| creates data directory for export files (data_dir/qpl_data/qpl_<id>/export, depending on data directory that is set in ILIAS setup/ini) | |
| getExportDirectory () | |
| get export directory of questionpool | |
| getExportFiles ($dir) | |
| get export files | |
| _createImportDirectory () | |
| creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directory that is set in ILIAS setup/ini) | |
| _getImportDirectory () | |
| get import directory of lm | |
| getImportDirectory () | |
| get import directory of lm | |
| & | getAllQuestions () |
| Retrieve an array containing all question ids of the questionpool. | |
| & | getAllQuestionIds () |
| getImportMapping () | |
| get array of (two) new created questions for import id | |
| to_xml ($questions) | |
| Returns a QTI xml representation of a list of questions. | |
| _getQuestionCount ($questionpool_id, $complete_questions_only=FALSE) | |
| Returns the number of questions in a question pool. | |
| setOnline ($a_online_status) | |
| Sets the questionpool online status. | |
| getOnline () | |
| _lookupOnline ($a_obj_id) | |
| Returns the online status of a question pool. | |
| _hasEqualPoints ($a_obj_id) | |
| Checks a question pool for questions with the same maximum points. | |
| pasteFromClipboard () | |
| Copies a question to the clipboard. | |
| copyToClipboard ($question_id) | |
| Copies a question to the clipboard. | |
| moveToClipboard ($question_id) | |
| Moves a question to the clipboard. | |
| _isWriteable ($object_id, $user_id) | |
| Returns true, if the question pool is writeable by a given user. | |
| & | getQuestionDetails ($question_ids) |
| Returns an array containing the qpl_question and qpl_question_type fields for an array of question ids. | |
| & | getDeleteableQuestionDetails ($question_ids) |
| Returns an array containing the qpl_question and qpl_question_type fields of deleteable questions for an array of question ids. | |
| & | getUsedQuestionDetails ($question_ids) |
| Returns an array containing the qpl_question and qpl_question_type fields of questions which are used in a random test for an array of question ids. | |
| & | _getAvailableQuestionpools ($use_object_id=false) |
| Returns the available question pools for the active user. | |
| & | getQplQuestions () |
| _clone ($obj_id) | |
| Creates a 1:1 copy of the object and places the copy in a given repository. | |
Data Fields | |
| $online | |
Definition at line 37 of file class.ilObjQuestionPool.php.
| ilObjQuestionPool::_clone | ( | $ | obj_id | ) |
Creates a 1:1 copy of the object and places the copy in a given repository.
Creates a 1:1 copy of the object and places the copy in a given repository
public
Definition at line 1505 of file class.ilObjQuestionPool.php.
References $_GET, $obj_id, ilObjQuestionPool(), and ilFormat::unixtimestamp2datetime().
Referenced by ilObjQuestionPoolGUI::cloneAllObject().
{
$original = new ilObjQuestionPool($obj_id, false);
$original->loadFromDb();
$newObj = new ilObjQuestionPool();
$newObj->setType("qpl");
$newObj->setTitle($original->getTitle() . " (".ilFormat::formatDate(ilFormat::unixtimestamp2datetime()).")");
$newObj->setDescription($original->getDescription());
$newObj->create(true);
$newObj->createReference();
$newObj->putInTree($_GET["ref_id"]);
$newObj->setPermissions($_GET["ref_id"]);
$newObj->setOnline($original->getOnline());
$newObj->saveToDb();
// clone the questions in the question pool
$questions =& $original->getQplQuestions();
foreach ($questions as $question_id)
{
$newObj->copyQuestion($question_id, $newObj->getId());
}
// clone meta data
include_once "./Services/MetaData/classes/class.ilMD.php";
$md = new ilMD($original->getId(),0,$original->getType());
$new_md =& $md->cloneMD($newObj->getId(),0,$newObj->getType());
// update the metadata with the new title of the question pool
$newObj->updateMetaData();
return $newObj->getRefId();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::_createImportDirectory | ( | ) |
creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directory that is set in ILIAS setup/ini)
Definition at line 971 of file class.ilObjQuestionPool.php.
References ilObject::$ilias, ilUtil::getDataDir(), and ilUtil::makeDir().
Referenced by ilObjQuestionPoolGUI::uploadQplObject().
{
global $ilias;
include_once "./classes/class.ilUtil.php";
$qpl_data_dir = ilUtil::getDataDir()."/qpl_data";
ilUtil::makeDir($qpl_data_dir);
if(!is_writable($qpl_data_dir))
{
$ilias->raiseError("Questionpool Data Directory (".$qpl_data_dir
.") not writeable.",$ilias->error_obj->FATAL);
}
// create questionpool directory (data_dir/qpl_data/qpl_import)
$qpl_dir = $qpl_data_dir."/qpl_import";
ilUtil::makeDir($qpl_dir);
if(!@is_dir($qpl_dir))
{
$ilias->raiseError("Creation of Questionpool Directory failed.",$ilias->error_obj->FATAL);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| & ilObjQuestionPool::_getAvailableQuestionpools | ( | $ | use_object_id = false |
) |
Returns the available question pools for the active user.
Returns the available question pools for the active user
Definition at line 1457 of file class.ilObjQuestionPool.php.
References $query, $rbacsystem, $result, $row, and ilObject::_hasUntrashedReference().
Referenced by ilObjQuestionPoolGUI::createObject().
{
global $rbacsystem;
global $ilDB;
$result_array = array();
$query = "SELECT object_data.*, object_data.obj_id, object_reference.ref_id FROM object_data, object_reference WHERE object_data.obj_id = object_reference.obj_id AND object_data.type = 'qpl' ORDER BY object_data.title";
$result = $ilDB->query($query);
include_once "./classes/class.ilObject.php";
while ($row = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
if ($rbacsystem->checkAccess("write", $row->ref_id) && (ilObject::_hasUntrashedReference($row->obj_id)))
{
if ($use_object_id)
{
$result_array[$row->obj_id] = $row->title;
}
else
{
$result_array[$row->ref_id] = $row->title;
}
}
}
return $result_array;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::_getImportDirectory | ( | ) |
get import directory of lm
Definition at line 997 of file class.ilObjQuestionPool.php.
References ilUtil::getDataDir().
Referenced by ilObjQuestionPoolGUI::importVerifiedFileObject(), and ilObjQuestionPoolGUI::uploadQplObject().
{
include_once "./classes/class.ilUtil.php";
$import_dir = ilUtil::getDataDir()."/qpl_data/qpl_import";
if(@is_dir($import_dir))
{
return $import_dir;
}
else
{
return false;
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::_getQuestionCount | ( | $ | questionpool_id, | |
| $ | complete_questions_only = FALSE | |||
| ) |
Returns the number of questions in a question pool.
Returns the number of questions in a question pool
| integer | $questonpool_id Object id of the questionpool to examine | |
| boolean | $complete_questions_only If set to TRUE, returns only the number of complete questions in the questionpool. Default is FALSE |
Definition at line 1125 of file class.ilObjQuestionPool.php.
References $query, $result, and $row.
Referenced by ilObjTestGUI::randomQuestionsObject().
{
global $ilDB;
$query = sprintf("SELECT COUNT(question_id) AS question_count FROM qpl_questions WHERE obj_fi = %s AND ISNULL(original_id)",
$ilDB->quote($questionpool_id . "")
);
if ($complete_questions_only)
{
$query .= " AND complete = '1'";
}
$result = $ilDB->query($query);
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
return $row["question_count"];
}
Here is the caller graph for this function:| ilObjQuestionPool::_hasEqualPoints | ( | $ | a_obj_id | ) |
Checks a question pool for questions with the same maximum points.
Checks a question pool for questions with the same maximum points
| integer | $a_obj_id Object id of the question pool private |
Definition at line 1201 of file class.ilObjQuestionPool.php.
References $query, $result, and $row.
Referenced by ilObjTest::getAvailableQuestionpools().
{
global $ilDB;
$query = sprintf("SELECT count(DISTINCT points) AS equal_points FROM qpl_questions WHERE obj_fi = %s",
$ilDB->quote($a_obj_id . "")
);
$result = $ilDB->query($query);
if ($result->numRows() == 1)
{
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
if ($row["equal_points"] == 1)
{
return 1;
}
else
{
return 0;
}
}
return 0;
}
Here is the caller graph for this function:| ilObjQuestionPool::_isWriteable | ( | $ | object_id, | |
| $ | user_id | |||
| ) |
Returns true, if the question pool is writeable by a given user.
Returns true, if the question pool is writeable by a given user
| integer | $object_id The object id of the question pool | |
| integer | $user_id The database id of the user public |
Definition at line 1332 of file class.ilObjQuestionPool.php.
References $query, $rbacsystem, $result, $row, and ilObject::_hasUntrashedReference().
{
global $rbacsystem;
global $ilDB;
$result_array = array();
$query = sprintf("SELECT object_data.*, object_data.obj_id, object_reference.ref_id FROM object_data, object_reference WHERE object_data.obj_id = object_reference.obj_id AND object_data.obj_id = %s",
$ilDB->quote($object_id . "")
);
$result = $ilDB->query($query);
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
include_once "./classes/class.ilObject.php";
if ($rbacsystem->checkAccess("write", $row["ref_id"]) && (ilObject::_hasUntrashedReference($row["obj_id"])))
{
return true;
}
}
return false;
}
Here is the call graph for this function:| ilObjQuestionPool::_lookupOnline | ( | $ | a_obj_id | ) |
Returns the online status of a question pool.
Returns the online status of a question pool
| integer | $a_obj_id Object id of the question pool public |
Definition at line 1177 of file class.ilObjQuestionPool.php.
References $query, $result, and $row.
Referenced by ilObjTest::get_qpl_titles(), ilObjTest::getAvailableQuestionpoolIDs(), ilObjTest::getAvailableQuestionpools(), and ilObjQuestionPoolListGUI::getProperties().
{
global $ilDB;
$query = sprintf("SELECT online FROM qpl_questionpool WHERE obj_fi = %s",
$ilDB->quote($a_obj_id . "")
);
$result = $ilDB->query($query);
if ($result->numRows() == 1)
{
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
return $row["online"];
}
return 0;
}
Here is the caller graph for this function:| ilObjQuestionPool::copyQuestion | ( | $ | question_id, | |
| $ | questionpool_to | |||
| ) |
Copies a question into another question pool.
Copies a question into another question pool
| integer | $question_id Database id of the question | |
| integer | $questionpool_to Database id of the target questionpool public |
Definition at line 576 of file class.ilObjQuestionPool.php.
References $counter, createQuestion(), duplicateQuestion(), and ilObject::getId().
Referenced by pasteFromClipboard().
{
$question_gui =& $this->createQuestion("", $question_id);
if ($question_gui->object->getObjId() == $questionpool_to)
{
// the question is copied into the same question pool
$this->duplicateQuestion($question_id);
}
else
{
// the question is copied into another question pool
$newtitle = $question_gui->object->getTitle();
if ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle()))
{
$counter = 2;
while ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle() . " ($counter)"))
{
$counter++;
}
$newtitle = $question_gui->object->getTitle() . " ($counter)";
}
$question_gui->object->copyObject($this->getId(), $newtitle);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::copyToClipboard | ( | $ | question_id | ) |
Copies a question to the clipboard.
Copies a question to the clipboard
| integer | $question_id Object id of the question private |
Definition at line 1297 of file class.ilObjQuestionPool.php.
References $_SESSION.
| ilObjQuestionPool::create | ( | $ | a_upload = false |
) |
create questionpool object
Definition at line 62 of file class.ilObjQuestionPool.php.
References ilObject::create(), and ilObject::createMetaData().
{
parent::create();
// meta data will be created by
// import parser
if (!$a_upload)
{
$this->createMetaData();
}
}
Here is the call graph for this function:| ilObjQuestionPool::createExportDirectory | ( | ) |
creates data directory for export files (data_dir/qpl_data/qpl_<id>/export, depending on data directory that is set in ILIAS setup/ini)
Definition at line 891 of file class.ilObjQuestionPool.php.
References ilUtil::getDataDir(), ilObject::getId(), and ilUtil::makeDir().
{
include_once "./classes/class.ilUtil.php";
$qpl_data_dir = ilUtil::getDataDir()."/qpl_data";
ilUtil::makeDir($qpl_data_dir);
if(!is_writable($qpl_data_dir))
{
$this->ilias->raiseError("Questionpool Data Directory (".$qpl_data_dir
.") not writeable.",$this->ilias->error_obj->FATAL);
}
// create learning module directory (data_dir/lm_data/lm_<id>)
$qpl_dir = $qpl_data_dir."/qpl_".$this->getId();
ilUtil::makeDir($qpl_dir);
if(!@is_dir($qpl_dir))
{
$this->ilias->raiseError("Creation of Questionpool Directory failed.",$this->ilias->error_obj->FATAL);
}
// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
$export_dir = $qpl_dir."/export";
ilUtil::makeDir($export_dir);
if(!@is_dir($export_dir))
{
$this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
}
}
Here is the call graph for this function:| & ilObjQuestionPool::createQuestion | ( | $ | question_type, | |
| $ | question_id = -1 | |||
| ) |
Definition at line 483 of file class.ilObjQuestionPool.php.
References getQuestiontype().
Referenced by copyQuestion(), duplicateQuestion(), and to_xml().
{
if ((!$question_type) and ($question_id > 0))
{
$question_type = $this->getQuestiontype($question_id);
}
switch ($question_type)
{
case "qt_multiple_choice_sr":
include_once "./assessment/classes/class.assMultipleChoiceGUI.php";
$question =& new ASS_MultipleChoiceGUI();
$question->object->set_response(RESPONSE_SINGLE);
break;
case "qt_multiple_choice_mr":
include_once "./assessment/classes/class.assMultipleChoiceGUI.php";
$question =& new ASS_MultipleChoiceGUI();
$question->object->set_response(RESPONSE_MULTIPLE);
break;
case "qt_cloze":
include_once "./assessment/classes/class.assClozeTestGUI.php";
$question =& new ASS_ClozeTestGUI();
break;
case "qt_matching":
include_once "./assessment/classes/class.assMatchingQuestionGUI.php";
$question =& new ASS_MatchingQuestionGUI();
break;
case "qt_ordering":
include_once "./assessment/classes/class.assOrderingQuestionGUI.php";
$question =& new ASS_OrderingQuestionGUI();
break;
case "qt_imagemap":
include_once "./assessment/classes/class.assImagemapQuestionGUI.php";
$question =& new ASS_ImagemapQuestionGUI();
break;
case "qt_javaapplet":
include_once "./assessment/classes/class.assJavaAppletGUI.php";
$question =& new ASS_JavaAppletGUI();
break;
case "qt_text":
include_once "./assessment/classes/class.assTextQuestionGUI.php";
$question =& new ASS_TextQuestionGUI();
break;
}
if ($question_id > 0)
{
$question->object->loadFromDb($question_id);
}
return $question;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::createReference | ( | ) |
Creates a database reference id for the object.
Creates a database reference id for the object (saves the object to the database and creates a reference id in the database)
public
Reimplemented from ilObject.
Definition at line 82 of file class.ilObjQuestionPool.php.
References $result, and saveToDb().
{
$result = parent::createReference();
$this->saveToDb();
return $result;
}
Here is the call graph for this function:| ilObjQuestionPool::delete | ( | ) |
delete object and all related data
public
Reimplemented from ilObject.
Definition at line 172 of file class.ilObjQuestionPool.php.
References ilObject::deleteMetaData(), and deleteQuestionpool().
{
/* $questions =& $this->getAllQuestions();
$used_questions = 0;
include_once "./assessment/classes/class.assQuestion.php";
foreach ($questions as $question_id)
{
if (ASS_Question::_isUsedInRandomTest($question_id))
{
$used_questions++;
}
}
if ($used_questions)
{
return false;
}
*/
// always call parent delete function first!!
if (!parent::delete())
{
return false;
}
// delete meta data
$this->deleteMetaData();
//put here your module specific stuff
$this->deleteQuestionpool();
return true;
}
Here is the call graph for this function:| ilObjQuestionPool::deleteQuestion | ( | $ | question_id | ) |
Deletes a question from the question pool.
Deletes a question from the question pool
| integer | $question_id The database id of the question private |
Definition at line 328 of file class.ilObjQuestionPool.php.
Referenced by deleteQuestionpool().
{
include_once "./assessment/classes/class.assQuestion.php";
$question = new ASS_Question();
$question->delete($question_id);
}
Here is the caller graph for this function:| ilObjQuestionPool::deleteQuestionpool | ( | ) |
Definition at line 205 of file class.ilObjQuestionPool.php.
References ilUtil::delDir(), deleteQuestion(), getAllQuestions(), ilUtil::getDataDir(), and ilObject::getId().
Referenced by delete().
{
$questions =& $this->getAllQuestions();
if (count($questions))
{
foreach ($questions as $question_id)
{
$this->deleteQuestion($question_id);
}
}
// delete export files
include_once "./classes/class.ilUtil.php";
$qpl_data_dir = ilUtil::getDataDir()."/qpl_data";
$directory = $qpl_data_dir."/qpl_".$this->getId();
if (is_dir($directory))
{
include_once "./classes/class.ilUtil.php";
ilUtil::delDir($directory);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::duplicateQuestion | ( | $ | question_id | ) |
Duplicates a question for a questionpool.
Duplicates a question for a questionpool
| integer | $question_id The database id of the question public |
Definition at line 551 of file class.ilObjQuestionPool.php.
References $counter, and createQuestion().
Referenced by copyQuestion().
{
$question =& $this->createQuestion("", $question_id);
$newtitle = $question->object->getTitle();
if ($question->object->questionTitleExists($this->getId(), $question->object->getTitle()))
{
$counter = 2;
while ($question->object->questionTitleExists($this->getId(), $question->object->getTitle() . " ($counter)"))
{
$counter++;
}
$newtitle = $question->object->getTitle() . " ($counter)";
}
$question->object->duplicate(false, $newtitle);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::exportFileItems | ( | $ | a_target_dir, | |
| &$ | expLog | |||
| ) |
export files of file itmes
Definition at line 873 of file class.ilObjQuestionPool.php.
References $file_obj.
Referenced by exportPagesXML().
{
include_once("classes/class.ilObjFile.php");
foreach ($this->file_ids as $file_id)
{
$expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
$file_obj = new ilObjFile($file_id, false);
$file_obj->export($a_target_dir);
unset($file_obj);
}
}
Here is the caller graph for this function:| ilObjQuestionPool::exportPagesXML | ( | &$ | a_xml_writer, | |
| $ | a_inst, | |||
| $ | a_target_dir, | |||
| &$ | expLog, | |||
| $ | questions | |||
| ) |
export pages of test to xml (see ilias_co.dtd)
| object | $a_xml_writer ilXmlWriter object that receives the xml data |
Definition at line 721 of file class.ilObjQuestionPool.php.
References $ilBench, exportFileItems(), exportXMLMediaObjects(), exportXMLMetaData(), and exportXMLPageObjects().
{
global $ilBench;
$this->mob_ids = array();
$this->file_ids = array();
$attrs = array();
$attrs["Type"] = "Questionpool_Test";
$a_xml_writer->xmlStartTag("ContentObject", $attrs);
// MetaData
$this->exportXMLMetaData($a_xml_writer);
// PageObjects
$expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
$ilBench->start("ContentObjectExport", "exportPageObjects");
$this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog, $questions);
$ilBench->stop("ContentObjectExport", "exportPageObjects");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
// MediaObjects
$expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
$ilBench->start("ContentObjectExport", "exportMediaObjects");
$this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
$ilBench->stop("ContentObjectExport", "exportMediaObjects");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
// FileItems
$expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
$ilBench->start("ContentObjectExport", "exportFileItems");
$this->exportFileItems($a_target_dir, $expLog);
$ilBench->stop("ContentObjectExport", "exportFileItems");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
$a_xml_writer->xmlEndTag("ContentObject");
}
Here is the call graph for this function:| ilObjQuestionPool::exportXMLMediaObjects | ( | &$ | a_xml_writer, | |
| $ | a_inst, | |||
| $ | a_target_dir, | |||
| &$ | expLog | |||
| ) |
export media objects to xml (see ilias_co.dtd)
| object | $a_xml_writer ilXmlWriter object that receives the xml data |
Definition at line 855 of file class.ilObjQuestionPool.php.
Referenced by exportPagesXML().
{
include_once("content/classes/Media/class.ilObjMediaObject.php");
foreach ($this->mob_ids as $mob_id)
{
$expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
$media_obj = new ilObjMediaObject($mob_id);
$media_obj->exportXML($a_xml_writer, $a_inst);
$media_obj->exportFiles($a_target_dir);
unset($media_obj);
}
}
Here is the caller graph for this function:| ilObjQuestionPool::exportXMLMetaData | ( | &$ | a_xml_writer | ) |
export content objects meta data to xml (see ilias_co.dtd)
| object | $a_xml_writer ilXmlWriter object that receives the xml data |
Definition at line 765 of file class.ilObjQuestionPool.php.
References ilObject::getId(), and ilObject::getType().
Referenced by exportPagesXML().
{
include_once("Services/MetaData/classes/class.ilMD2XML.php");
$md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
$md2xml->setExportMode(true);
$md2xml->startExport();
$a_xml_writer->appendXML($md2xml->getXML());
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::exportXMLPageObjects | ( | &$ | a_xml_writer, | |
| $ | a_inst, | |||
| &$ | expLog, | |||
| $ | questions | |||
| ) |
export page objects to xml (see ilias_co.dtd)
| object | $a_xml_writer ilXmlWriter object that receives the xml data |
Definition at line 792 of file class.ilObjQuestionPool.php.
References $file_ids, $ilBench, and $xml.
Referenced by exportPagesXML().
{
global $ilBench;
include_once "./content/classes/class.ilLMPageObject.php";
foreach ($questions as $question_id)
{
$ilBench->start("ContentObjectExport", "exportPageObject");
$expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$question_id);
$attrs = array();
$a_xml_writer->xmlStartTag("PageObject", $attrs);
// export xml to writer object
$ilBench->start("ContentObjectExport", "exportPageObject_XML");
$page_object = new ilPageObject("qpl", $question_id);
$page_object->buildDom();
$page_object->insertInstIntoIDs($a_inst);
$mob_ids = $page_object->collectMediaObjects(false);
$file_ids = $page_object->collectFileItems();
$xml = $page_object->getXMLFromDom(false, false, false, "", true);
$xml = str_replace("&","&", $xml);
$a_xml_writer->appendXML($xml);
$page_object->freeDom();
unset ($page_object);
$ilBench->stop("ContentObjectExport", "exportPageObject_XML");
// collect media objects
$ilBench->start("ContentObjectExport", "exportPageObject_CollectMedia");
//$mob_ids = $page_obj->getMediaObjectIDs();
foreach($mob_ids as $mob_id)
{
$this->mob_ids[$mob_id] = $mob_id;
}
$ilBench->stop("ContentObjectExport", "exportPageObject_CollectMedia");
// collect all file items
$ilBench->start("ContentObjectExport", "exportPageObject_CollectFileItems");
//$file_ids = $page_obj->getFileItemIds();
foreach($file_ids as $file_id)
{
$this->file_ids[$file_id] = $file_id;
}
$ilBench->stop("ContentObjectExport", "exportPageObject_CollectFileItems");
$a_xml_writer->xmlEndTag("PageObject");
//unset($page_obj);
$ilBench->stop("ContentObjectExport", "exportPageObject");
}
}
Here is the caller graph for this function:| & ilObjQuestionPool::getAllQuestionIds | ( | ) |
Definition at line 1053 of file class.ilObjQuestionPool.php.
{
$query = sprintf("SELECT question_id FROM qpl_questions WHERE ISNULL(original_id) AND obj_fi = %s AND complete = %s",
$this->ilias->db->quote($this->getId()),
$this->ilias->db->quote("1")
);
$query_result = $this->ilias->db->query($query);
$questions = array();
if ($query_result->numRows())
{
while ($row = $query_result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($questions, $row["question_id"]);
}
}
return $questions;
}
| & ilObjQuestionPool::getAllQuestions | ( | ) |
Retrieve an array containing all question ids of the questionpool.
Retrieve an array containing all question ids of the questionpool
Definition at line 1035 of file class.ilObjQuestionPool.php.
References $query, $result, and $row.
Referenced by deleteQuestionpool().
{
global $ilDB;
$query = sprintf("SELECT question_id FROM qpl_questions WHERE obj_fi = %s AND original_id IS NULL",
$ilDB->quote($this->getId())
);
$result = $ilDB->query($query);
$questions = array();
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($questions, $row["question_id"]);
}
return $questions;
}
Here is the caller graph for this function:| & ilObjQuestionPool::getDeleteableQuestionDetails | ( | $ | question_ids | ) |
Returns an array containing the qpl_question and qpl_question_type fields of deleteable questions for an array of question ids.
Returns an array containing the qpl_question and qpl_question_type fields of deleteable questions for an array of question ids
| array | $question_ids An array containing the question ids |
Definition at line 1392 of file class.ilObjQuestionPool.php.
References $query, $result, $row, and ASS_Question::_isUsedInRandomTest().
{
global $ilDB;
$result = array();
$whereclause = join($question_ids, " OR qpl_questions.question_id = ");
$whereclause = " AND (qpl_questions.question_id = " . $whereclause . ")";
$query = "SELECT qpl_questions.*, qpl_question_type.type_tag FROM qpl_questions, qpl_question_type WHERE qpl_questions.question_type_fi = qpl_question_type.question_type_id$whereclause ORDER BY qpl_questions.title";
$query_result = $ilDB->query($query);
if ($query_result->numRows())
{
include_once "./assessment/classes/class.assQuestion.php";
while ($row = $query_result->fetchRow(DB_FETCHMODE_ASSOC))
{
if (!ASS_Question::_isUsedInRandomTest($row["question_id"]))
{
array_push($result, $row);
}
}
}
return $result;
}
Here is the call graph for this function:| ilObjQuestionPool::getDescription | ( | ) |
get description of content object
Reimplemented from ilObject.
Definition at line 432 of file class.ilObjQuestionPool.php.
{
return parent::getDescription();
}
| ilObjQuestionPool::getExportDirectory | ( | ) |
get export directory of questionpool
Definition at line 921 of file class.ilObjQuestionPool.php.
References ilUtil::getDataDir().
{
include_once "./classes/class.ilUtil.php";
$export_dir = ilUtil::getDataDir()."/qpl_data"."/qpl_".$this->getId()."/export";
return $export_dir;
}
Here is the call graph for this function:| ilObjQuestionPool::getExportFiles | ( | $ | dir | ) |
get export files
Definition at line 931 of file class.ilObjQuestionPool.php.
References $file.
{
// quit if import dir not available
if (!@is_dir($dir) or
!is_writeable($dir))
{
return array();
}
// open directory
$dir = dir($dir);
// initialize array
$file = array();
// get files and save the in the array
while ($entry = $dir->read())
{
if ($entry != "." and
$entry != ".." and
substr($entry, -4) == ".zip" and
ereg("^[0-9]{10}_{2}[0-9]+_{2}(qpl__)*[0-9]+\.zip\$", $entry))
{
$file[] = $entry;
}
}
// close import directory
$dir->close();
// sort files
sort ($file);
reset ($file);
return $file;
}
| ilObjQuestionPool::getImportDirectory | ( | ) |
get import directory of lm
Definition at line 1014 of file class.ilObjQuestionPool.php.
References ilUtil::getDataDir().
{
include_once "./classes/class.ilUtil.php";
$import_dir = ilUtil::getDataDir()."/qpl_data/qpl_import";
if(@is_dir($import_dir))
{
return $import_dir;
}
else
{
return false;
}
}
Here is the call graph for this function:| ilObjQuestionPool::getImportMapping | ( | ) |
get array of (two) new created questions for import id
Definition at line 1075 of file class.ilObjQuestionPool.php.
{
if (!is_array($this->import_mapping))
{
return array();
}
else
{
return $this->import_mapping;
}
}
| ilObjQuestionPool::getOnline | ( | ) |
Definition at line 1163 of file class.ilObjQuestionPool.php.
{
if (strcmp($this->online, "") == 0) $this->online = "0";
return $this->online;
}
| & ilObjQuestionPool::getQplQuestions | ( | ) |
Definition at line 1483 of file class.ilObjQuestionPool.php.
References $query, $result, and $row.
{
global $ilDB;
$questions = array();
$query = sprintf("SELECT qpl_questions.question_id FROM qpl_questions WHERE ISNULL(qpl_questions.original_id) AND qpl_questions.obj_fi = %s",
$ilDB->quote($this->getId() . "")
);
$result = $ilDB->query($query);
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($questions, $row["question_id"]);
}
return $questions;
}
| & ilObjQuestionPool::getQuestionDetails | ( | $ | question_ids | ) |
Returns an array containing the qpl_question and qpl_question_type fields for an array of question ids.
Returns an array containing the qpl_question and qpl_question_type fields for an array of question ids
| array | $question_ids An array containing the question ids |
Definition at line 1362 of file class.ilObjQuestionPool.php.
References $query, $result, and $row.
{
global $ilDB;
$result = array();
$whereclause = join($question_ids, " OR qpl_questions.question_id = ");
$whereclause = " AND (qpl_questions.question_id = " . $whereclause . ")";
$query = "SELECT qpl_questions.*, qpl_question_type.type_tag FROM qpl_questions, qpl_question_type WHERE qpl_questions.question_type_fi = qpl_question_type.question_type_id$whereclause ORDER BY qpl_questions.title";
$query_result = $ilDB->query($query);
if ($query_result->numRows())
{
while ($row = $query_result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($result, $row);
}
}
return $result;
}
| ilObjQuestionPool::getQuestionsTable | ( | $ | sortoptions, | |
| $ | filter_text, | |||
| $ | sel_filter_type, | |||
| $ | startrow = 0 | |||
| ) |
Calculates the data for the output of the questionpool.
Calculates the data for the output of the questionpool
public
Definition at line 608 of file class.ilObjQuestionPool.php.
References $ilUser, $key, $query, $row, ilObject::getId(), and ilUtil::getImagePath().
{
global $ilUser;
$where = "";
if (strlen($filter_text) > 0)
{
switch($sel_filter_type)
{
case "title":
$where = " AND qpl_questions.title LIKE " . $this->ilias->db->quote("%" . $filter_text . "%");
break;
case "comment":
$where = " AND qpl_questions.comment LIKE " . $this->ilias->db->quote("%" . $filter_text . "%");
break;
case "author":
$where = " AND qpl_questions.author LIKE " . $this->ilias->db->quote("%" . $filter_text . "%");
break;
}
}
// build sort order for sql query
$order = "";
$images = array();
include_once "./classes/class.ilUtil.php";
if (count($sortoptions))
{
foreach ($sortoptions as $key => $value)
{
switch($key)
{
case "title":
$order = " ORDER BY title $value";
$images["title"] = " <img src=\"" . ilUtil::getImagePath(strtolower($value) . "_order.png", true) . "\" alt=\"" . $this->lng->txt(strtolower($value) . "ending_order")."\" />";
break;
case "comment":
$order = " ORDER BY comment $value";
$images["comment"] = " <img src=\"" . ilUtil::getImagePath(strtolower($value) . "_order.png", true) . "\" alt=\"" . $this->lng->txt(strtolower($value) . "ending_order")."\" />";
break;
case "type":
$order = " ORDER BY question_type_id $value";
$images["type"] = " <img src=\"" . ilUtil::getImagePath(strtolower($value) . "_order.png", true) . "\" alt=\"" . $this->lng->txt(strtolower($value) . "ending_order")."\" />";
break;
case "author":
$order = " ORDER BY author $value";
$images["author"] = " <img src=\"" . ilUtil::getImagePath(strtolower($value) . "_order.png", true) . "\" alt=\"" . $this->lng->txt(strtolower($value) . "ending_order")."\" />";
break;
case "created":
$order = " ORDER BY created $value";
$images["created"] = " <img src=\"" . ilUtil::getImagePath(strtolower($value) . "_order.png", true) . "\" alt=\"" . $this->lng->txt(strtolower($value) . "ending_order")."\" />";
break;
case "updated":
$order = " ORDER BY TIMESTAMP14 $value";
$images["updated"] = " <img src=\"" . ilUtil::getImagePath(strtolower($value) . "_order.png", true) . "\" alt=\"" . $this->lng->txt(strtolower($value) . "ending_order")."\" />";
break;
}
}
}
$maxentries = $ilUser->prefs["hits_per_page"];
if ($maxentries < 1)
{
$maxentries = 9999;
}
$query = "SELECT qpl_questions.question_id, qpl_questions.TIMESTAMP + 0 AS TIMESTAMP14 FROM qpl_questions, qpl_question_type WHERE ISNULL(qpl_questions.original_id) AND qpl_questions.question_type_fi = qpl_question_type.question_type_id AND qpl_questions.obj_fi = " . $this->getId() . " $where$order$limit";
$query_result = $this->ilias->db->query($query);
$max = $query_result->numRows();
if ($startrow > $max -1)
{
$startrow = $max - ($max % $maxentries);
}
else if ($startrow < 0)
{
$startrow = 0;
}
$limit = " LIMIT $startrow, $maxentries";
$query = "SELECT qpl_questions.*, qpl_questions.TIMESTAMP + 0 AS TIMESTAMP14, qpl_question_type.type_tag FROM qpl_questions, qpl_question_type WHERE ISNULL(qpl_questions.original_id) AND qpl_questions.question_type_fi = qpl_question_type.question_type_id AND qpl_questions.obj_fi = " . $this->getId() . " $where$order$limit";
$query_result = $this->ilias->db->query($query);
$rows = array();
if ($query_result->numRows())
{
while ($row = $query_result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($rows, $row);
}
}
$nextrow = $startrow + $maxentries;
if ($nextrow > $max - 1)
{
$nextrow = $startrow;
}
$prevrow = $startrow - $maxentries;
if ($prevrow < 0)
{
$prevrow = 0;
}
return array(
"rows" => $rows,
"images" => $images,
"startrow" => $startrow,
"nextrow" => $nextrow,
"prevrow" => $prevrow,
"step" => $maxentries,
"rowcount" => $max
);
}
Here is the call graph for this function:| ilObjQuestionPool::getQuestiontype | ( | $ | question_id | ) |
Returns the question type of a question with a given id.
Returns the question type of a question with a given id
| integer | $question_id The database id of the question |
Definition at line 405 of file class.ilObjQuestionPool.php.
References $data, $query, and $result.
Referenced by createQuestion().
{
if ($question_id < 1)
{
return;
}
$query = sprintf("SELECT qpl_question_type.type_tag FROM qpl_questions, qpl_question_type WHERE qpl_questions.question_type_fi = qpl_question_type.question_type_id AND qpl_questions.question_id = %s",
$this->ilias->db->quote($question_id));
$result = $this->ilias->db->query($query);
if ($result->numRows() == 1)
{
$data = $result->fetchRow(DB_FETCHMODE_OBJECT);
return $data->type_tag;
}
else
{
return;
}
}
Here is the caller graph for this function:| ilObjQuestionPool::getTitle | ( | ) |
get title of glossary object
Reimplemented from ilObject.
Definition at line 450 of file class.ilObjQuestionPool.php.
Referenced by updateMetaData().
{
return parent::getTitle();
}
Here is the caller graph for this function:| & ilObjQuestionPool::getUsedQuestionDetails | ( | $ | question_ids | ) |
Returns an array containing the qpl_question and qpl_question_type fields of questions which are used in a random test for an array of question ids.
Returns an array containing the qpl_question and qpl_question_type fields of questions which are used in a random test for an array of question ids
| array | $question_ids An array containing the question ids |
Definition at line 1426 of file class.ilObjQuestionPool.php.
References $query, $result, $row, and ASS_Question::_isUsedInRandomTest().
{
global $ilDB;
$result = array();
$whereclause = join($question_ids, " OR qpl_questions.question_id = ");
$whereclause = " AND (qpl_questions.question_id = " . $whereclause . ")";
$query = "SELECT qpl_questions.*, qpl_question_type.type_tag FROM qpl_questions, qpl_question_type WHERE qpl_questions.question_type_fi = qpl_question_type.question_type_id$whereclause ORDER BY qpl_questions.title";
$query_result = $ilDB->query($query);
if ($query_result->numRows())
{
include_once "./assessment/classes/class.assQuestion.php";
while ($row = $query_result->fetchRow(DB_FETCHMODE_ASSOC))
{
if (ASS_Question::_isUsedInRandomTest($row["question_id"]))
{
array_push($result, $row);
}
}
}
return $result;
}
Here is the call graph for this function:| ilObjQuestionPool::ilClone | ( | $ | a_parent_ref | ) |
copy all entries of your object.
public
| integer | ref_id of parent object |
Reimplemented from ilObject.
Definition at line 143 of file class.ilObjQuestionPool.php.
References $rbacadmin.
{
global $rbacadmin;
// always call parent ilClone function first!!
$new_ref_id = parent::ilClone($a_parent_ref);
// get object instance of ilCloned object
//$newObj =& $this->ilias->obj_factory->getInstanceByRefId($new_ref_id);
// create a local role folder & default roles
//$roles = $newObj->initDefaultRoles();
// ...finally assign role to creator of object
//$rbacadmin->assignUser($roles[0], $newObj->getOwner(), "n");
// always destroy objects in ilClone method because ilClone() is recursive and creates instances for each object in subtree!
//unset($newObj);
// ... and finally always return new reference ID!!
return $new_ref_id;
}
| ilObjQuestionPool::ilObjQuestionPool | ( | $ | a_id = 0, |
|
| $ | a_call_by_reference = true | |||
| ) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 52 of file class.ilObjQuestionPool.php.
References ilObject::ilObject(), and setOnline().
Referenced by _clone().
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::initDefaultRoles | ( | ) |
init default roles settings
If your module does not require any default roles, delete this method (For an example how this method is used, look at ilObjForum)
public
Reimplemented from ilObject.
Definition at line 237 of file class.ilObjQuestionPool.php.
References $rbacadmin, and $roles.
{
global $rbacadmin;
// create a local role folder
//$rfoldObj = $this->createRoleFolder("Local roles","Role Folder of forum obj_no.".$this->getId());
// create moderator role and assign role to rolefolder...
//$roleObj = $rfoldObj->createRole("Moderator","Moderator of forum obj_no.".$this->getId());
//$roles[] = $roleObj->getId();
//unset($rfoldObj);
//unset($roleObj);
return $roles ? $roles : array();
}
| ilObjQuestionPool::isInUse | ( | $ | question_id | ) |
Checks whether the question is in use or not.
Checks whether the question is in use or not
| integer | $question_id The question id of the question to be checked |
Definition at line 472 of file class.ilObjQuestionPool.php.
| ilObjQuestionPool::loadFromDb | ( | ) |
Loads a ilObjQuestionpool object from a database.
Loads a ilObjQuestionpool object from a database
public
Definition at line 342 of file class.ilObjQuestionPool.php.
References $query, $result, $row, and setOnline().
Referenced by read().
{
global $ilDB;
$query = sprintf("SELECT * FROM qpl_questionpool WHERE obj_fi = %s",
$ilDB->quote($this->getId() . "")
);
$result = $ilDB->query($query);
if ($result->numRows() == 1)
{
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
$this->setOnline($row["online"]);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::modifyExportIdentifier | ( | $ | a_tag, | |
| $ | a_param, | |||
| $ | a_value | |||
| ) |
Definition at line 774 of file class.ilObjQuestionPool.php.
References ilUtil::insertInstIntoID().
{
if ($a_tag == "Identifier" && $a_param == "Entry")
{
include_once "./classes/class.ilUtil.php";
$a_value = ilUtil::insertInstIntoID($a_value);
}
return $a_value;
}
Here is the call graph for this function:| ilObjQuestionPool::moveToClipboard | ( | $ | question_id | ) |
Moves a question to the clipboard.
Moves a question to the clipboard
| integer | $question_id Object id of the question private |
Definition at line 1314 of file class.ilObjQuestionPool.php.
References $_SESSION.
| ilObjQuestionPool::notify | ( | $ | a_event, | |
| $ | a_ref_id, | |||
| $ | a_parent_non_rbac_id, | |||
| $ | a_node_id, | |||
| $ | a_params = 0 | |||
| ) |
notifys an object about an event occured Based on the event happend, each object may decide how it reacts.
If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup)
public
| string | event | |
| integer | reference id of object where the event occured | |
| array | passes optional parameters if required |
Reimplemented from ilObject.
Definition at line 267 of file class.ilObjQuestionPool.php.
References $_GET, $tree, and ilObject::getType().
{
global $tree;
switch ($a_event)
{
case "link":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
//exit;
break;
case "cut":
//echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
//exit;
break;
case "copy":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
//exit;
break;
case "paste":
//echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
//exit;
break;
case "new":
//echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
//exit;
break;
}
// At the beginning of the recursive process it avoids second call of the notify function with the same parameter
if ($a_node_id==$_GET["ref_id"])
{
$parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$parent_type = $parent_obj->getType();
if($parent_type == $this->getType())
{
$a_node_id = (int) $tree->getParentId($a_node_id);
}
}
parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
}
Here is the call graph for this function:| ilObjQuestionPool::pasteFromClipboard | ( | ) |
Copies a question to the clipboard.
Copies a question to the clipboard
| integer | $question_id Object id of the question private |
Definition at line 1232 of file class.ilObjQuestionPool.php.
References $_SESSION, $query, $result, $row, copyQuestion(), ilObject::getId(), and ilUtil::makeDirParents().
{
global $ilDB;
if (array_key_exists("qpl_clipboard", $_SESSION))
{
foreach ($_SESSION["qpl_clipboard"] as $question_object)
{
if (strcmp($question_object["action"], "move") == 0)
{
$query = sprintf("SELECT obj_fi FROM qpl_questions WHERE question_id = %s",
$ilDB->quote($question_object["question_id"])
);
$result = $ilDB->query($query);
if ($result->numRows() == 1)
{
include_once "./content/classes/Pages/class.ilPageObject.php";
$page = new ilPageObject("qpl", $question_object["question_id"]);
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
$source_questionpool = $row["obj_fi"];
// change the questionpool id in the qpl_questions table
$query = sprintf("UPDATE qpl_questions SET obj_fi = %s WHERE question_id = %s",
$ilDB->quote($this->getId() . ""),
$ilDB->quote($question_object["question_id"])
);
$ilDB->query($query);
// change page object of question and set the correct parent id
$query = sprintf("UPDATE page_object SET parent_id = %s WHERE page_id = %s",
$ilDB->quote($this->getId() . ""),
$ilDB->quote($question_object["question_id"])
);
$ilDB->query($query);
// move question data to the new target directory
$source_path = CLIENT_WEB_DIR . "/assessment/" . $source_questionpool . "/" . $question_object["question_id"] . "/";
if (@is_dir($source_path))
{
$target_path = CLIENT_WEB_DIR . "/assessment/" . $this->getId() . "/";
if (!@is_dir($target_path))
{
include_once "./classes/class.ilUtil.php";
ilUtil::makeDirParents($target_path);
}
@rename($source_path, $target_path . $question_object["question_id"]);
}
}
}
else
{
$this->copyQuestion($question_object["question_id"], $this->getId());
}
}
}
unset($_SESSION["qpl_clipboard"]);
}
Here is the call graph for this function:| ilObjQuestionPool::read | ( | $ | a_force_db = false |
) |
read object data from db into object
| boolean | public |
Reimplemented from ilObject.
Definition at line 130 of file class.ilObjQuestionPool.php.
References loadFromDb().
{
parent::read($a_force_db);
$this->loadFromDb();
}
Here is the call graph for this function:| ilObjQuestionPool::saveToDb | ( | ) |
Saves a ilObjQuestionpool object to a database.
Saves a ilObjQuestionpool object to a database
public
Definition at line 364 of file class.ilObjQuestionPool.php.
References $query, and $result.
Referenced by createReference().
{
global $ilDB;
$query = sprintf("SELECT * FROM qpl_questionpool WHERE obj_fi = %s",
$ilDB->quote($this->getId() . "")
);
$result = $ilDB->query($query);
if ($result->numRows() == 1)
{
$query = sprintf("UPDATE qpl_questionpool SET online = %s WHERE obj_fi = %s",
$ilDB->quote($this->getOnline() . ""),
$ilDB->quote($this->getId() . "")
);
$result = $ilDB->query($query);
if ($result != DB_OK)
{
}
}
else
{
$query = sprintf("INSERT INTO qpl_questionpool (online, obj_fi) VALUES (%s, %s)",
$ilDB->quote($this->getOnline() . ""),
$ilDB->quote($this->getId() . "")
);
$result = $ilDB->query($query);
if ($result != DB_OK)
{
}
}
}
Here is the caller graph for this function:| ilObjQuestionPool::setDescription | ( | $ | a_description | ) |
set description of content object
Reimplemented from ilObject.
Definition at line 440 of file class.ilObjQuestionPool.php.
{
parent::setDescription($a_description);
}
| ilObjQuestionPool::setOnline | ( | $ | a_online_status | ) |
Sets the questionpool online status.
Sets the questionpool online status
| integer | $a_online_status Online status of the questionpool |
Definition at line 1149 of file class.ilObjQuestionPool.php.
Referenced by ilObjQuestionPool(), and loadFromDb().
{
switch ($a_online_status)
{
case 0:
case 1:
$this->online = $a_online_status;
break;
default:
$this->online = 0;
break;
}
}
Here is the caller graph for this function:| ilObjQuestionPool::setTitle | ( | $ | a_title | ) |
set title of glossary object
Reimplemented from ilObject.
Definition at line 458 of file class.ilObjQuestionPool.php.
{
parent::setTitle($a_title);
}
| ilObjQuestionPool::to_xml | ( | $ | questions | ) |
Returns a QTI xml representation of a list of questions.
Returns a QTI xml representation of a list of questions
| array | $questions An array containing the question ids of the questions |
Definition at line 1096 of file class.ilObjQuestionPool.php.
References $key, $xml, and createQuestion().
{
$xml = "";
// export button was pressed
if (count($questions) > 0)
{
foreach ($questions as $key => $value)
{
$question =& $this->createQuestion("", $value);
$xml .= $question->object->to_xml();
}
if (count($questions) > 1)
{
$xml = preg_replace("/<\/questestinterop>\s*<.xml.*?>\s*<questestinterop>/", "", $xml);
}
}
return $xml;
}
Here is the call graph for this function:| ilObjQuestionPool::update | ( | ) |
update object data
public
Reimplemented from ilObject.
Definition at line 95 of file class.ilObjQuestionPool.php.
References updateMetaData().
{
$this->updateMetaData();
if (!parent::update())
{
return false;
}
// put here object specific stuff
return true;
}
Here is the call graph for this function:| ilObjQuestionPool::updateMetaData | ( | ) |
update meta data entry
Reimplemented from ilObject.
Definition at line 108 of file class.ilObjQuestionPool.php.
References $ilUser, ilObject::getId(), getTitle(), and ilObject::getType().
Referenced by update().
{
global $ilUser;
include_once "./Services/MetaData/classes/class.ilMD.php";
$md =& new ilMD($this->getId(), 0, $this->getType());
$md_gen =& $md->getGeneral();
if ($md_gen == false)
{
include_once "./Services/MetaData/classes/class.ilMDCreator.php";
$md_creator = new ilMDCreator($this->getId(),0,$this->getType());
$md_creator->setTitle($this->getTitle());
$md_creator->setTitleLanguage($ilUser->getPref('language'));
$md_creator->create();
}
parent::updateMetaData();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjQuestionPool::$online |
Definition at line 44 of file class.ilObjQuestionPool.php.
1.7.1