24include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
172 $this->
user = $DIC->user();
173 $this->db =
$DIC->database();
177 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyCategories.php";
180 $this->bipolar_adjective1 =
"";
181 $this->bipolar_adjective2 =
"";
182 $this->rowSeparators = 0;
183 $this->columnSeparators = 0;
184 $this->neutralColumnSeparator = 1;
196 return $this->columns->getCategoryCount();
208 $this->columns->removeCategory(
$index);
220 $this->columns->removeCategories($array);
232 $this->columns->removeCategoryWithName(
$name);
253 return $this->columns->getCategory(
$index);
258 return $this->columns->getCategoryForScale($scale);
270 return $this->columns->getCategoryIndex(
$name);
282 $this->columns->flushCategories();
293 return $this->rows->getCategoryCount();
301 public function addRow($a_text, $a_other, $a_label)
303 $this->rows->addCategory($a_text, $a_other, 0, $a_label);
314 $this->rows->addCategoryAtPosition($a_text, $a_position, $a_other);
336 return $this->rows->getCategory($a_index);
341 $this->rows->moveCategoryUp(
$index);
346 $this->rows->moveCategoryDown(
$index);
358 $this->rows->removeCategories($array);
368 $this->rows->removeCategory(
$index);
382 return (strlen($this->bipolar_adjective2)) ? $this->bipolar_adjective2 :
null;
386 return (strlen($this->bipolar_adjective1)) ? $this->bipolar_adjective1 :
null;
403 $this->bipolar_adjective2 = $a_value;
407 $this->bipolar_adjective1 = $a_value;
424 "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",
425 array(
'integer',
'integer',
'integer'),
426 array($phrase_id, 0,
$ilUser->getId())
429 $neutral =
$row[
"neutral"];
430 if ((
$row[
"defaultvalue"] == 1) && (
$row[
"owner_fi"] == 0)) {
431 $this->columns->addCategory($this->lng->txt(
$row[
"title"]), 0, $neutral);
433 $this->columns->addCategory(
$row[
"title"], 0, $neutral);
479 $this->label =
$data[
'label'];
484 include_once(
"./Services/RTE/classes/class.ilRTE.php");
508 "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",
519 "SELECT * FROM svy_qst_matrixrows WHERE question_fi = %s ORDER BY sequence",
527 parent::loadFromDb(
$id);
556 public function saveToDb($original_id =
null, $withanswers =
true)
560 $affectedRows = parent::saveToDb($original_id);
562 if ($affectedRows == 1) {
563 $affectedRows =
$ilDB->manipulateF(
566 array($this->
getId())
568 $affectedRows =
$ilDB->manipulateF(
570 question_fi, subtype, column_separators, row_separators, neutral_column_separator,column_placeholders,
571 legend, singleline_row_caption, repeat_column_header, column_header_position, random_rows,
572 column_order, column_images, row_images, bipolar_adjective1, bipolar_adjective2, layout, tstamp)
573 VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
575 'integer',
'integer',
'text',
'text',
'text',
'integer',
'text',
'text',
'text',
576 'text',
'text',
'text',
'text',
'text',
'text',
'text',
'text',
'integer'
612 $affectedRows =
$ilDB->manipulateF(
613 "UPDATE " . $this->
getAdditionalTableName() .
" SET bipolar_adjective1 = %s, bipolar_adjective2 = %s WHERE question_fi = %s",
614 array(
'text',
'text',
'integer'),
615 array((strlen($adjective1)) ? $adjective1 :
null, (strlen($adjective2)) ? $adjective2 :
null, $this->
getId())
633 "SELECT title, category_id FROM svy_category WHERE title = %s AND neutral = %s AND owner_fi = %s",
634 array(
'text',
'text',
'integer'),
635 array($columntext, $neutral,
$ilUser->getId())
642 if (strcmp(
$row[
"title"], $columntext) == 0) {
643 $returnvalue =
$row[
"category_id"];
651 $next_id =
$ilDB->nextId(
'svy_category');
652 $affectedRows =
$ilDB->manipulateF(
653 "INSERT INTO svy_category (category_id, title, defaultvalue, owner_fi, neutral, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
654 array(
'integer',
'text',
'text',
'integer',
'text',
'integer'),
655 array($next_id, $columntext, 0,
$ilUser->getId(), $neutral, time())
657 $returnvalue = $next_id;
667 $question_id = $this->
getId();
668 if (strlen($original_id)) {
669 $question_id = $original_id;
673 $affectedRows =
$ilDB->manipulateF(
674 "DELETE FROM svy_variable WHERE question_fi = %s",
682 $next_id =
$ilDB->nextId(
'svy_variable');
683 $affectedRows =
$ilDB->manipulateF(
684 "INSERT INTO svy_variable (variable_id, category_fi, question_fi, value1, other, sequence, scale, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
685 array(
'integer',
'integer',
'integer',
'float',
'integer',
'integer',
'integer',
'integer'),
686 array($next_id, $column_id, $question_id, (
$i + 1), $cat->other,
$i, ($cat->scale > 0) ? $cat->scale :
null, time())
697 $question_id = $this->
getId();
698 if (strlen($original_id)) {
699 $question_id = $original_id;
703 $affectedRows =
$ilDB->manipulateF(
704 "DELETE FROM svy_qst_matrixrows WHERE question_fi = %s",
711 $next_id =
$ilDB->nextId(
'svy_qst_matrixrows');
712 $affectedRows =
$ilDB->manipulateF(
713 "INSERT INTO svy_qst_matrixrows (id_svy_qst_matrixrows, title, label, other, sequence, question_fi) VALUES (%s, %s, %s, %s, %s, %s)",
714 array(
'integer',
'text',
'text',
'integer',
'integer',
'integer'),
715 array($next_id,
$row->title,
$row->label, (
$row->other) ? 1 : 0,
$i, $question_id)
727 public function toXML($a_include_header =
true, $obligatory_state =
"")
729 include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
732 $this->
insertXML($a_xml_writer, $a_include_header, $obligatory_state);
733 $xml = $a_xml_writer->xmlDumpMem(
false);
734 if (!$a_include_header) {
735 $pos = strpos(
$xml,
"?>");
748 public function insertXML(&$a_xml_writer, $a_include_header =
true)
751 "id" => $this->
getId(),
753 "type" => $this->getQuestiontype(),
757 $a_xml_writer->xmlStartTag(
"question", $attrs);
759 $a_xml_writer->xmlElement(
"description",
null, $this->
getDescription());
760 $a_xml_writer->xmlElement(
"author",
null, $this->
getAuthor());
761 $a_xml_writer->xmlStartTag(
"questiontext");
763 $a_xml_writer->xmlEndTag(
"questiontext");
765 $a_xml_writer->xmlStartTag(
"matrix");
766 $a_xml_writer->xmlStartTag(
"matrixrows");
771 if (strlen($this->
getRow(
$i)->label)) {
772 $attrs[
'label'] = $this->
getRow(
$i)->label;
777 $a_xml_writer->xmlStartTag(
"matrixrow", $attrs);
779 $a_xml_writer->xmlEndTag(
"matrixrow");
781 $a_xml_writer->xmlEndTag(
"matrixrows");
783 $a_xml_writer->xmlStartTag(
"responses");
785 $a_xml_writer->xmlStartTag(
"bipolar_adjectives");
794 $a_xml_writer->xmlEndTag(
"bipolar_adjectives");
801 $attrs[
'label'] =
'neutral';
805 $a_xml_writer->xmlStartTag(
"response_single", $attrs);
808 $a_xml_writer->xmlStartTag(
"response_multiple", $attrs);
814 $a_xml_writer->xmlEndTag(
"response_single");
817 $a_xml_writer->xmlEndTag(
"response_multiple");
822 $a_xml_writer->xmlEndTag(
"responses");
823 $a_xml_writer->xmlEndTag(
"matrix");
825 if (count($this->material)) {
826 if (preg_match(
"/il_(\d*?)_(\w+)_(\d+)/", $this->material[
"internal_link"], $matches)) {
828 "label" => $this->material[
"title"]
830 $a_xml_writer->xmlStartTag(
"material", $attrs);
831 $intlink =
"il_" . IL_INST_ID .
"_" . $matches[2] .
"_" . $matches[3];
832 if (strcmp($matches[1],
"") != 0) {
833 $intlink = $this->material[
"internal_link"];
835 $a_xml_writer->xmlElement(
"mattext",
null, $intlink);
836 $a_xml_writer->xmlEndTag(
"material");
840 $a_xml_writer->xmlStartTag(
"metadata");
841 $a_xml_writer->xmlStartTag(
"metadatafield");
842 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"column_separators");
844 $a_xml_writer->xmlEndTag(
"metadatafield");
846 $a_xml_writer->xmlStartTag(
"metadatafield");
847 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"row_separators");
849 $a_xml_writer->xmlEndTag(
"metadatafield");
851 $a_xml_writer->xmlStartTag(
"metadatafield");
852 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"neutral_column_separator");
854 $a_xml_writer->xmlEndTag(
"metadatafield");
856 $a_xml_writer->xmlStartTag(
"metadatafield");
857 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"layout");
858 $a_xml_writer->xmlElement(
"fieldentry",
null, serialize($this->
getLayout()));
859 $a_xml_writer->xmlEndTag(
"metadatafield");
861 $a_xml_writer->xmlEndTag(
"metadata");
863 $a_xml_writer->xmlEndTag(
"question");
869 parent::syncWithOriginal();
885 for (
$i = $lower_limit;
$i <= $upper_limit;
$i++) {
886 $this->columns->addCategory(
$i);
902 $next_id =
$ilDB->nextId(
'svy_phrase');
903 $affectedRows =
$ilDB->manipulateF(
904 "INSERT INTO svy_phrase (phrase_id, title, defaultvalue, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s)",
905 array(
'integer',
'text',
'text',
'integer',
'integer'),
908 $phrase_id = $next_id;
912 $next_id =
$ilDB->nextId(
'svy_category');
913 $affectedRows =
$ilDB->manipulateF(
914 "INSERT INTO svy_category (category_id, title, defaultvalue, owner_fi, tstamp, neutral) VALUES (%s, %s, %s, %s, %s, %s)",
915 array(
'integer',
'text',
'text',
'integer',
'integer',
'text'),
918 $category_id = $next_id;
919 $next_id =
$ilDB->nextId(
'svy_phrase_cat');
920 $affectedRows =
$ilDB->manipulateF(
921 "INSERT INTO svy_phrase_cat (phrase_category_id, phrase_fi, category_fi, sequence, other, scale) VALUES (%s, %s, %s, %s, %s, %s)",
922 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
923 array($next_id, $phrase_id, $category_id,
$counter, (
$data[
'other']) ? 1 : 0,
$data[
'scale'])
937 return "SurveyMatrixQuestion";
948 return "svy_qst_matrix";
960 foreach ($post_data as
$key => $value) {
963 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/",
$key, $matches)) {
964 if (is_array($value)) {
965 foreach ($value as $val) {
966 array_push(
$data, array(
"value" => $val,
"rowvalue" => $matches[1],
"textanswer" => $post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]]));
969 array_push(
$data, array(
"value" => $value,
"rowvalue" => $matches[1],
"textanswer" => $post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]]));
974 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/",
$key, $matches)) {
975 if (is_array($value)) {
976 foreach ($value as $val) {
977 array_push(
$data, array(
"value" => $val,
"rowvalue" => $matches[1],
"textanswer" => $post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]]));
980 array_push(
$data, array(
"value" => $value,
"rowvalue" => $matches[1],
"textanswer" => $post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]]));
1006 foreach ($post_data as
$key => $value) {
1007 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/",
$key, $matches)) {
1008 if (array_key_exists(
'matrix_other_' . $this->
getId() .
"_" . $matches[1], $post_data) && strlen($post_data[
'matrix_other_' . $this->
getId() .
"_" . $matches[1]]) == 0) {
1009 return $this->lng->txt(
"question_mr_no_other_answer");
1015 return $this->lng->txt(
"matrix_question_radio_button_not_checked");
1020 foreach ($post_data as
$key => $value) {
1021 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/",
$key, $matches)) {
1022 if (array_key_exists(
'matrix_other_' . $this->
getId() .
"_" . $matches[1], $post_data) && strlen($post_data[
'matrix_other_' . $this->
getId() .
"_" . $matches[1]]) == 0) {
1023 return $this->lng->txt(
"question_mr_no_other_answer");
1026 if ((!is_array($value)) || (count($value) < 1)) {
1027 return $this->lng->txt(
"matrix_question_checkbox_not_checked");
1032 return $this->lng->txt(
"matrix_question_checkbox_not_checked");
1043 $answer_data = array();
1048 foreach ($post_data as
$key => $value) {
1049 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/",
$key, $matches)) {
1050 if (strlen($value)) {
1051 $other_value = (array_key_exists(
'matrix_other_' . $this->
getId() .
'_' . $matches[1], $post_data))
1052 ? ($post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]])
1054 $answer_data[] = array(
"value"=>$value,
1055 "textanswer"=>$other_value,
1056 "rowvalue"=>$matches[1]);
1063 foreach ($post_data as
$key => $value) {
1064 if (preg_match(
"/matrix_" . $this->
getId() .
"_(\d+)/",
$key, $matches)) {
1065 $other_value = (array_key_exists(
'matrix_other_' . $this->
getId() .
'_' . $matches[1], $post_data))
1066 ? ($post_data[
'matrix_other_' . $this->
getId() .
'_' . $matches[1]])
1068 foreach ($value as $checked) {
1069 $answer_data[] = array(
"value"=>$checked,
1070 "textanswer"=>$other_value,
1071 "rowvalue"=>$matches[1]);
1079 return $answer_data;
1083 if (
sizeof($answer_data)) {
1085 foreach ($answer_data as $item) {
1086 $next_id =
$ilDB->nextId(
'svy_answer');
1089 $fields[
'answer_id'] = array(
"integer", $next_id);
1090 $fields[
'question_fi'] = array(
"integer", $this->
getId());
1091 $fields[
'active_fi'] = array(
"integer", $active_id);
1092 $fields[
'value'] = array(
"float", $item[
'value']);
1093 $fields[
'textanswer'] = array(
"clob", $item[
'textanswer']);
1094 $fields[
'rowvalue'] = array(
"integer", $item[
'rowvalue']);
1095 $fields[
'tstamp'] = array(
"integer", time());
1097 $affectedRows =
$ilDB->insert(
"svy_answer", $fields);
1110 parent::deleteAdditionalTableData($question_id);
1113 $affectedRows =
$ilDB->manipulateF(
1114 "DELETE FROM svy_qst_matrixrows WHERE question_fi = %s",
1139 switch ($a_subtype) {
1146 $this->subtype = $a_subtype;
1165 $this->columnSeparators = 1;
1169 $this->columnSeparators = 0;
1182 return ($this->columnSeparators) ? 1 : 0;
1195 $this->rowSeparators = 1;
1199 $this->rowSeparators = 0;
1212 return ($this->rowSeparators) ? 1 : 0;
1225 $this->neutralColumnSeparator = 1;
1229 $this->neutralColumnSeparator = 0;
1242 return ($this->neutralColumnSeparator) ? 1 : 0;
1255 foreach ($a_meta as
$key => $value) {
1256 switch ($value[
"label"]) {
1257 case "column_separators":
1260 case "row_separators":
1266 case "neutral_column_separator":
1282 foreach ($a_data as $adjective) {
1283 if (is_numeric($adjective[
"label"])) {
1300 foreach ($a_data as
$row) {
1313 foreach ($a_data as
$id =>
$data) {
1318 $this->columns->addCategory(
$column,
null, (strcmp(
$data[
"label"],
"neutral") == 0) ?
true :
false);
1353 include_once
"./Services/Form/classes/class.ilSelectInputGUI.php";
1357 $step3->setValue($default);
1370 public function saveLayout($percent_row, $percent_columns, $percent_bipolar_adjective1 =
"", $percent_bipolar_adjective2 =
"", $percent_neutral)
1375 "percent_row" => $percent_row,
1376 "percent_columns" => $percent_columns,
1377 "percent_bipolar_adjective1" => $percent_bipolar_adjective1,
1378 "percent_bipolar_adjective2" => $percent_bipolar_adjective2,
1379 "percent_neutral" => $percent_neutral
1381 $affectedRows =
$ilDB->manipulateF(
1383 array(
'text',
'integer'),
1390 if (!is_array($this->layout) || count($this->layout) == 0) {
1392 $this->layout = array(
1393 "percent_row" => 30,
1394 "percent_columns" => 40,
1395 "percent_bipolar_adjective1" => 10,
1396 "percent_bipolar_adjective2" => 10,
1397 "percent_neutral" => 10
1400 $this->layout = array(
1401 "percent_row" => 30,
1402 "percent_columns" => 50,
1403 "percent_bipolar_adjective1" => 10,
1404 "percent_bipolar_adjective2" => 10,
1405 "percent_neutral" => 0
1408 $this->layout = array(
1409 "percent_row" => 30,
1410 "percent_columns" => 50,
1411 "percent_bipolar_adjective1" => 0,
1412 "percent_bipolar_adjective2" => 0,
1413 "percent_neutral" => 20
1416 $this->layout = array(
1417 "percent_row" => 30,
1418 "percent_columns" => 70,
1419 "percent_bipolar_adjective1" => 0,
1420 "percent_bipolar_adjective2" => 0,
1421 "percent_neutral" => 0
1433 $this->layout = unserialize(
$layout);
1474 $this->columnPlaceholders = ($a_value) ? 1 : 0;
1484 return ($this->columnPlaceholders) ? 1 : 0;
1494 $this->legend = ($a_value) ? 1 : 0;
1504 return ($this->legend) ? 1 : 0;
1509 $this->singleLineRowCaption = ($a_value) ? 1 : 0;
1514 return ($this->singleLineRowCaption) ? 1 : 0;
1519 $this->repeatColumnHeader = ($a_value) ? 1 : 0;
1524 return ($this->repeatColumnHeader) ? 1 : 0;
1529 $this->columnHeaderPosition = $a_value;
1534 return ($this->columnHeaderPosition) ? $this->columnHeaderPosition : 0;
1539 $this->randomRows = ($a_value) ? 1 : 0;
1544 return ($this->randomRows) ? 1 : 0;
1549 $this->columnOrder = $a_value;
1554 return ($this->columnOrder) ? $this->columnOrder : 0;
1559 $this->columnImages = ($a_value) ? 1 : 0;
1564 return ($this->columnImages) ? 1 : 0;
1569 $this->rowImages = ($a_value) ? 1 : 0;
1574 return ($this->rowImages) ? 1 : 0;
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
The SurveyMatrixQuestion class defines and encapsulates basic methods and attributes for matrix quest...
hasNeutralColumn()
Returns TRUE if a neutral column exists.
addRow($a_text, $a_other, $a_label)
Adds a row to the question.
addStandardNumbers($lower_limit, $upper_limit)
Adds standard numbers as columns.
setSubtype($a_subtype=0)
Sets the subtype of the matrix question.
__construct($title="", $description="", $author="", $questiontext="", $owner=-1)
SurveyMatrixQuestion constructor The constructor takes possible arguments an creates an instance of t...
getAdditionalTableName()
Returns the name of the additional question data table in the database.
saveColumnsToDb($original_id="")
setRowSeparators($enable=0)
Enables/Disables separators for the matrix rows.
setBipolarAdjective($a_index, $a_value)
Sets one of the bipolar adjectives.
importMatrix($a_data)
Import matrix rows from the question import file.
removeRow($index)
Removes a row.
importAdjectives($a_data)
Import bipolar adjectives from the question import file.
saveLayout($percent_row, $percent_columns, $percent_bipolar_adjective1="", $percent_bipolar_adjective2="", $percent_neutral)
Saves the layout of a matrix question.
saveRowsToDb($original_id="")
getColumnIndex($name)
Returns the index of a column with a given name.
removeRows($array)
Removes rows from the question.
setRandomRows($a_value=0)
getQuestionDataArray($id)
Returns the question data fields from the database.
flushRows()
Empties the row list.
getBipolarAdjective($a_index)
Returns one of the bipolar adjectives.
saveUserInput($post_data, $active_id, $a_return=false)
setColumnHeaderPosition($a_value)
removeColumnWithName($name)
Removes a column from the list of columns.
setColumnSeparators($enable=0)
Enables/Disables separators for the matrix columns.
getSubtype()
Returns the subtype of the matrix question.
savePhrase($title)
Saves a set of columns to a default phrase.
getNeutralColumnSeparator()
Gets the separator enable state for the neutral column.
getLegend()
Get whether the legend should be shown or not.
saveColumnToDb($columntext, $neutral=0)
Saves a column to the database.
setColumnImages($a_value=0)
saveToDb($original_id=null, $withanswers=true)
Saves a SurveyMatrixQuestion object to a database.
& getWorkingDataFromUserInput($post_data)
Creates the user data of the svy_answer table from the POST data.
setSingleLineRowCaption($a_value=0)
getQuestionType()
Returns the question type of the question.
getColumn($index)
Returns the name of a column for a given index.
flushColumns()
Empties the columns list.
usableForPrecondition()
Returns if the question is usable for preconditions.
checkUserInput($post_data, $survey_id)
Checks the input of the active user for obligatory status and entered values.
setNeutralColumnSeparator($enable=0)
Enables/Disables a separator for the neutral column.
addPhrase($phrase_id)
Adds a phrase to the question.
importAdditionalMetadata($a_meta)
Import additional meta data from the question import file.
setColumnPlaceholders($a_value=0)
Set whether placeholders should be used for the column titles or not.
getColumnHeaderPosition()
getColumnSeparators()
Gets the separators enable state for the matrix columns.
getSingleLineRowCaption()
setLegend($a_value=0)
Set whether the legend should be shown or not.
removeColumn($index)
Removes a column from the list of columns.
removeColumns($array)
Removes many columns from the list of columns.
toXML($a_include_header=true, $obligatory_state="")
Returns an xml representation of the question.
getColumnPlaceholders()
Get whether placeholders should be used for the column titles or not.
saveBipolarAdjectives($adjective1, $adjective2)
getColumnCount()
Returns the number of columns.
hasBipolarAdjectives()
Returns TRUE if bipolar adjectives exist.
getPreconditionValueOutput($value)
Returns the output for a precondition value.
loadFromDb($id)
Loads a SurveyMatrixQuestion object from the database.
insertXML(&$a_xml_writer, $a_include_header=true)
Adds the question XML to a given XMLWriter object.
getRow($a_index)
Returns a specific row.
setRepeatColumnHeader($a_value=0)
importResponses($a_data)
Import response data from the question import file.
deleteAdditionalTableData($question_id)
Deletes datasets from the additional question table in the database.
getPreconditionSelectValue($default="", $title, $variable)
Creates a form property for the precondition value.
getColumnForScale($scale)
getRowCount()
Returns the number of rows in the question.
addRowAtPosition($a_text, $a_other, $a_position)
Adds a row at a given position.
getColumns()
Return the columns.
getRowSeparators()
Gets the separators enable state for the matrix rows.
isComplete()
Returns 1 if the question is complete for use.
Basic class for all survey question types.
setQuestiontext($questiontext="")
Sets the questiontext of the SurveyQuestion object.
setId($id=-1)
Sets the id of the SurveyQuestion object.
setAuthor($author="")
Sets the authors name of the SurveyQuestion object.
getDescription()
Gets the description string of the SurveyQuestion object.
getId()
Gets the id of the SurveyQuestion object.
setDescription($description="")
Sets the description string of the SurveyQuestion object.
setObjId($obj_id=0)
Set the reference id of the container object.
getAuthor()
Gets the authors name of the SurveyQuestion object.
setOriginalId($original_id)
getQuestiontext()
Gets the questiontext of the SurveyQuestion object.
getObligatory($survey_id="")
Gets the obligatory state of the question.
getTitle()
Gets the title string of the SurveyQuestion object.
setComplete($a_complete)
Sets the complete state of the question.
getPreconditionOptions()
Returns the options for preconditions.
saveMaterial()
save material to db
setOwner($owner="")
Sets the creator/owner ID of the SurveyQuestion object.
setTitle($title="")
Sets the title string of the SurveyQuestion object.
saveCompletionStatus($original_id="")
Saves the complete flag to the database.
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.
setObligatory($obligatory=1)
Sets the obligatory state of the question.
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...
xmlHeader()
Writes xml header @access public.