4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
34 $this->
ilObject($a_id,$a_call_by_reference);
75 if (!parent::update())
88 include_once
"./Services/MetaData/classes/class.ilMD.php";
90 $md_gen =& $md->getGeneral();
93 include_once
"./Services/MetaData/classes/class.ilMDCreator.php";
95 $md_creator->setTitle($this->
getTitle());
96 $md_creator->setTitleLanguage($ilUser->getPref(
'language'));
97 $md_creator->create();
107 function read($a_force_db =
false)
123 if (!parent::delete())
141 if (count($questions))
143 foreach ($questions as $question_id)
150 include_once
"./Services/Utilities/classes/class.ilUtil.php";
152 $directory = $qpl_data_dir.
"/qpl_".$this->
getId();
153 if (is_dir($directory))
155 include_once
"./Services/Utilities/classes/class.ilUtil.php";
185 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
225 if ($a_node_id==
$_GET[
"ref_id"])
227 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
228 $parent_type = $parent_obj->getType();
229 if($parent_type == $this->
getType())
231 $a_node_id = (int) $tree->getParentId($a_node_id);
235 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
246 include_once
"./Modules/Test/classes/class.ilObjTest.php";
249 $question->delete($question_id);
261 $result = $ilDB->queryF(
"SELECT * FROM qpl_questionpool WHERE obj_fi = %s",
263 array($this->
getId())
281 $result = $ilDB->queryF(
"SELECT id_questionpool FROM qpl_questionpool WHERE obj_fi = %s",
283 array($this->
getId())
287 $result = $ilDB->manipulateF(
"UPDATE qpl_questionpool SET isonline = %s, tstamp = %s WHERE obj_fi = %s",
288 array(
'text',
'integer',
'integer'),
294 $next_id = $ilDB->nextId(
'qpl_questionpool');
295 $result = $ilDB->manipulateF(
"INSERT INTO qpl_questionpool (id_questionpool, isonline, tstamp, obj_fi) VALUES (%s, %s, %s, %s)",
296 array(
'integer',
'text',
'integer',
'integer'),
313 if ($question_id < 1)
318 $result = $ilDB->queryF(
"SELECT qpl_qst_type.type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND qpl_questions.question_id = %s",
325 return $data[
"type_tag"];
380 $result = $ilDB->queryF(
"SELECT COUNT(solution_id) solution_count FROM tst_solutions WHERE question_fi = %s",
385 return $row[
"solution_count"];
390 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
393 $question_type_gui = $question_type .
"GUI";
394 $question_gui =&
new $question_type_gui();
395 return $question_gui;
407 $newtitle = $question->object->getTitle();
408 if ($question->object->questionTitleExists($this->getId(), $question->object->getTitle()))
411 while ($question->object->questionTitleExists($this->getId(), $question->object->getTitle() .
" ($counter)"))
415 $newtitle = $question->object->getTitle() .
" ($counter)";
417 $question->object->duplicate(
false, $newtitle);
432 if ($question_gui->object->getObjId() == $questionpool_to)
440 $newtitle = $question_gui->object->getTitle();
441 if ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle()))
444 while ($question_gui->object->questionTitleExists($this->getId(), $question_gui->object->getTitle() .
" ($counter)"))
448 $newtitle = $question_gui->object->getTitle() .
" ($counter)";
450 $question_gui->object->copyObject($this->
getId(), $newtitle);
465 if (is_array($arrFilter))
467 if (array_key_exists(
'title', $arrFilter) && strlen($arrFilter[
'title']))
469 $where .=
" AND " . $ilDB->like(
'qpl_questions.title',
'text',
"%%" . $arrFilter[
'title'] .
"%%");
471 if (array_key_exists(
'description', $arrFilter) && strlen($arrFilter[
'description']))
473 $where .=
" AND " . $ilDB->like(
'qpl_questions.description',
'text',
"%%" . $arrFilter[
'description'] .
"%%");
475 if (array_key_exists(
'author', $arrFilter) && strlen($arrFilter[
'author']))
477 $where .=
" AND " . $ilDB->like(
'qpl_questions.author',
'text',
"%%" . $arrFilter[
'author'] .
"%%");
479 if (array_key_exists(
'type', $arrFilter) && strlen($arrFilter[
'type']))
481 $where .=
" AND qpl_qst_type.type_tag = " . $ilDB->quote($arrFilter[
'type'],
'text');
484 $query_result = $ilDB->queryF(
"SELECT qpl_questions.*, qpl_qst_type.type_tag, qpl_qst_type.plugin FROM qpl_questions, qpl_qst_type WHERE qpl_questions.original_id IS NULL AND qpl_questions.tstamp > 0 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND qpl_questions.obj_fi = %s" . $where,
486 array($this->
getId())
490 if ($query_result->numRows())
492 while (
$row = $ilDB->fetchAssoc($query_result))
494 $row[
'ttype'] = $types[
$row[
'type_tag']];
499 array_push($rows, $row);
504 array_push($rows, $row);
520 $query_result = $ilDB->queryF(
"SELECT qpl_questions.*, qpl_qst_type.type_tag, qpl_qst_type.plugin FROM qpl_questions, qpl_qst_type WHERE qpl_questions.original_id IS NULL AND qpl_questions.tstamp > 0 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND qpl_questions.obj_fi = %s",
522 array($this->
getId())
526 if ($query_result->numRows())
528 while (
$row = $ilDB->fetchAssoc($query_result))
530 $row[
'ttype'] = $types[
$row[
'type_tag']];
535 array_push($rows, $row);
540 array_push($rows, $row);
553 function exportPagesXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog, $questions)
557 $this->mob_ids = array();
558 $this->file_ids = array();
561 $attrs[
"Type"] =
"Questionpool_Test";
562 $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
568 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Page Objects");
569 $ilBench->start(
"ContentObjectExport",
"exportPageObjects");
571 $ilBench->stop(
"ContentObjectExport",
"exportPageObjects");
572 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Page Objects");
575 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Media Objects");
576 $ilBench->start(
"ContentObjectExport",
"exportMediaObjects");
578 $ilBench->stop(
"ContentObjectExport",
"exportMediaObjects");
579 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Media Objects");
582 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export File Items");
583 $ilBench->start(
"ContentObjectExport",
"exportFileItems");
585 $ilBench->stop(
"ContentObjectExport",
"exportFileItems");
586 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export File Items");
588 $a_xml_writer->xmlEndTag(
"ContentObject");
599 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
601 $md2xml->setExportMode(
true);
602 $md2xml->startExport();
603 $a_xml_writer->appendXML($md2xml->getXML());
608 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
610 include_once
"./Services/Utilities/classes/class.ilUtil.php";
628 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
630 foreach ($questions as $question_id)
632 $ilBench->start(
"ContentObjectExport",
"exportPageObject");
633 $expLog->write(date(
"[y-m-d H:i:s] ").
"Page Object ".$question_id);
636 $a_xml_writer->xmlStartTag(
"PageObject", $attrs);
640 $ilBench->start(
"ContentObjectExport",
"exportPageObject_XML");
642 $page_object->buildDom();
643 $page_object->insertInstIntoIDs($a_inst);
644 $mob_ids = $page_object->collectMediaObjects(
false);
645 $file_ids = $page_object->collectFileItems();
646 $xml = $page_object->getXMLFromDom(
false,
false,
false,
"",
true);
647 $xml = str_replace(
"&",
"&", $xml);
648 $a_xml_writer->appendXML($xml);
649 $page_object->freeDom();
650 unset ($page_object);
652 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_XML");
655 $ilBench->start(
"ContentObjectExport",
"exportPageObject_CollectMedia");
657 foreach($mob_ids as $mob_id)
659 $this->mob_ids[$mob_id] = $mob_id;
661 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_CollectMedia");
664 $ilBench->start(
"ContentObjectExport",
"exportPageObject_CollectFileItems");
666 foreach($file_ids as $file_id)
668 $this->file_ids[$file_id] = $file_id;
670 $ilBench->stop(
"ContentObjectExport",
"exportPageObject_CollectFileItems");
672 $a_xml_writer->xmlEndTag(
"PageObject");
675 $ilBench->stop(
"ContentObjectExport",
"exportPageObject");
689 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
691 foreach ($this->mob_ids as $mob_id)
693 $expLog->write(date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
697 $media_obj->exportXML($a_xml_writer, $a_inst);
698 $media_obj->exportFiles($a_target_dir);
710 include_once(
"./Modules/File/classes/class.ilObjFile.php");
712 foreach ($this->file_ids as $file_id)
714 $expLog->write(date(
"[y-m-d H:i:s] ").
"File Item ".$file_id);
715 $file_obj =
new ilObjFile($file_id,
false);
716 $file_obj->export($a_target_dir);
728 include_once
"./Services/Utilities/classes/class.ilUtil.php";
731 if(!is_writable($qpl_data_dir))
733 $this->ilias->raiseError(
"Questionpool Data Directory (".$qpl_data_dir
734 .
") not writeable.",$this->ilias->error_obj->FATAL);
738 $qpl_dir = $qpl_data_dir.
"/qpl_".$this->
getId();
740 if(!@is_dir($qpl_dir))
742 $this->ilias->raiseError(
"Creation of Questionpool Directory failed.",$this->ilias->error_obj->FATAL);
745 $export_dir = $qpl_dir.
"/export";
747 if(!@is_dir($export_dir))
749 $this->ilias->raiseError(
"Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
758 include_once
"./Services/Utilities/classes/class.ilUtil.php";
769 if (!@is_dir(
$dir) or
781 while ($entry =
$dir->read())
783 if ($entry !=
"." and
785 (substr($entry, -4) ==
".zip" or substr($entry, -4) ==
".xls") and
786 ereg(
"^[0-9]{10}_{2}[0-9]+_{2}(qpl__)*[0-9]+\.(zip|xls)\$", $entry))
810 include_once
"./Services/Utilities/classes/class.ilUtil.php";
814 if(!is_writable($qpl_data_dir))
816 $ilias->raiseError(
"Questionpool Data Directory (".$qpl_data_dir
817 .
") not writeable.",$ilias->error_obj->FATAL);
821 $qpl_dir = $qpl_data_dir.
"/qpl_import";
823 if(!@is_dir($qpl_dir))
825 $ilias->raiseError(
"Creation of Questionpool Directory failed.",$ilias->error_obj->FATAL);
834 include_once
"./Services/Utilities/classes/class.ilUtil.php";
836 if(@is_dir($import_dir))
851 include_once
"./Services/Utilities/classes/class.ilUtil.php";
853 if(@is_dir($import_dir))
872 $result = $ilDB->queryF(
"SELECT question_id FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL",
874 array($this->
getId())
876 $questions = array();
879 array_push($questions,
$row[
"question_id"]);
888 $query_result = $ilDB->queryF(
"SELECT question_id, qpl_qst_type.type_tag, qpl_qst_type.plugin FROM qpl_questions, qpl_qst_type WHERE original_id IS NULL AND qpl_questions.tstamp > 0 AND obj_fi = %s AND complete = %s AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
889 array(
'integer',
'text'),
890 array($this->
getId(), 1)
892 $questions = array();
893 if ($query_result->numRows())
895 while (
$row = $ilDB->fetchAssoc($query_result))
901 array_push($questions,
$row[
"question_id"]);
906 array_push($questions,
$row[
"question_id"]);
919 if (!is_array($this->import_mapping))
925 return $this->import_mapping;
940 if (count($questions) > 0)
942 foreach ($questions as
$key => $value)
945 $xml .= $question->object->toXML();
947 if (count($questions) > 1)
949 $xml = preg_replace(
"/<\/questestinterop>\s*<.xml.*?>\s*<questestinterop>/",
"", $xml);
952 $xml = preg_replace(
"/(<\?xml[^>]*?>)/",
"\\1" .
"<!DOCTYPE questestinterop SYSTEM \"ims_qtiasiv1p2p1.dtd\">", $xml);
967 if ($complete_questions_only)
969 $result = $ilDB->queryF(
"SELECT COUNT(question_id) question_count FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL AND complete = %s",
970 array(
'integer',
'text'),
971 array($questionpool_id, 1)
976 $result = $ilDB->queryF(
"SELECT COUNT(question_id) question_count FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND original_id IS NULL",
978 array($questionpool_id)
982 return $row[
"question_count"];
994 switch ($a_online_status)
998 $this->online = $a_online_status;
1008 if (strcmp($this->online,
"") == 0) $this->online =
"0";
1018 $result = $ilDB->queryF(
"SELECT qpl_questionpool.isonline FROM qpl_questionpool,object_reference WHERE object_reference.ref_id = %s AND object_reference.obj_id = qpl_questionpool.obj_fi",
1025 $result = $ilDB->queryF(
"SELECT isonline FROM qpl_questionpool WHERE obj_fi = %s",
1033 return $row[
"isonline"];
1050 $result = $ilDB->queryF(
"SELECT count(DISTINCT qpl_questions.points) equal_points FROM qpl_questions, object_reference WHERE object_reference.ref_id = %s AND qpl_questions.tstamp > 0 AND object_reference.obj_id = qpl_questions.obj_fi AND qpl_questions.original_id IS NULL",
1057 $result = $ilDB->queryF(
"SELECT count(DISTINCT points) equal_points FROM qpl_questions WHERE obj_fi = %s AND qpl_questions.tstamp > 0 AND qpl_questions.original_id IS NULL",
1065 if (
$row[
"equal_points"] == 1)
1086 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
1088 foreach (
$_SESSION[
"qpl_clipboard"] as $question_object)
1090 if (strcmp($question_object[
"action"],
"move") == 0)
1092 $result = $ilDB->queryF(
"SELECT obj_fi FROM qpl_questions WHERE question_id = %s",
1094 array($question_object[
"question_id"])
1099 $source_questionpool =
$row[
"obj_fi"];
1101 $affectedRows = $ilDB->manipulateF(
"UPDATE qpl_questions SET obj_fi = %s WHERE question_id = %s",
1102 array(
'integer',
'integer'),
1103 array($this->
getId(), $question_object[
"question_id"])
1107 $source_path = CLIENT_WEB_DIR .
"/assessment/" . $source_questionpool .
"/" . $question_object[
"question_id"] .
"/";
1108 if (@is_dir($source_path))
1110 $target_path = CLIENT_WEB_DIR .
"/assessment/" . $this->
getId() .
"/";
1111 if (!@is_dir($target_path))
1113 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1116 @rename($source_path, $target_path . $question_object[
"question_id"]);
1141 if (!array_key_exists(
"qpl_clipboard",
$_SESSION))
1145 $_SESSION[
"qpl_clipboard"][$question_id] = array(
"question_id" => $question_id,
"action" =>
"copy");
1156 if (!array_key_exists(
"qpl_clipboard",
$_SESSION))
1160 $_SESSION[
"qpl_clipboard"][$question_id] = array(
"question_id" => $question_id,
"action" =>
"move");
1174 include_once
"./classes/class.ilObject.php";
1201 $query_result = $ilDB->query(
"SELECT qpl_questions.*, qpl_qst_type.type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND " . $ilDB->in(
'qpl_questions.question_id', $question_ids,
false,
'integer') .
" ORDER BY qpl_questions.title");
1202 if ($query_result->numRows())
1204 while (
$row = $ilDB->fetchAssoc($query_result))
1225 $query_result = $ilDB->query(
"SELECT qpl_questions.*, qpl_qst_type.type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND " . $ilDB->in(
'qpl_questions.question_id', $question_ids,
false,
'integer') .
" ORDER BY qpl_questions.title");
1226 if ($query_result->numRows())
1228 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1229 while (
$row = $ilDB->fetchAssoc($query_result))
1244 $duplicate_id = $question->object->duplicate(
true);
1245 if ($duplicate_id > 0)
1248 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_solutions SET question_fi = %s WHERE question_fi = %s",
1249 array(
'integer',
'integer'),
1250 array($duplicate_id,
$row[
"question_id"])
1254 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_test_rnd_qst SET question_fi = %s WHERE question_fi = %s",
1255 array(
'integer',
'integer'),
1256 array($duplicate_id,
$row[
"question_id"])
1260 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_test_result SET question_fi = %s WHERE question_fi = %s",
1261 array(
'integer',
'integer'),
1262 array($duplicate_id,
$row[
"question_id"])
1266 $affectedRows = $ilDB->manipulateF(
"UPDATE ass_log SET question_fi = %s WHERE question_fi = %s",
1267 array(
'integer',
'integer'),
1268 array($duplicate_id,
$row[
"question_id"])
1289 $path = $tree->getPathFull(
$ref_id);
1292 foreach ($path as $item)
1294 if (($counter > 0) && ($counter < count($path)-1))
1296 array_push($items, $item[
"title"]);
1300 $fullpath = join(
" > ", $items);
1301 include_once
"./Services/Utilities/classes/class.ilStr.php";
1302 if (strlen($fullpath) > 60)
1315 function &
_getAvailableQuestionpools($use_object_id = FALSE, $equal_points = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $with_questioncount = FALSE, $permission =
"read",
$usr_id =
"")
1320 $result_array = array();
1321 $permission = (strlen($permission) == 0) ?
"read" : $permission;
1330 if (count($obj_ids))
1332 $in = $ilDB->in(
'object_data.obj_id', $obj_ids,
false,
'integer');
1333 if ($could_be_offline)
1335 $result = $ilDB->query(
"SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ".
1336 "qpl_questionpool.obj_fi = object_data.obj_id AND $in ORDER BY object_data.title");
1340 $result = $ilDB->queryF(
"SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE ".
1341 "qpl_questionpool.obj_fi = object_data.obj_id AND $in AND qpl_questionpool.isonline = %s ".
1342 "ORDER BY object_data.title",
1359 $ref_id = array_search(
$row[
"obj_fi"], $obj_ids);
1360 $title = (($showPath) ? $titles[$ref_id] :
$row[
"title"]);
1361 if ($with_questioncount)
1363 $title .=
" [" . $row[
"questioncount"] .
" " . ($row[
"questioncount"] == 1 ? $this->lng->txt(
"ass_question") : $this->lng->txt(
"assQuestions")) .
"]";
1368 $result_array[$row[
"obj_fi"]] = array(
"title" =>
$title,
"count" => $row[
"questioncount"]);
1372 $result_array[
$ref_id] = array(
"title" =>
$title,
"count" => $row[
"questioncount"]);
1377 return $result_array;
1384 $questions = array();
1385 $result = $ilDB->queryF(
"SELECT qpl_questions.question_id FROM qpl_questions WHERE qpl_questions.original_id IS NULL AND qpl_questions.tstamp > 0 AND qpl_questions.obj_fi = %s",
1387 array($this->
getId())
1391 array_push($questions,
$row[
"question_id"]);
1406 $newObj->saveToDb();
1409 foreach ($questions as $question_id)
1411 $newObj->copyQuestion($question_id, $newObj->getId());
1415 include_once
"./Services/MetaData/classes/class.ilMD.php";
1417 $new_md =& $md->cloneMD($newObj->getId(),0,$newObj->getType());
1420 $newObj->updateMetaData();
1434 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
1436 $lng->loadLanguageModule(
"assessment");
1437 $result = $ilDB->query(
"SELECT * FROM qpl_qst_type");
1441 if ($all_tags || (!in_array(
$row[
"question_type_id"], $forbidden_types)))
1445 if (
$row[
"plugin"] == 0)
1447 $types[$lng->txt(
$row[
"type_tag"])] =
$row;
1451 global $ilPluginAdmin;
1452 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
1453 foreach ($pl_names as $pl_name)
1456 if (strcmp($pl->getQuestionType(),
$row[
"type_tag"]) == 0)
1458 $types[$pl->getQuestionTypeTranslation()] =
$row;
1473 global $ilPluginAdmin;
1475 $lng->loadLanguageModule(
"assessment");
1476 $result = $ilDB->query(
"SELECT * FROM qpl_qst_type");
1480 if (
$row[
"plugin"] == 0)
1482 $types[
$row[
'type_tag']] = $lng->txt($row[
"type_tag"]);
1486 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"TestQuestionPool",
"qst");
1487 foreach ($pl_names as $pl_name)
1490 if (strcmp($pl->getQuestionType(),
$row[
"type_tag"]) == 0)
1492 $types[
$row[
'type_tag']] = $pl->getQuestionTypeTranslation();
1508 $allowed_types = array(
"assImagemapQuestion",
"assMatchingQuestion",
1510 "assClozeTest",
"assMultipleChoice",
"assSingleChoice",
"assOrderingQuestion");
1513 foreach($qtypes as $k =>
$t)
1515 if (in_array(
$t[
"type_tag"], $allowed_types))
1528 $questions = array();
1529 $result = $ilDB->queryF(
"SELECT qpl_questions.*, qpl_qst_type.* FROM qpl_questions, qpl_qst_type WHERE qpl_questions.original_id IS NULL AND qpl_questions.obj_fi = %s AND qpl_questions.tstamp > 0 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
1531 array($this->
getId())
1535 array_push($questions,
$row);
1549 $result = $ilDB->manipulateF(
"UPDATE qpl_questionpool SET questioncount = %s, tstamp = %s WHERE obj_fi = %s",
1550 array(
'integer',
'integer',
'integer'),
1563 global $ilPluginAdmin;
1564 if ($ilPluginAdmin->isActive(
IL_COMP_MODULE,
"TestQuestionPool",
"qst", $a_pname))
1579 global
$ilDB, $ilUser;
1581 $result = $ilDB->queryF(
"SELECT question_id FROM qpl_questions WHERE owner = %s AND tstamp = %s",
1582 array(
"integer",
"integer"),
1583 array($ilUser->getId(), 0)