66 $this->
user = $DIC->user();
67 $this->db =
$DIC->database();
73 $this->bipolar_adjective1 =
"";
74 $this->bipolar_adjective2 =
"";
75 $this->rowSeparators = 0;
76 $this->columnSeparators = 0;
77 $this->neutralColumnSeparator = 1;
82 return $this->columns->getCategoryCount();
87 $this->columns->removeCategory($index);
95 $this->columns->removeCategories($array);
100 $this->columns->removeCategoryWithName($name);
110 return $this->columns->getCategory($index);
115 return $this->columns->getCategoryForScale($scale);
120 return $this->columns->getCategoryIndex($name);
125 $this->columns->flushCategories();
130 return $this->rows->getCategoryCount();
138 $this->rows->addCategory($a_text, (
int) $a_other, 0, $a_label);
146 $this->rows->addCategoryAtPosition($a_text, $a_position, $a_other);
156 return $this->rows->getCategory($a_index);
161 $this->rows->moveCategoryUp($index);
166 $this->rows->moveCategoryDown($index);
174 $this->rows->removeCategories($array);
179 $this->rows->removeCategory($index);
188 if ($a_index === 1) {
189 return $this->bipolar_adjective2;
191 return $this->bipolar_adjective1;
198 if ($a_index === 1) {
199 $this->bipolar_adjective2 = $a_value;
201 $this->bipolar_adjective1 = $a_value;
212 $result =
$ilDB->queryF(
213 "SELECT svy_question.*, " . $this->getAdditionalTableName() .
".* FROM svy_question, " . $this->getAdditionalTableName() .
" WHERE svy_question.question_id = %s AND svy_question.question_id = " . $this->getAdditionalTableName() .
".question_fi",
217 if ($result->numRows() === 1) {
218 return $ilDB->fetchAssoc($result);
227 $result =
$ilDB->queryF(
228 "SELECT svy_question.*, " . $this->getAdditionalTableName() .
".* FROM svy_question LEFT JOIN " . $this->getAdditionalTableName() .
" ON " . $this->getAdditionalTableName() .
".question_fi = svy_question.question_id WHERE svy_question.question_id = %s",
232 if ($result->numRows() === 1) {
234 $this->setId((
int)
$data[
"question_id"]);
235 $this->setTitle((
string)
$data[
"title"]);
236 $this->label = (string)
$data[
'label'];
237 $this->setDescription((
string)
$data[
"description"]);
238 $this->setObjId((
int)
$data[
"obj_fi"]);
239 $this->setAuthor((
string)
$data[
"author"]);
240 $this->setOwner((
int)
$data[
"owner_fi"]);
242 $this->setObligatory((
bool)
$data[
"obligatory"]);
243 $this->setComplete((
bool)
$data[
"complete"]);
244 $this->setOriginalId((
int)
$data[
"original_id"]);
245 $this->setSubtype((
int)
$data[
"subtype"]);
246 $this->setRowSeparators((
bool)
$data[
"row_separators"]);
247 $this->setNeutralColumnSeparator((
bool)
$data[
"neutral_column_separator"]);
248 $this->setColumnSeparators((
bool)
$data[
"column_separators"]);
249 $this->setColumnPlaceholders((
bool)
$data[
"column_placeholders"]);
250 $this->setLegend((
bool)
$data[
"legend"]);
251 $this->setSingleLineRowCaption((
string)
$data[
"singleline_row_caption"]);
252 $this->setRepeatColumnHeader((
bool)
$data[
"repeat_column_header"]);
253 $this->setBipolarAdjective(0, (
string)
$data[
"bipolar_adjective1"]);
254 $this->setBipolarAdjective(1, (
string)
$data[
"bipolar_adjective2"]);
255 $this->setLayout(
$data[
"layout"]);
256 $this->flushColumns();
258 $result =
$ilDB->queryF(
259 "SELECT svy_variable.*, svy_category.title, svy_category.neutral FROM svy_variable, svy_category WHERE svy_variable.question_fi = %s AND svy_variable.category_fi = svy_category.category_id ORDER BY sequence ASC",
263 if ($result->numRows() > 0) {
265 $this->columns->addCategory(
$data[
"title"], (
int)
$data[
"other"], (
int)
$data[
"neutral"],
null, (
$data[
'scale']) ?: (
$data[
'sequence'] + 1));
269 $result =
$ilDB->queryF(
270 "SELECT * FROM svy_qst_matrixrows WHERE question_fi = %s ORDER BY sequence",
274 while ($row =
$ilDB->fetchAssoc($result)) {
275 $this->addRow((
string) $row[
"title"], (
string) $row[
'other'], (
string) ($row[
'label'] ??
""));
278 parent::loadFromDb($question_id);
285 $this->getAuthor() !==
'' &&
286 $this->getQuestiontext() !==
'' &&
287 $this->getColumnCount() &&
296 $affectedRows = parent::saveToDb($original_id);
298 if ($affectedRows === 1) {
300 "DELETE FROM " . $this->getAdditionalTableName() .
" WHERE question_fi = %s",
302 array($this->
getId())
305 "INSERT INTO " . $this->getAdditionalTableName() .
" (
306 question_fi, subtype, column_separators, row_separators, neutral_column_separator,column_placeholders,
307 legend, singleline_row_caption, repeat_column_header,
308 bipolar_adjective1, bipolar_adjective2, layout, tstamp)
309 VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
311 'integer',
'integer',
'text',
'text',
'text',
'integer',
'text',
'text',
'text',
312 'text',
'text',
'text',
'integer'
317 $this->getColumnSeparators(),
318 $this->getRowSeparators(),
319 $this->getNeutralColumnSeparator(),
320 $this->getColumnPlaceholders(),
322 $this->getSingleLineRowCaption(),
323 $this->getRepeatColumnHeader(),
324 $this->getBipolarAdjective(0),
325 $this->getBipolarAdjective(1),
326 serialize($this->getLayout()),
331 $this->saveColumnsToDb();
332 $this->saveRowsToDb();
334 return $affectedRows;
344 "UPDATE " . $this->getAdditionalTableName() .
" SET bipolar_adjective1 = %s, bipolar_adjective2 = %s WHERE question_fi = %s",
345 array(
'text',
'text',
'integer'),
346 array(($adjective1 !==
'') ? $adjective1 :
null, ($adjective2 !==
'') ? $adjective2 :
null, $this->
getId())
354 $ilUser = $this->
user;
357 $result =
$ilDB->queryF(
358 "SELECT title, category_id FROM svy_category WHERE title = %s AND neutral = %s AND owner_fi = %s",
359 array(
'text',
'text',
'integer'),
360 array($columntext, $neutral, $ilUser->getId())
365 if ($result->numRows()) {
366 while ($row =
$ilDB->fetchAssoc($result)) {
367 if (strcmp($row[
"title"] ??
'', $columntext) === 0) {
368 $returnvalue = $row[
"category_id"];
374 $next_id =
$ilDB->nextId(
'svy_category');
375 $affectedRows =
$ilDB->manipulateF(
376 "INSERT INTO svy_category (category_id, title, defaultvalue, owner_fi, neutral, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
377 array(
'integer',
'text',
'text',
'integer',
'text',
'integer'),
378 array($next_id, $columntext, 0, $ilUser->getId(), $neutral, time())
380 $returnvalue = $next_id;
391 $question_id = $this->
getId();
392 if ($original_id > 0) {
393 $question_id = $original_id;
397 $affectedRows =
$ilDB->manipulateF(
398 "DELETE FROM svy_variable WHERE question_fi = %s",
403 for ($i = 0; $i < $this->getColumnCount(); $i++) {
404 $cat = $this->getColumn($i);
405 $column_id = $this->saveColumnToDb($cat->title, $cat->neutral);
406 $next_id =
$ilDB->nextId(
'svy_variable');
407 $affectedRows =
$ilDB->manipulateF(
408 "INSERT INTO svy_variable (variable_id, category_fi, question_fi, value1, other, sequence, scale, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
409 array(
'integer',
'integer',
'integer',
'float',
'integer',
'integer',
'integer',
'integer'),
410 array($next_id, $column_id, $question_id, ($i + 1), $cat->other, $i, ($cat->scale > 0) ? $cat->scale :
null, time())
413 $this->saveCompletionStatus($original_id);
422 $question_id = $this->
getId();
423 if ($original_id > 0) {
424 $question_id = $original_id;
428 $affectedRows =
$ilDB->manipulateF(
429 "DELETE FROM svy_qst_matrixrows WHERE question_fi = %s",
434 for ($i = 0; $i < $this->getRowCount(); $i++) {
435 $row = $this->getRow($i);
436 $next_id =
$ilDB->nextId(
'svy_qst_matrixrows');
437 $affectedRows =
$ilDB->manipulateF(
438 "INSERT INTO svy_qst_matrixrows (id_svy_qst_matrixrows, title, label, other, sequence, question_fi) VALUES (%s, %s, %s, %s, %s, %s)",
439 array(
'integer',
'text',
'text',
'integer',
'integer',
'integer'),
440 array($next_id, $row->title, $row->label, ($row->other) ? 1 : 0, $i, $question_id)
443 $this->saveCompletionStatus($original_id);
453 bool $a_include_header =
true,
454 bool $obligatory_state =
false
458 $this->insertXML($a_xml_writer, $a_include_header);
459 $xml = $a_xml_writer->xmlDumpMem(
false);
460 if (!$a_include_header) {
461 $pos = strpos($xml,
"?>");
462 $xml = substr($xml, $pos + 2);
472 bool $a_include_header =
true
475 "id" => $this->
getId(),
477 "type" => $this->getQuestionType(),
478 "subtype" => $this->getSubtype(),
479 "obligatory" => $this->getObligatory()
483 $a_xml_writer->
xmlElement(
"description",
null, $this->getDescription());
484 $a_xml_writer->
xmlElement(
"author",
null, $this->getAuthor());
486 $this->addMaterialTag($a_xml_writer, $this->getQuestiontext());
487 $a_xml_writer->
xmlEndTag(
"questiontext");
491 for ($i = 0; $i < $this->getRowCount(); $i++) {
495 if (strlen($this->getRow($i)->label ??
"")) {
496 $attrs[
'label'] = $this->getRow($i)->label;
498 if ($this->getRow($i)->other) {
502 $this->addMaterialTag($a_xml_writer, $this->getRow($i)->title);
508 if ($this->getBipolarAdjective(0) !==
'' && ($this->getBipolarAdjective(1) !==
'')) {
513 $a_xml_writer->
xmlElement(
"adjective", $attribs, $this->getBipolarAdjective(0));
517 $a_xml_writer->
xmlElement(
"adjective", $attribs, $this->getBipolarAdjective(1));
518 $a_xml_writer->
xmlEndTag(
"bipolar_adjectives");
520 for ($i = 0; $i < $this->getColumnCount(); $i++) {
524 if ($this->getColumn($i)->neutral) {
525 $attrs[
'label'] =
'neutral';
527 switch ($this->getSubtype()) {
529 $a_xml_writer->
xmlStartTag(
"response_single", $attrs);
532 $a_xml_writer->
xmlStartTag(
"response_multiple", $attrs);
535 $this->addMaterialTag($a_xml_writer, $this->getColumn($i)->title);
536 switch ($this->getSubtype()) {
538 $a_xml_writer->
xmlEndTag(
"response_single");
541 $a_xml_writer->
xmlEndTag(
"response_multiple");
549 if (count($this->material)) {
550 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/", $this->material[
"internal_link"], $matches)) {
552 "label" => $this->material[
"title"]
555 $intlink =
"il_" .
IL_INST_ID .
"_" . $matches[2] .
"_" . $matches[3];
556 if (strcmp($matches[1],
"") !== 0) {
557 $intlink = $this->material[
"internal_link"];
559 $a_xml_writer->
xmlElement(
"mattext",
null, $intlink);
566 $a_xml_writer->
xmlElement(
"fieldlabel",
null,
"column_separators");
567 $a_xml_writer->
xmlElement(
"fieldentry",
null, $this->getColumnSeparators());
568 $a_xml_writer->
xmlEndTag(
"metadatafield");
571 $a_xml_writer->
xmlElement(
"fieldlabel",
null,
"row_separators");
572 $a_xml_writer->
xmlElement(
"fieldentry",
null, $this->getRowSeparators());
573 $a_xml_writer->
xmlEndTag(
"metadatafield");
576 $a_xml_writer->
xmlElement(
"fieldlabel",
null,
"neutral_column_separator");
577 $a_xml_writer->
xmlElement(
"fieldentry",
null, $this->getNeutralColumnSeparator());
578 $a_xml_writer->
xmlEndTag(
"metadatafield");
581 $a_xml_writer->
xmlElement(
"fieldlabel",
null,
"layout");
582 $a_xml_writer->
xmlElement(
"fieldentry",
null, serialize($this->getLayout()));
583 $a_xml_writer->
xmlEndTag(
"metadatafield");
592 if ($this->getOriginalId()) {
593 parent::syncWithOriginal();
594 $this->saveColumnsToDb($this->getOriginalId());
595 $this->saveRowsToDb($this->getOriginalId());
606 for ($i = $lower_limit; $i <= $upper_limit; $i++) {
607 $this->columns->addCategory($i);
614 return "SurveyMatrixQuestion";
622 return "svy_qst_matrix";
628 foreach ($post_data as $key => $value) {
629 switch ($this->getSubtype()) {
632 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches)) {
633 if (is_array($value)) {
634 foreach ($value as $val) {
635 $data[] = array(
"value" => $val,
636 "rowvalue" => $matches[1],
637 "textanswer" => $post_data[
'matrix_other_' . $this->
getId(
638 ) .
'_' . $matches[1]] ??
""
642 $data[] = array(
"value" => $value,
643 "rowvalue" => $matches[1],
644 "textanswer" => $post_data[
'matrix_other_' . $this->
getId(
645 ) .
'_' . $matches[1]] ??
""
664 if (!$this->getObligatory()) {
667 switch ($this->getSubtype()) {
670 foreach ($post_data as $key => $value) {
671 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches)) {
672 if (array_key_exists(
'matrix_other_' . $this->
getId() .
"_" . $matches[1], $post_data) && strlen($post_data[
'matrix_other_' . $this->
getId() .
"_" . $matches[1]] ??
"") == 0) {
673 return $this->
lng->txt(
"question_mr_no_other_answer");
678 if (
$counter !== $this->getRowCount()) {
679 return $this->
lng->txt(
"matrix_question_radio_button_not_checked");
684 foreach ($post_data as $key => $value) {
685 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches)) {
686 if (array_key_exists(
'matrix_other_' . $this->
getId() .
"_" . $matches[1], $post_data) && strlen($post_data[
'matrix_other_' . $this->
getId() .
"_" . $matches[1]] ??
"") == 0) {
687 return $this->
lng->txt(
"question_mr_no_other_answer");
690 if ((!is_array($value)) || (count($value) < 1)) {
691 return $this->
lng->txt(
"matrix_question_checkbox_not_checked");
695 if (
$counter !== $this->getRowCount()) {
696 return $this->
lng->txt(
"matrix_question_checkbox_not_checked");
706 bool $a_return =
false
710 $answer_data = array();
713 switch ($this->getSubtype()) {
715 foreach ($post_data as $key => $value) {
716 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches)) {
717 if (strlen($value ??
"")) {
718 $other_value = (array_key_exists(
'matrix_other_' . $this->
getId() .
'_' . $matches[1], $post_data))
719 ? $this->stripSlashesAddSpaceFallback($post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]])
721 $answer_data[] = array(
"value" => $value,
722 "textanswer" => $other_value,
723 "rowvalue" => $matches[1]);
730 foreach ($post_data as $key => $value) {
731 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches)) {
732 $other_value = (array_key_exists(
'matrix_other_' . $this->
getId() .
'_' . $matches[1], $post_data))
733 ? $this->stripSlashesAddSpaceFallback($post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]])
735 foreach ($value as $checked) {
736 $answer_data[] = array(
"value" => $checked,
737 "textanswer" => $other_value,
738 "rowvalue" => $matches[1]);
750 if (count($answer_data)) {
752 foreach ($answer_data as $item) {
753 $next_id =
$ilDB->nextId(
'svy_answer');
756 $fields[
'answer_id'] = array(
"integer", $next_id);
757 $fields[
'question_fi'] = array(
"integer", $this->
getId());
758 $fields[
'active_fi'] = array(
"integer", $active_id);
759 $fields[
'value'] = array(
"float", $item[
'value']);
760 $fields[
'textanswer'] = array(
"clob", $item[
'textanswer']);
761 $fields[
'rowvalue'] = array(
"integer", $item[
'rowvalue']);
762 $fields[
'tstamp'] = array(
"integer", time());
764 $affectedRows =
$ilDB->insert(
"svy_answer", $fields);
776 parent::deleteAdditionalTableData($question_id);
780 "DELETE FROM svy_qst_matrixrows WHERE question_fi = %s",
791 return $this->subtype;
799 switch ($a_subtype) {
806 $this->subtype = $a_subtype;
820 $this->columnSeparators = $enable;
825 return $this->columnSeparators;
833 $this->rowSeparators = $enable;
838 return $this->rowSeparators;
843 $this->neutralColumnSeparator = $enable;
848 return $this->neutralColumnSeparator;
856 foreach ($a_meta as $key => $value) {
857 switch ($value[
"label"]) {
858 case "column_separators":
859 $this->setColumnSeparators($value[
"entry"]);
861 case "row_separators":
862 $this->setRowSeparators($value[
"entry"]);
865 $this->setLayout($value[
"entry"]);
867 case "neutral_column_separator":
868 $this->setNeutralColumnSeparator($value[
"entry"]);
880 foreach ($a_data as $adjective) {
881 if (is_numeric($adjective[
"label"])) {
882 $this->setBipolarAdjective($adjective[
"label"], $adjective[
"text"]);
884 $this->setBipolarAdjective($i, $adjective[
"text"]);
896 foreach ($a_data as $row) {
897 $this->addRow($row[
'title'], $row[
'other'], $row[
'label']);
908 foreach (
$data[
"material"] as $material) {
909 $column .= $material[
"text"];
911 $this->columns->addCategory($column, 0, strcmp(
$data[
"label"],
"neutral") == 0);
940 $options = $this->getPreconditionOptions();
941 $step3->setOptions($options);
942 $step3->setValue($default);
957 float $percent_columns,
958 float $percent_bipolar_adjective1 = 0,
959 float $percent_bipolar_adjective2 = 0,
960 float $percent_neutral = 0
965 "percent_row" => $percent_row,
966 "percent_columns" => $percent_columns,
967 "percent_bipolar_adjective1" => $percent_bipolar_adjective1,
968 "percent_bipolar_adjective2" => $percent_bipolar_adjective2,
969 "percent_neutral" => $percent_neutral
971 $affectedRows =
$ilDB->manipulateF(
972 "UPDATE " . $this->getAdditionalTableName() .
" SET layout = %s WHERE question_fi = %s",
973 array(
'text',
'integer'),
974 array(serialize($layout), $this->
getId())
980 if (count($this->layout) === 0) {
981 if ($this->hasBipolarAdjectives() && $this->hasNeutralColumn()) {
982 $this->layout = array(
984 "percent_columns" => 40,
985 "percent_bipolar_adjective1" => 10,
986 "percent_bipolar_adjective2" => 10,
987 "percent_neutral" => 10
989 } elseif ($this->hasBipolarAdjectives()) {
990 $this->layout = array(
992 "percent_columns" => 50,
993 "percent_bipolar_adjective1" => 10,
994 "percent_bipolar_adjective2" => 10,
995 "percent_neutral" => 0
997 } elseif ($this->hasNeutralColumn()) {
998 $this->layout = array(
1000 "percent_columns" => 50,
1001 "percent_bipolar_adjective1" => 0,
1002 "percent_bipolar_adjective2" => 0,
1003 "percent_neutral" => 20
1006 $this->layout = array(
1007 "percent_row" => 30,
1008 "percent_columns" => 70,
1009 "percent_bipolar_adjective1" => 0,
1010 "percent_bipolar_adjective2" => 0,
1011 "percent_neutral" => 0
1015 return $this->layout;
1023 if (is_array($layout)) {
1024 $this->layout = $layout;
1026 $this->layout = unserialize((
string) $layout, [
'allowed_classes' =>
false]) ?: [];
1035 return $this->getBipolarAdjective(0) !==
'' && $this->getBipolarAdjective(1) !==
'';
1043 for ($i = 0; $i < $this->getColumnCount(); $i++) {
1044 $column = $this->getColumn($i);
1045 if ($column->neutral && strlen($column->title ??
"")) {
1057 $this->columnPlaceholders = $a_value;
1062 return $this->columnPlaceholders;
1070 $this->legend = $a_value;
1075 return $this->legend;
1080 $this->singleLineRowCaption = $a_value;
1085 return $this->singleLineRowCaption;
1090 $this->repeatColumnHeader = $a_value;
1095 return $this->repeatColumnHeader;
1109 $db =
$DIC->database();
1112 "SELECT MAX(scale) max_sum_score, q.question_id FROM svy_svy_qst sq " .
1113 "JOIN svy_question q ON (sq.question_fi = q.question_id) " .
1114 "JOIN svy_variable v ON (v.question_fi = q.question_id) " .
1115 "WHERE sq.survey_fi = %s AND q.questiontype_fi = %s " .
1116 "GROUP BY (q.question_id)",
1117 [
"integer",
"integer"],
1121 while ($rec = $db->fetchAssoc($set)) {
1122 $max_score[$rec[
"question_id"]] = $rec[
"max_sum_score"];
1126 "SELECT COUNT(mr.id_svy_qst_matrixrows) cnt_rows, q.question_id FROM svy_svy_qst sq " .
1127 "JOIN svy_question q ON (sq.question_fi = q.question_id) " .
1128 "JOIN svy_qst_matrixrows mr ON (mr.question_fi = q.question_id) " .
1129 "WHERE sq.survey_fi = %s AND q.questiontype_fi = %s " .
1130 "GROUP BY (q.question_id)",
1131 [
"integer",
"integer"],
1135 while ($rec = $db->fetchAssoc($set)) {
1136 $cnt_rows[$rec[
"question_id"]] = $rec[
"cnt_rows"];
1140 foreach ($max_score as $qid => $s) {
1141 $sum_sum_score += $s * $cnt_rows[$qid];
1144 return $sum_sum_score;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRepeatColumnHeader(bool $a_value=false)
hasNeutralColumn()
Returns TRUE if a neutral column exists.
removeColumnWithName(string $name)
int $subtype
Matrix question subtype 0 = Single choice 1 = Multiple choice 2 = Text 3 = Integer 4 = Double 5 = Dat...
__construct(string $title="", string $description="", string $author="", string $questiontext="", int $owner=-1)
saveRowsToDb(int $original_id=0)
getAdditionalTableName()
Returns the name of the additional question data table in the database.
importAdjectives(array $a_data)
Import bipolar adjectives from the question import file.
setBipolarAdjective(int $a_index, string $a_value)
setLegend(bool $a_value=false)
Set whether the legend should be shown or not.
getWorkingDataFromUserInput(array $post_data)
Creates the user data of the svy_answer table from the POST data.
saveColumnsToDb(int $original_id=0)
getPreconditionSelectValue(string $default, string $title, string $variable)
Creates a form property for the precondition value.
getQuestionDataArray(int $id)
Returns the question data fields from the database.
SurveyCategories $columns
setRowSeparators(bool $enable=false)
Enables/Disables separators for the matrix rows.
setColumnSeparators(bool $enable=false)
Enables/Disables separators for the matrix columns.
getSubtype()
Returns the subtype of the matrix question.
toXML(bool $a_include_header=true, bool $obligatory_state=false)
Returns an xml representation of the question.
saveToDb(int $original_id=0)
Saves a SurveyQuestion object to a database.
getNeutralColumnSeparator()
saveColumnToDb(string $columntext, int $neutral=0)
setSingleLineRowCaption(bool $a_value=false)
bool $neutralColumnSeparator
importResponses(array $a_data)
Import response data from the question import file.
addRow(string $a_text, string $a_other, string $a_label)
usableForPrecondition()
Returns if the question is usable for preconditions.
checkUserInput(array $post_data, int $survey_id)
Checks the input of the active user for obligatory status and entered values.
saveBipolarAdjectives(string $adjective1, string $adjective2)
saveUserInput(array $post_data, int $active_id, bool $a_return=false)
getSingleLineRowCaption()
insertXML(ilXmlWriter $a_xml_writer, bool $a_include_header=true)
Adds the question XML to a given XMLWriter object.
importAdditionalMetadata(array $a_meta)
Import additional meta data from the question import file.
loadFromDb(int $question_id)
load question data into object note: this base implementation only loads the material data
removeColumns(array $array)
addStandardNumbers(int $lower_limit, int $upper_limit)
Adds standard numbers as columns.
getBipolarAdjective(int $a_index)
Returns one of the bipolar adjectives.
importMatrix(array $a_data)
Import matrix rows from the question import file.
hasBipolarAdjectives()
Returns TRUE if bipolar adjectives exist.
getColumnForScale(int $scale)
getPreconditionValueOutput(string $value)
Returns the output for a precondition value.
setColumnPlaceholders(bool $a_value=false)
Set whether placeholders should be used for the column titles or not.
deleteAdditionalTableData(int $question_id)
Delete question data from additional table.
string $bipolar_adjective1
saveLayout(float $percent_row, float $percent_columns, float $percent_bipolar_adjective1=0, float $percent_bipolar_adjective2=0, float $percent_neutral=0)
Saves the layout of a matrix question.
bool $singleLineRowCaption
static getMaxSumScore(int $survey_id)
Get max sum score for specific survey (and this question type)
setSubtype(int $a_subtype=0)
Sets the subtype of the matrix question.
getColumnIndex(string $name)
addRowAtPosition(string $a_text, string $a_other, int $a_position)
setNeutralColumnSeparator(bool $enable=true)
string $bipolar_adjective2
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlHeader()
Writes xml header.
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))