24include_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);
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)
563 array($this->
getId())
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'),
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)
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
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
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;
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.
saveToDb($original_id=NULL, $withanswers=true)
Saves a SurveyMatrixQuestion object to a database.
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.
insertXML(&$a_xml_writer, $a_include_header=TRUE)
Adds the question XML to a given XMLWriter object.
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)
& 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.
toXML($a_include_header=TRUE, $obligatory_state="")
Returns an xml representation of the question.
removeColumns($array)
Removes many columns from the list of columns.
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.
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.
if(!is_array($argv)) $options