24 include_once
"./Modules/Survey/classes/inc.SurveyConstants.php";
180 $this->cumulated = array();
183 $this->author = $this->ilias->account->fullname;
186 if ($this->owner == -1)
188 $this->owner = $this->ilias->account->id;
191 $this->survey_id = -1;
192 $this->obligatory = 1;
193 $this->orientation = 0;
194 $this->materials = array();
195 $this->material = array();
196 $this->arrData = array();
197 register_shutdown_function(array(&$this,
'_SurveyQuestion'));
212 $this->complete = ($a_complete) ? 1 : 0;
239 if (strcmp($questionpool_object,
"") != 0)
241 $refwhere = sprintf(
" AND obj_fi = %s",
242 $ilDB->quote($questionpool_object,
'integer')
245 $result = $ilDB->queryF(
"SELECT question_id FROM svy_question WHERE title = %s$refwhere",
249 return (
$result->numRows() > 0) ?
true :
false;
309 $this->survey_id =
$id;
335 if (empty($materials_name))
337 $materials_name = $materials_file;
339 if ((!empty($materials_name))&&(!array_key_exists($materials_name, $this->materials)))
341 $this->materials[$materials_name] = $materials_file;
352 function setMaterialsfile($materials_filename, $materials_tempfilename=
"", $materials_name=
"")
354 if (!empty($materials_filename))
356 include_once
"./Services/Utilities/classes/class.ilUtil.php";
358 if (!file_exists($materialspath))
364 $materialspath.$materials_filename))
366 print
"image not uploaded!!!! ";
370 $this->
addMaterials($materials_filename, $materials_name);
384 foreach ($this->materials as $key => $value)
386 if (strcmp($key, $materials_name)==0)
392 unset($this->materials[$key]);
405 $this->materials = array();
419 $author = $this->ilias->account->fullname;
484 $result = $ilDB->queryF(
"SELECT * FROM svy_qst_oblig WHERE survey_fi = %s AND question_fi = %s",
485 array(
'integer',
'integer'),
491 return (
$row[
"obligatory"]) ? 1 : 0;
495 return ($this->obligatory) ? 1 : 0;
500 return ($this->obligatory) ? 1 : 0;
525 switch ($this->orientation)
532 $this->orientation = 0;
548 return (strlen($this->description)) ? $this->description : NULL;
560 return (strlen($this->author)) ? $this->author : NULL;
584 return (strlen($this->questiontext)) ? $this->questiontext : NULL;
617 if ($this->
getId() <= 0)
624 $original_id = $this->
getId();
640 $clone->saveToDb($original_id);
647 $clone->duplicateMaterials($original_id);
649 $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
650 return $clone->getId();
660 if ($this->
getId() <= 0)
668 $source_questionpool = $this->
getObjId();
669 $clone->setObjId($target_questionpool);
678 $clone->duplicateMaterials($original_id);
680 $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
681 return $clone->getId();
692 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
694 foreach (
$mobs as $mob)
710 $result = $ilDB->queryF(
"SELECT * FROM svy_material WHERE question_fi = %s",
712 array($this->
getId())
714 $this->material = array();
717 include_once
"./Modules/SurveyQuestionPool/classes/class.ilSurveyMaterial.php";
721 $mat->type =
$row[
'material_type'];
722 $mat->internal_link =
$row[
'internal_link'];
723 $mat->title =
$row[
'material_title'];
724 $mat->import_id =
$row[
'import_id'];
725 $mat->text_material =
$row[
'text_material'];
726 $mat->external_link =
$row[
'external_link'];
727 $mat->file_material =
$row[
'file_material'];
728 array_push($this->material, $mat);
743 $result = $ilDB->queryF(
"SELECT complete FROM svy_question WHERE question_id = %s",
750 if (
$row[
"complete"] == 1)
767 $question_id = $this->
getId();
768 if (strlen($original_id))
770 $question_id = $original_id;
773 if ($this->
getId() > 0)
776 $affectedRows = $ilDB->manipulateF(
"UPDATE svy_question SET complete = %s, tstamp = %s WHERE question_id = %s",
777 array(
'text',
'integer',
'integer'),
778 array($this->
isComplete(), time(), $question_id)
794 include_once(
"./Services/RTE/classes/class.ilRTE.php");
797 if ($this->
getId() == -1)
800 $next_id = $ilDB->nextId(
'svy_question');
801 $affectedRows = $ilDB->insert(
"svy_question", array(
802 "question_id" => array(
"integer", $next_id),
804 "obj_fi" => array(
"integer", $this->
getObjId()),
805 "owner_fi" => array(
"integer", $this->
getOwner()),
806 "title" => array(
"text", $this->
getTitle()),
807 "label" => array(
"text", (strlen($this->label)) ? $this->label : null),
809 "author" => array(
"text", $this->
getAuthor()),
812 "complete" => array(
"text", $this->
isComplete()),
813 "created" => array(
"integer", time()),
814 "original_id" => array(
"integer", ($original_id) ? $original_id : NULL),
815 "tstamp" => array(
"integer", time())
817 $this->
setId($next_id);
822 $affectedRows = $ilDB->update(
"svy_question", array(
823 "title" => array(
"text", $this->
getTitle()),
824 "label" => array(
"text", (strlen($this->label)) ? $this->label : null),
826 "author" => array(
"text", $this->
getAuthor()),
829 "complete" => array(
"text", $this->
isComplete()),
830 "tstamp" => array(
"integer", time())
832 "question_id" => array(
"integer", $this->
getId())
837 $set = $ilDB->query(
"SELECT survey_id FROM svy_svy".
838 " WHERE obj_fi = ".$ilDB->quote($this->getObjId(),
"integer"));
839 $survey_fi = $ilDB->fetchAssoc($set);
840 $survey_fi = $survey_fi[
"survey_id"];
845 $set = $ilDB->query(
"SELECT obligatory FROM svy_qst_oblig".
846 " WHERE survey_fi = ".$ilDB->quote($survey_fi,
"integer").
847 " AND question_fi = ".$ilDB->quote($this->
getId(),
"integer"));
848 $has_obligatory_states_entry = (bool)$ilDB->numRows($set);
849 $is_obligatory = $ilDB->fetchAssoc($set);
850 $is_obligatory = (bool)$is_obligatory[
"obligatory"];
854 if($has_obligatory_states_entry)
856 $ilDB->manipulate(
"DELETE FROM svy_qst_oblig".
857 " WHERE survey_fi = ".$ilDB->quote($survey_fi,
"integer").
858 " AND question_fi = ".$ilDB->quote($this->
getId(),
"integer"));
863 if(!$has_obligatory_states_entry)
866 $next_id = $ilDB->nextId(
'svy_qst_oblig');
867 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_qst_oblig (question_obligatory_id, survey_fi, question_fi, " .
868 "obligatory, tstamp) VALUES (%s, %s, %s, %s, %s)",
869 array(
'integer',
'integer',
'integer',
'text',
'integer'),
870 array($next_id, $survey_fi, $this->
getId(), 1, time())
873 else if(!$is_obligatory)
875 $ilDB->manipulate(
"UPDATE svy_qst_oblig".
876 " SET obligatory = ".$ilDB->quote(1,
"integer").
877 " WHERE survey_fi = ".$ilDB->quote($survey_fi,
"integer").
878 " AND question_fi = ".$ilDB->quote($this->
getId(),
"integer"));
883 return $affectedRows;
893 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
894 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_material WHERE question_fi = %s",
896 array($this->
getId())
902 $next_id = $ilDB->nextId(
'svy_material');
903 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_material " .
904 "(material_id, question_fi, internal_link, import_id, material_title, tstamp," .
905 "text_material, external_link, file_material, material_type) ".
906 "VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
907 array(
'integer',
'integer',
'text',
'text',
'text',
'integer',
'text',
'text',
'text',
'integer'),
909 $next_id, $this->
getId(), $material->internal_link, $material->import_id,
910 $material->title, time(), $material->text_material, $material->external_link,
911 $material->file_material, $material->type)
913 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/", $material->internal_link, $matches))
928 global
$ilDB, $ilUser;
933 $next_id = $ilDB->nextId(
'svy_question');
934 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_question (question_id, questiontype_fi, " .
935 "obj_fi, owner_fi, title, description, author, questiontext, obligatory, complete, " .
936 "created, original_id, tstamp) VALUES " .
937 "(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
938 array(
'integer',
'integer',
'integer',
'integer',
'text',
'text',
'text',
'text',
939 'text',
'text',
'integer',
'integer',
'integer'),
956 $this->
setId($next_id);
958 return $this->
getId();
979 return CLIENT_WEB_DIR .
"/survey/$this->obj_id/$this->id/images/";
990 return CLIENT_WEB_DIR .
"/survey/$this->obj_id/$this->id/materials/";
1001 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1014 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1029 global $ilUser,
$ilDB;
1031 $result = $ilDB->queryF(
"SELECT title, category_id FROM svy_category WHERE title = %s AND neutral = %s AND owner_fi = %s",
1032 array(
'text',
'text',
'integer'),
1033 array($categorytext, $neutral, $ilUser->getId())
1042 if (strcmp(
$row[
"title"], $categorytext) == 0)
1044 $returnvalue =
$row[
"category_id"];
1055 $next_id = $ilDB->nextId(
'svy_category');
1056 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_category (category_id, title, neutral, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s)",
1057 array(
'integer',
'text',
'text',
'integer',
'integer'),
1058 array($next_id, $categorytext, $neutral, $ilUser->getId(), time())
1060 $returnvalue = $next_id;
1062 return $returnvalue;
1074 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->getAdditionalTableName() .
" WHERE question_fi = %s",
1086 function delete($question_id)
1090 if ($question_id < 1)
return;
1092 $result = $ilDB->queryF(
"SELECT obj_fi FROM svy_question WHERE question_id = %s",
1106 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_answer WHERE question_fi = %s",
1111 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_constraint WHERE question_fi = %s",
1116 $result = $ilDB->queryF(
"SELECT constraint_fi FROM svy_qst_constraint WHERE question_fi = %s",
1122 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_constraint WHERE constraint_id = %s",
1124 array(
$row->constraint_fi)
1128 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_qst_constraint WHERE question_fi = %s",
1133 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_qblk_qst WHERE question_fi = %s",
1137 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_qst_oblig WHERE question_fi = %s",
1141 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_svy_qst WHERE question_fi = %s",
1145 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_variable WHERE question_fi = %s",
1149 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_question WHERE question_id = %s",
1156 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_material WHERE question_fi = %s",
1160 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
1163 $directory = CLIENT_WEB_DIR .
"/survey/" .
$obj_id .
"/$question_id";
1164 if (preg_match(
"/\d+/",
$obj_id) and preg_match(
"/\d+/", $question_id) and is_dir($directory))
1166 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1170 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1176 foreach(
$mobs as $mob)
1184 $ilDB->manipulate(
"UPDATE svy_question".
1185 " SET original_id = NULL".
1186 " WHERE original_id = ".$ilDB->quote($question_id,
"integer"));
1200 if ($question_id < 1)
return "";
1202 $result = $ilDB->queryF(
"SELECT type_tag FROM svy_question, svy_qtype WHERE svy_question.question_id = %s AND svy_question.questiontype_fi = svy_qtype.questiontype_id",
1209 return $data[
"type_tag"];
1228 if ($question_id < 1)
return "";
1230 $result = $ilDB->queryF(
"SELECT title FROM svy_question WHERE svy_question.question_id = %s",
1237 return $data[
"title"];
1255 $result = $ilDB->queryF(
"SELECT * FROM svy_question WHERE question_id = %s",
1262 if (
$row[
"original_id"] > 0)
1264 return $row[
"original_id"];
1268 return $row[
"question_id"];
1293 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
1294 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_material WHERE question_fi = %s",
1299 if (strlen($this->material[
"internal_link"]))
1301 $next_id = $ilDB->nextId(
'svy_material');
1302 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_material (material_id, question_fi, internal_link, import_id, material_title, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
1303 array(
'integer',
'integer',
'text',
'text',
'text',
'integer'),
1304 array($next_id, $this->
getOriginalId(), $this->material[
"internal_link"], $this->material[
"import_id"], $this->material[
"title"], time())
1306 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/", $this->material[
"internal_link"], $matches))
1324 $result = $ilDB->queryF(
"SELECT title FROM svy_phrase WHERE phrase_id = %s",
1330 return $row[
"title"];
1344 global $ilUser,
$ilDB;
1346 $result = $ilDB->queryF(
"SELECT phrase_id FROM svy_phrase WHERE title = %s AND owner_fi = %s",
1347 array(
'text',
'integer'),
1348 array(
$title, $ilUser->getId())
1350 return (
$result->numRows() == 0) ?
false :
true;
1364 if ($question_id < 1)
1369 $result = $ilDB->queryF(
"SELECT question_id FROM svy_question WHERE question_id = %s",
1373 return (
$result->numRows() == 1) ?
true :
false;
1378 if (strlen($material_id))
1380 if (strcmp($material_title,
"") == 0)
1382 if (preg_match(
"/il__(\w+)_(\d+)/", $material_id, $matches))
1384 $type = $matches[1];
1386 $material_title = $this->lng->txt(
"obj_$type") .
": ";
1390 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1392 $cont_obj = $cont_obj_gui->object;
1393 $material_title .= $cont_obj->getTitle();
1396 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1397 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1399 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1401 $cont_obj = $cont_obj_gui->object;
1403 $material_title .= $pg_obj->getTitle();
1406 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1407 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1409 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1411 $cont_obj = $cont_obj_gui->object;
1413 $material_title .= $st_obj->getTitle();
1416 include_once
"./Modules/Glossary/classes/class.ilGlossaryTerm.php";
1424 include_once
"./Modules/SurveyQuestionPool/classes/class.ilSurveyMaterial.php";
1427 $mat->internal_link = $material_id;
1428 $mat->title = $material_title;
1441 foreach ($a_array as $idx)
1443 unset($this->material[$idx]);
1445 $this->material = array_values($this->material);
1460 $materialspath_original = preg_replace(
"/([^\d])$this->id([^\d])/",
"\${1}$question_id\${2}", $materialspath);
1461 if (!file_exists($materialspath))
1463 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1466 if (!copy($materialspath_original . $filename, $materialspath . $filename))
1468 print
"material could not be duplicated!!!! ";
1475 array_push($this->material, $obj_material);
1485 function setMaterial($material_id =
"", $is_import =
false, $material_title =
"")
1487 if (strcmp($material_id,
"") != 0)
1492 $import_id = $material_id;
1495 if (strcmp($material_title,
"") == 0)
1497 if (preg_match(
"/il__(\w+)_(\d+)/", $material_id, $matches))
1499 $type = $matches[1];
1501 $material_title = $this->lng->txt(
"obj_$type") .
": ";
1505 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1507 $cont_obj = $cont_obj_gui->object;
1508 $material_title .= $cont_obj->getTitle();
1511 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1512 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1514 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1516 $cont_obj = $cont_obj_gui->object;
1518 $material_title .= $pg_obj->getTitle();
1521 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1522 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1524 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1526 $cont_obj = $cont_obj_gui->object;
1528 $material_title .= $st_obj->getTitle();
1531 include_once
"./Modules/Glossary/classes/class.ilGlossaryTerm.php";
1539 $this->material = array(
1540 "internal_link" => $material_id,
1541 "import_id" => $import_id,
1542 "title" => $material_title
1550 if (preg_match(
"/il_(\d+)_(\w+)_(\d+)/", $internal_link, $matches))
1552 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
1553 include_once
"./Modules/LearningModule/classes/class.ilLMObject.php";
1554 include_once
"./Modules/Glossary/classes/class.ilGlossaryTerm.php";
1555 switch ($matches[2])
1573 if (strcmp($resolved_link,
"") == 0)
1575 $resolved_link = $internal_link;
1580 $resolved_link = $internal_link;
1582 return $resolved_link;
1589 $result = $ilDB->queryF(
"SELECT * FROM svy_material WHERE question_fi = %s",
1597 $internal_link =
$row[
"internal_link"];
1598 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1600 if (strcmp($internal_link, $resolved_link) != 0)
1603 $affectedRows = $ilDB->manipulateF(
"UPDATE svy_material SET internal_link = %s, tstamp = %s WHERE material_id = %s",
1604 array(
'text',
'integer',
'integer'),
1605 array($resolved_link, time(),
$row[
"material_id"])
1616 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
1619 $result = $ilDB->queryF(
"SELECT * FROM svy_material WHERE question_fi = %s",
1627 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/",
$row[
"internal_link"], $matches))
1640 "lm" =>
"LearningModule",
1641 "pg" =>
"PageObject",
1642 "st" =>
"StructureObject",
1643 "git" =>
"GlossaryItem",
1644 "mob" =>
"MediaObject"
1647 if (preg_match(
"/il__(\w+)_(\d+)/", $target, $matches))
1649 $type = $matches[1];
1651 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1652 switch($linktypes[$matches[1]])
1654 case "LearningModule":
1658 case "StructureObject":
1661 case "GlossaryItem":
1684 if (($question_id < 1) || ($user_id < 1))
1689 $result = $ilDB->queryF(
"SELECT obj_fi FROM svy_question WHERE question_id = %s",
1696 $qpl_object_id =
$row[
"obj_fi"];
1697 include_once
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
1715 $result = $ilDB->queryF(
"SELECT questiontype_id FROM svy_qtype WHERE type_tag = %s",
1722 return $row[
"questiontype_id"];
1750 $type = $question_type;
1751 if ($gui) $type .=
"GUI";
1752 if (file_exists(
"./Modules/SurveyQuestionPool/classes/class.".$type.
".php"))
1754 include_once
"./Modules/SurveyQuestionPool/classes/class.".$type.
".php";
1759 global $ilPluginAdmin;
1760 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"SurveyQuestionPool",
"svyq");
1761 foreach ($pl_names as $pl_name)
1764 if (strcmp($pl->getQuestionType(), $question_type) == 0)
1766 $pl->includeClass(
"class.".$type.
".php");
1782 if (file_exists(
"./Modules/SurveyQuestionPool/classes/class.".$type_tag.
".php"))
1785 return $lng->txt($type_tag);
1789 global $ilPluginAdmin;
1790 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"SurveyQuestionPool",
"svyq");
1791 foreach ($pl_names as $pl_name)
1794 if (strcmp($pl->getQuestionType(), $type_tag) == 0)
1796 return $pl->getQuestionTypeTranslation();
1815 $question =
new $question_type();
1816 $question->loadFromDb($question_id);
1831 $guitype = $question_type .
"GUI";
1832 $question =
new $guitype($question_id);
1846 if (preg_match(
"/<[^>]*?>/", $a_text))
1866 for ($i = 0; $i < $a_material->getMaterialCount(); $i++)
1868 $material = $a_material->getMaterial($i);
1869 if (strcmp(
$material[
"type"],
"mattext") == 0)
1873 if (strcmp(
$material[
"type"],
"matimage") == 0)
1876 if (preg_match(
"/(il_([0-9]+)_mob_([0-9]+))/", $matimage->getLabel(), $matches))
1879 if (!is_array(
$_SESSION[
"import_mob_xhtml"]))
$_SESSION[
"import_mob_xhtml"] = array();
1880 array_push(
$_SESSION[
"import_mob_xhtml"], array(
"mob" => $matimage->getLabel(),
"uri" => $matimage->getUri()));
1895 function addMaterialTag(&$a_xml_writer, $a_material, $close_material_tag = TRUE, $add_mobs = TRUE, $a_attrs = null)
1897 include_once
"./Services/RTE/classes/class.ilRTE.php";
1898 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1900 $a_xml_writer->xmlStartTag(
"material");
1902 "type" =>
"text/plain"
1904 if ($this->
isHTML($a_material))
1906 $attrs[
"type"] =
"text/xhtml";
1908 if (is_array($a_attrs))
1910 $attrs = array_merge($attrs, $a_attrs);
1917 foreach (
$mobs as $mob)
1921 "label" =>
"il_" . IL_INST_ID .
"_mob_" . $mob,
1922 "uri" =>
"objects/" .
"il_" . IL_INST_ID .
"_mob_" . $mob .
"/" . $mob_obj->getTitle()
1924 $a_xml_writer->xmlElement(
"matimage", $imgattrs, NULL);
1927 if ($close_material_tag) $a_xml_writer->xmlEndTag(
"material");
1938 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1963 switch($a_export_label)
1966 array_push($a_array, $this->label ? $this->label : $this->title);
1970 array_push($a_array, $this->title);
1974 array_push($a_array, $this->label ? $this->title.
' - '.$this->label : $this->title);
2076 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
2078 switch ($export_label)
2097 $worksheet->write(
$row, $column, $eval_data[
"USERS_ANSWERED"]);
2099 $worksheet->write(
$row, $column, $eval_data[
"USERS_SKIPPED"]);
2105 $worksheet->write(
$row, $column, $eval_data[
"MODE_NR_OF_SELECTIONS"]);
2109 $worksheet->write(
$row, $column, $eval_data[
"ARITHMETIC_MEAN"]);
2127 switch ($export_label)
2130 array_push($csvrow, $this->label);
2133 array_push($csvrow, $this->
getTitle());
2136 array_push($csvrow, $this->
getTitle());
2137 array_push($csvrow, $this->label);
2141 array_push($csvrow, $this->lng->txt($eval_data[
"QUESTION_TYPE"]));
2142 array_push($csvrow, $eval_data[
"USERS_ANSWERED"]);
2143 array_push($csvrow, $eval_data[
"USERS_SKIPPED"]);
2144 array_push($csvrow, $eval_data[
"MODE"]);
2145 array_push($csvrow, $eval_data[
"MODE_NR_OF_SELECTIONS"]);
2146 array_push($csvrow, $eval_data[
"MEDIAN"]);
2147 array_push($csvrow, $eval_data[
"ARITHMETIC_MEAN"]);
2241 $this->original_id = $original_id;
2246 return $this->original_id;
2277 if (count($this->cumulated) == 0)
2279 include_once
"./Modules/Survey/classes/class.ilObjSurvey.php";
2281 $this->cumulated =& $this->getCumulatedResults(
$survey_id, $nr_of_users);
2297 include_once
"./Services/Utilities/classes/class.ilStr.php";
2304 'counter' => $counter,
2307 'users_answered' =>
$cumulated[
'USERS_ANSWERED'],
2308 'users_skipped' =>
$cumulated[
'USERS_SKIPPED'],
2309 'question_type' => $this->lng->txt(
$cumulated[
"QUESTION_TYPE"]),
2311 'mode_nr_of_selections' =>
$cumulated[
"MODE_NR_OF_SELECTIONS"],
2313 'arithmetic_mean' =>
$cumulated[
"ARITHMETIC_MEAN"]
2326 if (array_key_exists($value, $this->arrData))
2328 return $this->arrData[$value];
2346 $this->arrData[$key] = $value;
2362 $ilDB->manipulate(
"UPDATE svy_question".
2363 " SET original_id = ".$ilDB->quote($a_original_id,
"integer").
",".
2364 " obj_fi = ".$ilDB->quote($a_object_id,
"integer").
2365 " WHERE question_id = ".$ilDB->quote($a_question_id,
"integer"));
2372 $set = $ilDB->query(
"SELECT q.question_id,s.obj_fi".
2373 " FROM svy_question q".
2374 " JOIN svy_svy_qst sq ON (sq.question_fi = q.question_id)".
2375 " JOIN svy_svy s ON (s.survey_id = sq.survey_fi)".
2376 " WHERE original_id = ".$ilDB->quote($this->getId(),
"integer"));
2378 while(
$row = $ilDB->fetchAssoc($set))
2380 if(!$a_group_by_survey)
2386 $res[
$row[
"obj_fi"]][] = $row[
"question_id"];