24 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
163 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyCategories.php";
166 $this->bipolar_adjective1 =
"";
167 $this->bipolar_adjective2 =
"";
168 $this->rowSeparators = 0;
169 $this->columnSeparators = 0;
170 $this->neutralColumnSeparator = 1;
182 return $this->
columns->getCategoryCount();
194 $this->
columns->removeCategory($index);
206 $this->
columns->removeCategories($array);
218 $this->
columns->removeCategoryWithName($name);
239 return $this->
columns->getCategory($index);
244 return $this->
columns->getCategoryForScale($scale);
256 return $this->
columns->getCategoryIndex($name);
268 $this->
columns->flushCategories();
279 return $this->
rows->getCategoryCount();
287 function addRow($a_text, $a_other, $a_label)
289 $this->
rows->addCategory($a_text, $a_other, 0, $a_label);
300 $this->
rows->addCategoryAtPosition($a_text, $a_position, $a_other);
322 return $this->
rows->getCategory($a_index);
327 $this->
rows->moveCategoryUp($index);
332 $this->
rows->moveCategoryDown($index);
344 $this->
rows->removeCategories($array);
354 $this->
rows->removeCategory($index);
369 return (strlen($this->bipolar_adjective2)) ? $this->bipolar_adjective2 : NULL;
373 return (strlen($this->bipolar_adjective1)) ? $this->bipolar_adjective1 : NULL;
391 $this->bipolar_adjective2 = $a_value;
395 $this->bipolar_adjective1 = $a_value;
411 $result = $ilDB->queryF(
"SELECT svy_category.* FROM svy_category, svy_phrase_cat WHERE svy_phrase_cat.category_fi = svy_category.category_id AND svy_phrase_cat.phrase_fi = %s AND (svy_category.owner_fi = %s OR svy_category.owner_fi = %s) ORDER BY svy_phrase_cat.sequence",
412 array(
'integer',
'integer',
'integer'),
413 array($phrase_id, 0, $ilUser->getId())
417 $neutral =
$row[
"neutral"];
418 if ((
$row[
"defaultvalue"] == 1) && (
$row[
"owner_fi"] == 0))
420 $this->
columns->addCategory($this->lng->txt(
$row[
"title"]), 0, $neutral);
424 $this->
columns->addCategory(
$row[
"title"], 0, $neutral);
446 return $ilDB->fetchAssoc(
$result);
472 $this->label =
$data[
'label'];
477 include_once(
"./Services/RTE/classes/class.ilRTE.php");
500 $result = $ilDB->queryF(
"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",
512 $result = $ilDB->queryF(
"SELECT * FROM svy_qst_matrixrows WHERE question_fi = %s ORDER BY sequence",
521 parent::loadFromDb(
$id);
553 function saveToDb($original_id = NULL, $withanswers =
true)
557 $affectedRows = parent::saveToDb($original_id);
559 if ($affectedRows == 1)
561 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->
getAdditionalTableName() .
" WHERE question_fi = %s",
566 question_fi, subtype, column_separators, row_separators, neutral_column_separator,column_placeholders, 567 legend, singleline_row_caption, repeat_column_header, column_header_position, random_rows, 568 column_order, column_images, row_images, bipolar_adjective1, bipolar_adjective2, layout, tstamp) 569 VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
571 'integer',
'integer',
'text',
'text',
'text',
'integer',
'text',
'text',
'text',
572 'text',
'text',
'text',
'text',
'text',
'text',
'text',
'text',
'integer' 608 $affectedRows = $ilDB->manipulateF(
"UPDATE " . $this->
getAdditionalTableName() .
" SET bipolar_adjective1 = %s, bipolar_adjective2 = %s WHERE question_fi = %s",
609 array(
'text',
'text',
'integer'),
610 array((strlen($adjective1)) ? $adjective1 : NULL, (strlen($adjective2)) ? $adjective2 : NULL, $this->
getId())
626 $result = $ilDB->queryF(
"SELECT title, category_id FROM svy_category WHERE title = %s AND neutral = %s AND owner_fi = %s",
627 array(
'text',
'text',
'integer'),
628 array($columntext, $neutral, $ilUser->getId())
637 if (strcmp(
$row[
"title"], $columntext) == 0)
639 $returnvalue =
$row[
"category_id"];
650 $next_id = $ilDB->nextId(
'svy_category');
651 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_category (category_id, title, defaultvalue, owner_fi, neutral, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
652 array(
'integer',
'text',
'text',
'integer',
'text',
'integer'),
653 array($next_id, $columntext, 0, $ilUser->getId(), $neutral,
time())
655 $returnvalue = $next_id;
665 $question_id = $this->
getId();
666 if (strlen($original_id))
668 $question_id = $original_id;
672 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_variable WHERE question_fi = %s",
681 $next_id = $ilDB->nextId(
'svy_variable');
682 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_variable (variable_id, category_fi, question_fi, value1, other, sequence, scale, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
683 array(
'integer',
'integer',
'integer',
'float',
'integer',
'integer',
'integer',
'integer'),
684 array($next_id, $column_id, $question_id, ($i + 1), $cat->other, $i, ($cat->scale > 0) ? $cat->scale : null,
time())
695 $question_id = $this->
getId();
696 if (strlen($original_id))
698 $question_id = $original_id;
702 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_qst_matrixrows WHERE question_fi = %s",
710 $next_id = $ilDB->nextId(
'svy_qst_matrixrows');
711 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_qst_matrixrows (id_svy_qst_matrixrows, title, label, other, sequence, question_fi) VALUES (%s, %s, %s, %s, %s, %s)",
712 array(
'integer',
'text',
'text',
'integer',
'integer',
'integer'),
713 array($next_id,
$row->title,
$row->label, (
$row->other) ? 1 : 0, $i, $question_id)
725 function toXML($a_include_header = TRUE, $obligatory_state =
"")
727 include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
730 $this->
insertXML($a_xml_writer, $a_include_header, $obligatory_state);
731 $xml = $a_xml_writer->xmlDumpMem(FALSE);
732 if (!$a_include_header)
734 $pos = strpos($xml,
"?>");
735 $xml = substr($xml, $pos + 2);
747 function insertXML(&$a_xml_writer, $a_include_header = TRUE)
750 "id" => $this->
getId(),
752 "type" => $this->getQuestiontype(),
756 $a_xml_writer->xmlStartTag(
"question", $attrs);
758 $a_xml_writer->xmlElement(
"description", NULL, $this->
getDescription());
759 $a_xml_writer->xmlElement(
"author", NULL, $this->
getAuthor());
760 $a_xml_writer->xmlStartTag(
"questiontext");
762 $a_xml_writer->xmlEndTag(
"questiontext");
764 $a_xml_writer->xmlStartTag(
"matrix");
765 $a_xml_writer->xmlStartTag(
"matrixrows");
771 if (strlen($this->
getRow($i)->label))
773 $attrs[
'label'] = $this->
getRow($i)->label;
775 if ($this->
getRow($i)->other)
779 $a_xml_writer->xmlStartTag(
"matrixrow", $attrs);
781 $a_xml_writer->xmlEndTag(
"matrixrow");
783 $a_xml_writer->xmlEndTag(
"matrixrows");
785 $a_xml_writer->xmlStartTag(
"responses");
788 $a_xml_writer->xmlStartTag(
"bipolar_adjectives");
797 $a_xml_writer->xmlEndTag(
"bipolar_adjectives");
806 $attrs[
'label'] =
'neutral';
811 $a_xml_writer->xmlStartTag(
"response_single", $attrs);
814 $a_xml_writer->xmlStartTag(
"response_multiple", $attrs);
821 $a_xml_writer->xmlEndTag(
"response_single");
824 $a_xml_writer->xmlEndTag(
"response_multiple");
829 $a_xml_writer->xmlEndTag(
"responses");
830 $a_xml_writer->xmlEndTag(
"matrix");
832 if (count($this->material))
834 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/", $this->material[
"internal_link"], $matches))
837 "label" => $this->material[
"title"]
839 $a_xml_writer->xmlStartTag(
"material", $attrs);
840 $intlink =
"il_" . IL_INST_ID .
"_" . $matches[2] .
"_" . $matches[3];
841 if (strcmp($matches[1],
"") != 0)
843 $intlink = $this->material[
"internal_link"];
845 $a_xml_writer->xmlElement(
"mattext", NULL, $intlink);
846 $a_xml_writer->xmlEndTag(
"material");
850 $a_xml_writer->xmlStartTag(
"metadata");
851 $a_xml_writer->xmlStartTag(
"metadatafield");
852 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"column_separators");
854 $a_xml_writer->xmlEndTag(
"metadatafield");
856 $a_xml_writer->xmlStartTag(
"metadatafield");
857 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"row_separators");
859 $a_xml_writer->xmlEndTag(
"metadatafield");
861 $a_xml_writer->xmlStartTag(
"metadatafield");
862 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"neutral_column_separator");
864 $a_xml_writer->xmlEndTag(
"metadatafield");
866 $a_xml_writer->xmlStartTag(
"metadatafield");
867 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"layout");
868 $a_xml_writer->xmlElement(
"fieldentry", NULL, serialize($this->
getLayout()));
869 $a_xml_writer->xmlEndTag(
"metadatafield");
871 $a_xml_writer->xmlEndTag(
"metadata");
873 $a_xml_writer->xmlEndTag(
"question");
880 parent::syncWithOriginal();
896 for ($i = $lower_limit; $i <= $upper_limit; $i++)
898 $this->
columns->addCategory($i);
914 $next_id = $ilDB->nextId(
'svy_phrase');
915 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_phrase (phrase_id, title, defaultvalue, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s)",
916 array(
'integer',
'text',
'text',
'integer',
'integer'),
919 $phrase_id = $next_id;
924 $next_id = $ilDB->nextId(
'svy_category');
925 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_category (category_id, title, defaultvalue, owner_fi, tstamp, neutral) VALUES (%s, %s, %s, %s, %s, %s)",
926 array(
'integer',
'text',
'text',
'integer',
'integer',
'text'),
927 array($next_id, $data[
'answer'], 1, $ilUser->getId(),
time(), $data[
'neutral'])
929 $category_id = $next_id;
930 $next_id = $ilDB->nextId(
'svy_phrase_cat');
931 $affectedRows = $ilDB->manipulateF(
"INSERT INTO svy_phrase_cat (phrase_category_id, phrase_fi, category_fi, sequence, other, scale) VALUES (%s, %s, %s, %s, %s, %s)",
932 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
933 array($next_id, $phrase_id, $category_id,
$counter, ($data[
'other']) ? 1 : 0, $data[
'scale'])
947 return "SurveyMatrixQuestion";
958 return "svy_qst_matrix";
970 foreach ($post_data as $key => $value)
975 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches))
977 if (is_array($value))
979 foreach ($value as $val)
981 array_push(
$data,
array(
"value" => $val,
"rowvalue" => $matches[1],
"textanswer" => $post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]]));
986 array_push(
$data,
array(
"value" => $value,
"rowvalue" => $matches[1],
"textanswer" => $post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]]));
991 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches))
993 if (is_array($value))
995 foreach ($value as $val)
997 array_push(
$data,
array(
"value" => $val,
"rowvalue" => $matches[1],
"textanswer" => $post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]]));
1002 array_push(
$data,
array(
"value" => $value,
"rowvalue" => $matches[1],
"textanswer" => $post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]]));
1027 foreach ($post_data as $key => $value)
1029 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches))
1031 if (array_key_exists(
'matrix_other_' . $this->
getId() .
"_" . $matches[1], $post_data) && strlen($post_data[
'matrix_other_' . $this->
getId() .
"_" . $matches[1]]) == 0)
1033 return $this->lng->txt(
"question_mr_no_other_answer");
1038 if (
$counter != $this->
getRowCount())
return $this->lng->txt(
"matrix_question_radio_button_not_checked");
1042 foreach ($post_data as $key => $value)
1044 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches))
1046 if (array_key_exists(
'matrix_other_' . $this->
getId() .
"_" . $matches[1], $post_data) && strlen($post_data[
'matrix_other_' . $this->
getId() .
"_" . $matches[1]]) == 0)
1048 return $this->lng->txt(
"question_mr_no_other_answer");
1051 if ((!is_array($value)) || (count($value) < 1))
1053 return $this->lng->txt(
"matrix_question_checkbox_not_checked");
1057 if (
$counter != $this->
getRowCount())
return $this->lng->txt(
"matrix_question_checkbox_not_checked");
1067 $answer_data =
array();
1073 foreach ($post_data as $key => $value)
1075 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches))
1079 $other_value = (array_key_exists(
'matrix_other_' . $this->
getId() .
'_' . $matches[1], $post_data))
1080 ? ($post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]])
1082 $answer_data[] =
array(
"value"=>$value,
1083 "textanswer"=>$other_value,
1084 "rowvalue"=>$matches[1]);
1091 foreach ($post_data as $key => $value)
1093 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/", $key, $matches))
1095 $other_value = (array_key_exists(
'matrix_other_' . $this->
getId() .
'_' . $matches[1], $post_data))
1096 ? ($post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]])
1098 foreach ($value as $checked)
1100 $answer_data[] =
array(
"value"=>$checked,
1101 "textanswer"=>$other_value,
1102 "rowvalue"=>$matches[1]);
1111 return $answer_data;
1115 if(
sizeof($answer_data))
1118 foreach ($answer_data as $item)
1120 $next_id = $ilDB->nextId(
'svy_answer');
1123 $fields[
'answer_id'] =
array(
"integer", $next_id);
1124 $fields[
'question_fi'] =
array(
"integer", $this->
getId());
1125 $fields[
'active_fi'] =
array(
"integer", $active_id);
1126 $fields[
'value'] =
array(
"float", $item[
'value']);
1127 $fields[
'textanswer'] =
array(
"clob", $item[
'textanswer']);
1128 $fields[
'rowvalue'] =
array(
"integer", $item[
'rowvalue']);
1129 $fields[
'tstamp'] =
array(
"integer",
time());
1131 $affectedRows = $ilDB->insert(
"svy_answer", $fields);
1145 parent::deleteAdditionalTableData($question_id);
1148 $affectedRows = $ilDB->manipulateF(
"DELETE FROM svy_qst_matrixrows WHERE question_fi = %s",
1181 $this->subtype = $a_subtype;
1201 $this->columnSeparators = 1;
1205 $this->columnSeparators = 0;
1218 return ($this->columnSeparators) ? 1 : 0;
1232 $this->rowSeparators = 1;
1236 $this->rowSeparators = 0;
1249 return ($this->rowSeparators) ? 1 : 0;
1263 $this->neutralColumnSeparator = 1;
1267 $this->neutralColumnSeparator = 0;
1280 return ($this->neutralColumnSeparator) ? 1 : 0;
1293 foreach ($a_meta as $key => $value)
1295 switch ($value[
"label"])
1297 case "column_separators":
1300 case "row_separators":
1306 case "neutral_column_separator":
1322 foreach ($a_data as $adjective)
1324 if (is_numeric($adjective[
"label"]))
1344 foreach ($a_data as
$row)
1346 $this->
addRow($row[
'title'], $row[
'other'], $row[
'label']);
1365 $this->
columns->addCategory(
$column, null, (strcmp(
$data[
"label"],
"neutral") == 0) ?
true :
false);
1400 include_once
"./Services/Form/classes/class.ilSelectInputGUI.php";
1404 $step3->setValue($default);
1417 function saveLayout($percent_row, $percent_columns, $percent_bipolar_adjective1 =
"", $percent_bipolar_adjective2 =
"", $percent_neutral)
1422 "percent_row" => $percent_row,
1423 "percent_columns" => $percent_columns,
1424 "percent_bipolar_adjective1" => $percent_bipolar_adjective1,
1425 "percent_bipolar_adjective2" => $percent_bipolar_adjective2,
1426 "percent_neutral" => $percent_neutral
1428 $affectedRows = $ilDB->manipulateF(
"UPDATE " . $this->
getAdditionalTableName() .
" SET layout = %s WHERE question_fi = %s",
1429 array(
'text',
'integer'),
1436 if (!is_array($this->layout) || count($this->layout) == 0)
1440 $this->layout =
array(
1441 "percent_row" => 30,
1442 "percent_columns" => 40,
1443 "percent_bipolar_adjective1" => 10,
1444 "percent_bipolar_adjective2" => 10,
1445 "percent_neutral" => 10
1450 $this->layout =
array(
1451 "percent_row" => 30,
1452 "percent_columns" => 50,
1453 "percent_bipolar_adjective1" => 10,
1454 "percent_bipolar_adjective2" => 10,
1455 "percent_neutral" => 0
1460 $this->layout =
array(
1461 "percent_row" => 30,
1462 "percent_columns" => 50,
1463 "percent_bipolar_adjective1" => 0,
1464 "percent_bipolar_adjective2" => 0,
1465 "percent_neutral" => 20
1470 $this->layout =
array(
1471 "percent_row" => 30,
1472 "percent_columns" => 70,
1473 "percent_bipolar_adjective1" => 0,
1474 "percent_bipolar_adjective2" => 0,
1475 "percent_neutral" => 0
1484 if (is_array($layout))
1490 $this->layout = unserialize($layout);
1533 $this->columnPlaceholders = ($a_value) ? 1 : 0;
1543 return ($this->columnPlaceholders) ? 1 : 0;
1553 $this->legend = ($a_value) ? 1 : 0;
1563 return ($this->legend) ? 1 : 0;
1568 $this->singleLineRowCaption = ($a_value) ? 1 : 0;
1573 return ($this->singleLineRowCaption) ? 1 : 0;
1578 $this->repeatColumnHeader = ($a_value) ? 1 : 0;
1583 return ($this->repeatColumnHeader) ? 1 : 0;
1588 $this->columnHeaderPosition = $a_value;
1593 return ($this->columnHeaderPosition) ? $this->columnHeaderPosition : 0;
1598 $this->randomRows = ($a_value) ? 1 : 0;
1603 return ($this->randomRows) ? 1 : 0;
1608 $this->columnOrder = $a_value;
1613 return ($this->columnOrder) ? $this->columnOrder : 0;
1618 $this->columnImages = ($a_value) ? 1 : 0;
1623 return ($this->columnImages) ? 1 : 0;
1628 $this->rowImages = ($a_value) ? 1 : 0;
1633 return ($this->rowImages) ? 1 : 0;
toXML($a_include_header=TRUE, $obligatory_state="")
Returns an xml representation of the question.
addRowAtPosition($a_text, $a_other, $a_position)
Adds a row at a given position.
saveCompletionStatus($original_id="")
Saves the complete flag to the database.
getAuthor()
Gets the authors name of the SurveyQuestion object.
getColumnForScale($scale)
getTitle()
Gets the title string of the SurveyQuestion object.
getBipolarAdjective($a_index)
Returns one of the bipolar adjectives.
getObligatory($survey_id="")
Gets the obligatory state of the question.
getRow($a_index)
Returns a specific row.
setObligatory($obligatory=1)
Sets the obligatory state of the question.
saveToDb($original_id=NULL, $withanswers=true)
Saves a SurveyMatrixQuestion object to a database.
savePhrase($title)
Saves a set of columns to a default phrase.
setColumnPlaceholders($a_value=0)
Set whether placeholders should be used for the column titles or not.
setId($id=-1)
Sets the id of the SurveyQuestion object.
hasBipolarAdjectives()
Returns TRUE if bipolar adjectives exist.
removeRows($array)
Removes rows from the question.
checkUserInput($post_data, $survey_id)
Checks the input of the active user for obligatory status and entered values.
saveBipolarAdjectives($adjective1, $adjective2)
setColumnHeaderPosition($a_value)
setSingleLineRowCaption($a_value=0)
getQuestiontext()
Gets the questiontext of the SurveyQuestion object.
setColumnImages($a_value=0)
getRowSeparators()
Gets the separators enable state for the matrix rows.
insertXML(&$a_xml_writer, $a_include_header=TRUE)
Adds the question XML to a given XMLWriter object.
getColumns()
Return the columns.
getPreconditionValueOutput($value)
Returns the output for a precondition value.
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
setOwner($owner="")
Sets the creator/owner ID of the SurveyQuestion object.
getColumn($index)
Returns the name of a column for a given index.
setComplete($a_complete)
Sets the complete state of the question.
flushColumns()
Empties the columns list.
deleteAdditionalTableData($question_id)
Deletes datasets from the additional question table in the database.
getPreconditionOptions()
Returns the options for preconditions.
& getWorkingDataFromUserInput($post_data)
Creates the user data of the svy_answer table from the POST data.
getQuestionDataArray($id)
Returns the question data fields from the database.
saveLayout($percent_row, $percent_columns, $percent_bipolar_adjective1="", $percent_bipolar_adjective2="", $percent_neutral)
Saves the layout of a matrix question.
importAdjectives($a_data)
Import bipolar adjectives from the question import file.
getSingleLineRowCaption()
setOriginalId($original_id)
setQuestiontext($questiontext="")
Sets the questiontext of the SurveyQuestion object.
hasNeutralColumn()
Returns TRUE if a neutral column exists.
setNeutralColumnSeparator($enable=0)
Enables/Disables a separator for the neutral column.
getLegend()
Get whether the legend should be shown or not.
if(!is_array($argv)) $options
usableForPrecondition()
Returns if the question is usable for preconditions.
getId()
Gets the id of the SurveyQuestion object.
addStandardNumbers($lower_limit, $upper_limit)
Adds standard numbers as columns.
The SurveyMatrixQuestion class defines and encapsulates basic methods and attributes for matrix quest...
Play around with inserting and removing rows and columns
setRepeatColumnHeader($a_value=0)
Basic class for all survey question types.
removeRow($index)
Removes a row.
importMatrix($a_data)
Import matrix rows from the question import file.
saveMaterial()
save material to db
importResponses($a_data)
Import response data from the question import file.
loadFromDb($id)
Loads a SurveyMatrixQuestion object from the database.
setLegend($a_value=0)
Set whether the legend should be shown or not.
getPreconditionSelectValue($default="", $title, $variable)
Creates a form property for the precondition value.
setColumnSeparators($enable=0)
Enables/Disables separators for the matrix columns.
xmlHeader()
Writes xml header public.
saveColumnToDb($columntext, $neutral=0)
Saves a column to the database.
setSubtype($a_subtype=0)
Sets the subtype of the matrix question.
getColumnHeaderPosition()
getColumnIndex($name)
Returns the index of a column with a given name.
saveUserInput($post_data, $active_id, $a_return=false)
flushRows()
Empties the row list.
Create styles array
The data for the language used.
getSubtype()
Returns the subtype of the matrix question.
saveColumnsToDb($original_id="")
removeColumn($index)
Removes a column from the list of columns.
setAuthor($author="")
Sets the authors name of the SurveyQuestion object.
setRowSeparators($enable=0)
Enables/Disables separators for the matrix rows.
addMaterialTag(&$a_xml_writer, $a_material, $close_material_tag=TRUE, $add_mobs=TRUE, $a_attrs=null)
Creates an XML material tag from a plain text or xhtml text.
importAdditionalMetadata($a_meta)
Import additional meta data from the question import file.
removeColumnWithName($name)
Removes a column from the list of columns.
setDescription($description="")
Sets the description string of the SurveyQuestion object.
addRow($a_text, $a_other, $a_label)
Adds a row to the question.
setRandomRows($a_value=0)
__construct($title="", $description="", $author="", $questiontext="", $owner=-1)
SurveyMatrixQuestion constructor The constructor takes possible arguments an creates an instance of t...
saveRowsToDb($original_id="")
getColumnPlaceholders()
Get whether placeholders should be used for the column titles or not.
getDescription()
Gets the description string of the SurveyQuestion object.
getQuestionType()
Returns the question type of the question.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getColumnCount()
Returns the number of columns.
setObjId($obj_id=0)
Set the reference id of the container object.
getColumnSeparators()
Gets the separators enable state for the matrix columns.
getAdditionalTableName()
Returns the name of the additional question data table in the database.
setBipolarAdjective($a_index, $a_value)
Sets one of the bipolar adjectives.
getRowCount()
Returns the number of rows in the question.
getNeutralColumnSeparator()
Gets the separator enable state for the neutral column.
addPhrase($phrase_id)
Adds a phrase to the question.
removeColumns($array)
Removes many columns from the list of columns.
isComplete()
Returns 1 if the question is complete for use.
setTitle($title="")
Sets the title string of the SurveyQuestion object.