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'),
488 if ($result->numRows())
490 $row = $ilDB->fetchAssoc($result);
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();
715 if ($result->numRows())
717 include_once
"./Modules/SurveyQuestionPool/classes/class.ilSurveyMaterial.php";
718 while (
$row = $ilDB->fetchAssoc($result))
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",
747 if ($result->numRows())
749 $row = $ilDB->fetchAssoc($result);
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(
"text", 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())
835 return $affectedRows;
845 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
846 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_material WHERE question_fi = %s",
848 array($this->
getId())
854 $next_id = $ilDB->nextId(
'svy_material');
855 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_material " .
856 "(material_id, question_fi, internal_link, import_id, material_title, tstamp," .
857 "text_material, external_link, file_material, material_type) ".
858 "VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
859 array(
'integer',
'integer',
'text',
'text',
'text',
'integer',
'text',
'text',
'text',
'integer'),
861 $next_id, $this->
getId(), $material->internal_link, $material->import_id,
862 $material->title, time(), $material->text_material, $material->external_link,
863 $material->file_material, $material->type)
865 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/", $material->internal_link, $matches))
880 global
$ilDB, $ilUser;
885 $next_id = $ilDB->nextId(
'svy_question');
886 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_question (question_id, questiontype_fi, " .
887 "obj_fi, owner_fi, title, description, author, questiontext, obligatory, complete, " .
888 "created, original_id, tstamp) VALUES " .
889 "(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
890 array(
'integer',
'integer',
'integer',
'integer',
'text',
'text',
'text',
'text',
891 'text',
'text',
'integer',
'integer',
'integer'),
908 $this->
setId($next_id);
910 return $this->
getId();
931 return CLIENT_WEB_DIR .
"/survey/$this->obj_id/$this->id/images/";
942 return CLIENT_WEB_DIR .
"/survey/$this->obj_id/$this->id/materials/";
953 include_once
"./Services/Utilities/classes/class.ilUtil.php";
966 include_once
"./Services/Utilities/classes/class.ilUtil.php";
981 global $ilUser,
$ilDB;
983 $result = $ilDB->queryF(
"SELECT title, category_id FROM svy_category WHERE title = %s AND neutral = %s AND owner_fi = %s",
984 array(
'text',
'text',
'integer'),
985 array($categorytext, $neutral, $ilUser->getId())
989 if ($result->numRows())
992 while (
$row = $ilDB->fetchAssoc($result))
994 if (strcmp(
$row[
"title"], $categorytext) == 0)
996 $returnvalue =
$row[
"category_id"];
1007 $next_id = $ilDB->nextId(
'svy_category');
1008 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_category (category_id, title, neutral, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s)",
1009 array(
'integer',
'text',
'text',
'integer',
'integer'),
1010 array($next_id, $categorytext, $neutral, $ilUser->getId(), time())
1012 $returnvalue = $next_id;
1014 return $returnvalue;
1026 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->getAdditionalTableName() .
" WHERE question_fi = %s",
1038 function delete($question_id)
1042 if ($question_id < 1)
return;
1044 $result = $ilDB->queryF(
"SELECT obj_fi FROM svy_question WHERE question_id = %s",
1048 if ($result->numRows() == 1)
1050 $row = $ilDB->fetchAssoc($result);
1058 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_answer WHERE question_fi = %s",
1063 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_constraint WHERE question_fi = %s",
1068 $result = $ilDB->queryF(
"SELECT constraint_fi FROM svy_qst_constraint WHERE question_fi = %s",
1072 while (
$row = $ilDB->fetchObject($result))
1074 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_constraint WHERE constraint_id = %s",
1076 array(
$row->constraint_fi)
1080 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_qst_constraint WHERE question_fi = %s",
1085 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_qblk_qst WHERE question_fi = %s",
1089 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_qst_oblig WHERE question_fi = %s",
1093 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_svy_qst WHERE question_fi = %s",
1097 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_variable WHERE question_fi = %s",
1101 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_question WHERE question_id = %s",
1108 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_material WHERE question_fi = %s",
1112 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
1115 $directory = CLIENT_WEB_DIR .
"/survey/" .
$obj_id .
"/$question_id";
1116 if (preg_match(
"/\d+/",
$obj_id) and preg_match(
"/\d+/", $question_id) and is_dir($directory))
1118 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1122 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1128 foreach(
$mobs as $mob)
1147 if ($question_id < 1)
return "";
1149 $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",
1153 if ($result->numRows() == 1)
1155 $data = $ilDB->fetchAssoc($result);
1156 return $data[
"type_tag"];
1175 if ($question_id < 1)
return "";
1177 $result = $ilDB->queryF(
"SELECT title FROM svy_question WHERE svy_question.question_id = %s",
1181 if ($result->numRows() == 1)
1183 $data = $ilDB->fetchAssoc($result);
1184 return $data[
"title"];
1202 $result = $ilDB->queryF(
"SELECT * FROM svy_question WHERE question_id = %s",
1206 if ($result->numRows() > 0)
1208 $row = $ilDB->fetchAssoc($result);
1209 if (
$row[
"original_id"] > 0)
1211 return $row[
"original_id"];
1215 return $row[
"question_id"];
1240 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
1241 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_material WHERE question_fi = %s",
1246 if (strlen($this->material[
"internal_link"]))
1248 $next_id = $ilDB->nextId(
'svy_material');
1249 $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)",
1250 array(
'integer',
'integer',
'text',
'text',
'text',
'integer'),
1251 array($next_id, $this->
getOriginalId(), $this->material[
"internal_link"], $this->material[
"import_id"], $this->material[
"title"], time())
1253 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/", $this->material[
"internal_link"], $matches))
1271 $result = $ilDB->queryF(
"SELECT title FROM svy_phrase WHERE phrase_id = %s",
1275 if (
$row = $ilDB->fetchAssoc($result))
1277 return $row[
"title"];
1291 global $ilUser,
$ilDB;
1293 $result = $ilDB->queryF(
"SELECT phrase_id FROM svy_phrase WHERE title = %s AND owner_fi = %s",
1294 array(
'text',
'integer'),
1295 array(
$title, $ilUser->getId())
1297 return ($result->numRows() == 0) ?
false :
true;
1311 if ($question_id < 1)
1316 $result = $ilDB->queryF(
"SELECT question_id FROM svy_question WHERE question_id = %s",
1320 return ($result->numRows() == 1) ?
true :
false;
1325 if (strlen($material_id))
1327 if (strcmp($material_title,
"") == 0)
1329 if (preg_match(
"/il__(\w+)_(\d+)/", $material_id, $matches))
1331 $type = $matches[1];
1333 $material_title = $this->lng->txt(
"obj_$type") .
": ";
1337 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1339 $cont_obj = $cont_obj_gui->object;
1340 $material_title .= $cont_obj->getTitle();
1343 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1344 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1346 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1348 $cont_obj = $cont_obj_gui->object;
1350 $material_title .= $pg_obj->getTitle();
1353 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1354 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1356 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1358 $cont_obj = $cont_obj_gui->object;
1360 $material_title .= $st_obj->getTitle();
1363 include_once
"./Modules/Glossary/classes/class.ilGlossaryTerm.php";
1371 include_once
"./Modules/SurveyQuestionPool/classes/class.ilSurveyMaterial.php";
1374 $mat->internal_link = $material_id;
1375 $mat->title = $material_title;
1388 foreach ($a_array as $idx)
1390 unset($this->material[$idx]);
1392 $this->material = array_values($this->material);
1407 $materialspath_original = preg_replace(
"/([^\d])$this->id([^\d])/",
"\${1}$question_id\${2}", $materialspath);
1408 if (!file_exists($materialspath))
1410 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1413 if (!copy($materialspath_original . $filename, $materialspath . $filename))
1415 print
"material could not be duplicated!!!! ";
1422 array_push($this->material, $obj_material);
1432 function setMaterial($material_id =
"", $is_import =
false, $material_title =
"")
1434 if (strcmp($material_id,
"") != 0)
1439 $import_id = $material_id;
1442 if (strcmp($material_title,
"") == 0)
1444 if (preg_match(
"/il__(\w+)_(\d+)/", $material_id, $matches))
1446 $type = $matches[1];
1448 $material_title = $this->lng->txt(
"obj_$type") .
": ";
1452 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1454 $cont_obj = $cont_obj_gui->object;
1455 $material_title .= $cont_obj->getTitle();
1458 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1459 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1461 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1463 $cont_obj = $cont_obj_gui->object;
1465 $material_title .= $pg_obj->getTitle();
1468 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1469 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1471 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
1473 $cont_obj = $cont_obj_gui->object;
1475 $material_title .= $st_obj->getTitle();
1478 include_once
"./Modules/Glossary/classes/class.ilGlossaryTerm.php";
1486 $this->material = array(
1487 "internal_link" => $material_id,
1488 "import_id" => $import_id,
1489 "title" => $material_title
1497 if (preg_match(
"/il_(\d+)_(\w+)_(\d+)/", $internal_link, $matches))
1499 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
1500 include_once
"./Modules/LearningModule/classes/class.ilLMObject.php";
1501 include_once
"./Modules/Glossary/classes/class.ilGlossaryTerm.php";
1502 switch ($matches[2])
1520 if (strcmp($resolved_link,
"") == 0)
1522 $resolved_link = $internal_link;
1527 $resolved_link = $internal_link;
1529 return $resolved_link;
1536 $result = $ilDB->queryF(
"SELECT * FROM svy_material WHERE question_fi = %s",
1540 if ($result->numRows())
1542 while (
$row = $ilDB->fetchAssoc($result))
1544 $internal_link =
$row[
"internal_link"];
1545 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1547 if (strcmp($internal_link, $resolved_link) != 0)
1550 $affectedRows = $ilDB->manipulateF(
"UPDATE svy_material SET internal_link = %s, tstamp = %s WHERE material_id = %s",
1551 array(
'text',
'integer',
'integer'),
1552 array($resolved_link, time(),
$row[
"material_id"])
1563 include_once
"./Services/COPage/classes/class.ilInternalLink.php";
1566 $result = $ilDB->queryF(
"SELECT * FROM svy_material WHERE question_fi = %s",
1570 if ($result->numRows())
1572 while (
$row = $ilDB->fetchAssoc($result))
1574 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/",
$row[
"internal_link"], $matches))
1587 "lm" =>
"LearningModule",
1588 "pg" =>
"PageObject",
1589 "st" =>
"StructureObject",
1590 "git" =>
"GlossaryItem",
1591 "mob" =>
"MediaObject"
1594 if (preg_match(
"/il__(\w+)_(\d+)/", $target, $matches))
1596 $type = $matches[1];
1598 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1599 switch($linktypes[$matches[1]])
1601 case "LearningModule":
1605 case "StructureObject":
1608 case "GlossaryItem":
1631 if (($question_id < 1) || ($user_id < 1))
1636 $result = $ilDB->queryF(
"SELECT obj_fi FROM svy_question WHERE question_id = %s",
1640 if ($result->numRows() == 1)
1642 $row = $ilDB->fetchAssoc($result);
1643 $qpl_object_id =
$row[
"obj_fi"];
1644 include_once
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
1662 $result = $ilDB->queryF(
"SELECT questiontype_id FROM svy_qtype WHERE type_tag = %s",
1666 if ($result->numRows() == 1)
1668 $row = $ilDB->fetchAssoc($result);
1669 return $row[
"questiontype_id"];
1697 $type = $question_type;
1698 if ($gui)
$type .=
"GUI";
1699 if (file_exists(
"./Modules/SurveyQuestionPool/classes/class.".
$type.
".php"))
1701 include_once
"./Modules/SurveyQuestionPool/classes/class.".$type.
".php";
1706 global $ilPluginAdmin;
1707 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"SurveyQuestionPool",
"svyq");
1708 foreach ($pl_names as $pl_name)
1711 if (strcmp($pl->getQuestionType(), $question_type) == 0)
1713 $pl->includeClass(
"class.".
$type.
".php");
1729 if (file_exists(
"./Modules/SurveyQuestionPool/classes/class.".$type_tag.
".php"))
1732 return $lng->txt($type_tag);
1736 global $ilPluginAdmin;
1737 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
"SurveyQuestionPool",
"svyq");
1738 foreach ($pl_names as $pl_name)
1741 if (strcmp($pl->getQuestionType(), $type_tag) == 0)
1743 return $pl->getQuestionTypeTranslation();
1762 $question =
new $question_type();
1763 $question->loadFromDb($question_id);
1778 $guitype = $question_type .
"GUI";
1779 $question =
new $guitype($question_id);
1793 if (preg_match(
"/<[^>]*?>/", $a_text))
1813 for ($i = 0; $i < $a_material->getMaterialCount(); $i++)
1815 $material = $a_material->getMaterial($i);
1816 if (strcmp(
$material[
"type"],
"mattext") == 0)
1818 $result .=
$material[
"material"]->getContent();
1820 if (strcmp(
$material[
"type"],
"matimage") == 0)
1823 if (preg_match(
"/(il_([0-9]+)_mob_([0-9]+))/", $matimage->getLabel(), $matches))
1826 if (!is_array(
$_SESSION[
"import_mob_xhtml"]))
$_SESSION[
"import_mob_xhtml"] = array();
1827 array_push(
$_SESSION[
"import_mob_xhtml"], array(
"mob" => $matimage->getLabel(),
"uri" => $matimage->getUri()));
1842 function addMaterialTag(&$a_xml_writer, $a_material, $close_material_tag = TRUE, $add_mobs = TRUE, $a_attrs = null)
1844 include_once
"./Services/RTE/classes/class.ilRTE.php";
1845 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1847 $a_xml_writer->xmlStartTag(
"material");
1849 "type" =>
"text/plain"
1851 if ($this->
isHTML($a_material))
1853 $attrs[
"type"] =
"text/xhtml";
1855 if (is_array($a_attrs))
1857 $attrs = array_merge($attrs, $a_attrs);
1864 foreach (
$mobs as $mob)
1868 "label" =>
"il_" . IL_INST_ID .
"_mob_" . $mob,
1869 "uri" =>
"objects/" .
"il_" . IL_INST_ID .
"_mob_" . $mob .
"/" . $mob_obj->getTitle()
1871 $a_xml_writer->xmlElement(
"matimage", $imgattrs, NULL);
1874 if ($close_material_tag) $a_xml_writer->xmlEndTag(
"material");
1885 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1910 switch($a_export_label)
1913 array_push($a_array, $this->label ? $this->label : $this->title);
1917 array_push($a_array, $this->title);
1921 array_push($a_array, $this->label ? $this->title.
' - '.$this->label : $this->title);
2021 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
2023 switch ($export_label)
2026 $adapter->setCellValue(
$row, $column, $this->label);
2029 $adapter->setCellValue(
$row, $column, $this->
getTitle());
2032 $adapter->setCellValue(
$row, $column, $this->
getTitle());
2034 $adapter->setCellValue(
$row, $column, $this->label);
2040 $adapter->setCellValue(
$row, $column, $this->lng->txt($eval_data[
"QUESTION_TYPE"]));
2042 $adapter->setCellValue(
$row, $column, $eval_data[
"USERS_ANSWERED"]);
2044 $adapter->setCellValue(
$row, $column, $eval_data[
"USERS_SKIPPED"]);
2046 $adapter->setCellValue(
$row, $column, $eval_data[
"MODE_VALUE"]);
2048 $adapter->setCellValue(
$row, $column, $eval_data[
"MODE"]);
2050 $adapter->setCellValue(
$row, $column, $eval_data[
"MODE_NR_OF_SELECTIONS"]);
2052 $adapter->setCellValue(
$row, $column, str_replace(
"<br />",
" ", $eval_data[
"MEDIAN"]));
2054 $adapter->setCellValue(
$row, $column, $eval_data[
"ARITHMETIC_MEAN"]);
2072 switch ($export_label)
2075 array_push($csvrow, $this->label);
2078 array_push($csvrow, $this->
getTitle());
2081 array_push($csvrow, $this->
getTitle());
2082 array_push($csvrow, $this->label);
2086 array_push($csvrow, $this->lng->txt($eval_data[
"QUESTION_TYPE"]));
2087 array_push($csvrow, $eval_data[
"USERS_ANSWERED"]);
2088 array_push($csvrow, $eval_data[
"USERS_SKIPPED"]);
2089 array_push($csvrow, $eval_data[
"MODE"]);
2090 array_push($csvrow, $eval_data[
"MODE_NR_OF_SELECTIONS"]);
2091 array_push($csvrow, $eval_data[
"MEDIAN"]);
2092 array_push($csvrow, $eval_data[
"ARITHMETIC_MEAN"]);
2094 array_push($result, $csvrow);
2184 $this->original_id = $original_id;
2189 return $this->original_id;
2220 if (count($this->cumulated) == 0)
2222 include_once
"./Modules/Survey/classes/class.ilObjSurvey.php";
2224 $this->cumulated =& $this->getCumulatedResults(
$survey_id, $nr_of_users);
2239 include_once
"./Services/Utilities/classes/class.ilStr.php";
2245 'counter' => $counter,
2248 'users_answered' =>
$cumulated[
'USERS_ANSWERED'],
2249 'users_skipped' =>
$cumulated[
'USERS_SKIPPED'],
2250 'question_type' => $this->lng->txt(
$cumulated[
"QUESTION_TYPE"]),
2252 'mode_nr_of_selections' =>
$cumulated[
"MODE_NR_OF_SELECTIONS"],
2254 'arithmetic_mean' =>
$cumulated[
"ARITHMETIC_MEAN"]
2267 if (array_key_exists($value, $this->arrData))
2269 return $this->arrData[$value];
2287 $this->arrData[$key] = $value;