ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
SurveyTextQuestion Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for SurveyTextQuestion:
+ Collaboration diagram for SurveyTextQuestion:

Public Member Functions

 __construct (string $title="", string $description="", string $author="", string $questiontext="", int $owner=-1)
 
 getQuestionDataArray (int $id)
 
 loadFromDb (int $question_id)
 
 isComplete ()
 
 setMaxChars (int $maxchars=0)
 
 getMaxChars ()
 
 saveToDb (int $original_id=0)
 
 toXML (bool $a_include_header=true, bool $obligatory_state=false)
 
 insertXML (ilXmlWriter $a_xml_writer, $a_include_header=true)
 
 getQuestionType ()
 
 getAdditionalTableName ()
 
 getWorkingDataFromUserInput (array $post_data)
 
 checkUserInput (array $post_data, int $survey_id)
 Checks the input of the active user for obligatory status and entered values. More...
 
 saveUserInput (array $post_data, int $active_id, bool $a_return=false)
 
 importResponses (array $a_data)
 
 usableForPrecondition ()
 
 getTextWidth ()
 
 getTextHeight ()
 
 setTextWidth (?int $a_textwidth=null)
 
 setTextHeight (?int $a_textheight=null)
 
- Public Member Functions inherited from SurveyQuestion
 __construct (string $title="", string $description="", string $author="", string $questiontext="", int $owner=-1)
 
 setComplete (bool $a_complete)
 
 isComplete ()
 
 questionTitleExists (string $title, int $questionpool_object=0)
 
 setTitle (string $title="")
 
 setObligatory (bool $obligatory=true)
 
 setOrientation (int $orientation=0)
 
 setId (int $id=-1)
 
 setSurveyId (int $id=-1)
 
 setDescription (string $description="")
 
 addMaterials (string $materials_file, string $materials_name="")
 
 setMaterialsfile (string $materials_filename, string $materials_tempfilename="", string $materials_name="")
 Uploads and adds a material. More...
 
 deleteMaterial (string $materials_name="")
 
 flushMaterials ()
 Deletes all materials uris. More...
 
 setAuthor (string $author="")
 
 setQuestiontext (string $questiontext="")
 
 setOwner (int $owner=0)
 
 getTitle ()
 
 getLabel ()
 
 getId ()
 
 getObligatory ()
 
 getSurveyId ()
 
 getOrientation ()
 
 getDescription ()
 
 getAuthor ()
 
 getOwner ()
 
 getQuestiontext ()
 
 getObjId ()
 Get the reference(?) id of the container object. More...
 
 setObjId (int $obj_id=0)
 Set the reference(?) id of the container object. More...
 
 duplicate (bool $for_survey=true, string $title="", string $author="", int $owner=0, int $a_survey_id=0)
 
 copyObject (int $target_questionpool, string $title="")
 
 copyXHTMLMediaObjectsOfQuestion (int $a_q_id)
 Copy media object usages from other question. More...
 
 loadFromDb (int $question_id)
 load question data into object note: this base implementation only loads the material data More...
 
 saveCompletionStatus (int $original_id=0)
 Saves the complete flag to the database. More...
 
 saveToDb (int $original_id=0)
 Saves a SurveyQuestion object to a database. More...
 
 createNewQuestion ()
 Creates a new question with a 0 timestamp when a new question is created This assures that an ID is given to the question if a file upload or something else occurs. More...
 
 getImagePath ()
 Returns the image path for web accessible images of a question. More...
 
 getMaterialsPath ()
 Returns the materials path for web accessible materials of a question. More...
 
 getImagePathWeb ()
 Returns the web image path for web accessible images of a question. More...
 
 getMaterialsPathWeb ()
 Returns the web image path for web accessable images of a question. More...
 
 saveCategoryToDb (string $categorytext, int $neutral=0)
 Saves a category to the database. More...
 
 deleteAdditionalTableData (int $question_id)
 Deletes datasets from the additional question table in the database. More...
 
 delete (int $question_id)
 Deletes a question and all materials from the database. More...
 
 syncWithOriginal ()
 
 getQuestionTypeID ()
 
 getQuestionType ()
 
 isHTML (string $a_text)
 
 QTIMaterialToString (ilQTIMaterial $a_material)
 Reads an QTI material tag an creates a text string. More...
 
 addMaterialTag (ilXmlWriter $a_xml_writer, string $a_material, bool $close_material_tag=true, bool $add_mobs=true, ?array $a_attrs=null)
 Creates an XML material tag from a plain text or xhtml text. More...
 
 prepareTextareaOutput (string $txt_output, bool $prepare_for_latex_output=false)
 Prepares string for a text area output in surveys. More...
 
 getQuestionDataArray (int $id)
 Returns the question data. More...
 
 getWorkingDataFromUserInput (array $post_data)
 Creates the user data of the svy_answer table from the POST data. More...
 
 importAdditionalMetadata (array $a_meta)
 Import additional meta data from the question import file. More...
 
 importResponses (array $a_data)
 Import response data from the question import file. More...
 
 importAdjectives (array $a_data)
 Import bipolar adjectives from the question import file. More...
 
 importMatrix (array $a_data)
 Import matrix rows from the question import file. More...
 
 usableForPrecondition ()
 Returns if the question is usable for preconditions. More...
 
 getAvailableRelations ()
 Returns the available relations for the question. More...
 
 getPreconditionOptions ()
 Returns the options for preconditions. More...
 
 getPreconditionValueOutput (string $value)
 Returns the output for a precondition value. More...
 
 getPreconditionSelectValue (string $default, string $title, string $variable)
 Creates a form property for the precondition value. More...
 
 setOriginalId (?int $original_id)
 
 getOriginalId ()
 
 getMaterial ()
 
 setSubtype (int $a_subtype)
 
 getSubtype ()
 
 __get (string $value)
 
 __set (string $key, string $value)
 
 getCopyIds (bool $a_group_by_survey=false)
 
 hasCopies ()
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://mantis.ilias.de/view.php?id=19727 and https://mantis.ilias.de/view.php?id=24200. More...
 

Protected Attributes

int $maxchars = null
 
int $textwidth = null
 
int $textheight = null
 
- Protected Attributes inherited from SurveyQuestion
int $original_id
 
ILIAS SurveyQuestionPool Editing EditSessionRepository $edit_manager
 
ilObjUser $user
 
ilDBInterface $db
 
array $cumulated
 
ilLogger $log
 
ILIAS SurveyQuestionPool Export ImportSessionRepository $import_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from SurveyQuestion
static _isComplete (int $question_id)
 Checks whether the question is complete or not. More...
 
static _getQuestionType (int $question_id)
 Returns the question type of a question with a given id. More...
 
static _getTitle (int $question_id)
 Returns the question title of a question with a given id. More...
 
static _getOriginalId (int $question_id, bool $a_return_question_id_if_no_original=true)
 Returns the original id of a question. More...
 
static _questionExists (int $question_id)
 
static _resolveInternalLink (string $internal_link)
 
static _resolveIntLinks (int $question_id)
 
static _getInternalLinkHref (string $target="", int $a_parent_ref_id=null)
 
static _isWriteable (int $question_id, int $user_id)
 is question writeable by a certain user More...
 
static _includeClass (string $question_type, int $gui=0)
 Include the php class file for a given question type. More...
 
static _getQuestionTypeName (string $type_tag)
 Return the translation for a given question type. More...
 
static _instanciateQuestion (int $question_id)
 Get question object. More...
 
static _instanciateQuestionGUI (int $question_id)
 Get question gui object. More...
 
static _instanciateQuestionEvaluation (int $question_id, array $a_finished_ids=null)
 
static _changeOriginalId (int $a_question_id, int $a_original_id, int $a_object_id)
 Change original id of existing question in db. More...
 
static _lookupSurveyObjId (int $a_question_id)
 
static lookupObjFi (int $a_qid)
 
static getMaxSumScore (int $survey_id)
 Get max sum score for specific survey (and this question type) More...
 
- Data Fields inherited from SurveyQuestion
int $id
 
string $title
 
string $description
 
int $owner
 
string $author
 
array $materials
 
int $survey_id
 
int $obj_id
 
string $questiontext
 
bool $obligatory
 
ilLanguage $lng
 
int $orientation
 
array $material
 
bool $complete
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Text survey question

The SurveyTextQuestion class defines and encapsulates basic methods and attributes for text survey question types.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m

Definition at line 27 of file class.SurveyTextQuestion.php.

Constructor & Destructor Documentation

◆ __construct()

SurveyTextQuestion::__construct ( string  $title = "",
string  $description = "",
string  $author = "",
string  $questiontext = "",
int  $owner = -1 
)

Definition at line 33 of file class.SurveyTextQuestion.php.

References SurveyQuestion\$author, SurveyQuestion\$description, $DIC, SurveyQuestion\$owner, SurveyQuestion\$questiontext, SurveyQuestion\$title, and ILIAS\MetaData\Repository\Validation\Data\__construct().

39  {
40  global $DIC;
41 
42  $this->db = $DIC->database();
44 
45  $this->maxchars = 0;
46  $this->textwidth = 50;
47  $this->textheight = 5;
48  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkUserInput()

SurveyTextQuestion::checkUserInput ( array  $post_data,
int  $survey_id 
)

Checks the input of the active user for obligatory status and entered values.

Definition at line 233 of file class.SurveyTextQuestion.php.

References SurveyQuestion\getId(), getMaxChars(), SurveyQuestion\getObligatory(), ILIAS\Repository\lng(), and ilStr\strLen().

236  : string {
237  $entered_value = $post_data[$this->getId() . "_text_question"];
238 
239  if ((!$this->getObligatory()) && (strlen($entered_value ?? "") == 0)) {
240  return "";
241  }
242 
243  if (strlen($entered_value ?? "") == 0) {
244  return $this->lng->txt("text_question_not_filled_out");
245  }
246 
247  // see bug #22648
248  if ($this->getMaxChars() > 0 && ilStr::strLen($entered_value) > $this->getMaxChars()) {
249  return str_replace("%s", ilStr::strLen($entered_value), $this->lng->txt("svy_answer_too_long"));
250  }
251 
252  return "";
253  }
static strLen(string $a_string)
Definition: class.ilStr.php:63
+ Here is the call graph for this function:

◆ getAdditionalTableName()

SurveyTextQuestion::getAdditionalTableName ( )

Definition at line 213 of file class.SurveyTextQuestion.php.

Referenced by getQuestionDataArray(), loadFromDb(), and saveToDb().

213  : string
214  {
215  return "svy_qst_text";
216  }
+ Here is the caller graph for this function:

◆ getMaxChars()

SurveyTextQuestion::getMaxChars ( )

Definition at line 113 of file class.SurveyTextQuestion.php.

References $maxchars.

Referenced by checkUserInput(), insertXML(), saveToDb(), and saveUserInput().

113  : int
114  {
115  return $this->maxchars;
116  }
+ Here is the caller graph for this function:

◆ getQuestionDataArray()

SurveyTextQuestion::getQuestionDataArray ( int  $id)

Definition at line 50 of file class.SurveyTextQuestion.php.

References SurveyQuestion\$db, $ilDB, and getAdditionalTableName().

50  : array
51  {
52  $ilDB = $this->db;
53  $result = $ilDB->queryF(
54  "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",
55  array('integer'),
56  array($id)
57  );
58  if ($result->numRows() === 1) {
59  return $ilDB->fetchAssoc($result);
60  } else {
61  return array();
62  }
63  }
+ Here is the call graph for this function:

◆ getQuestionType()

SurveyTextQuestion::getQuestionType ( )

Definition at line 208 of file class.SurveyTextQuestion.php.

Referenced by insertXML().

208  : string
209  {
210  return "SurveyTextQuestion";
211  }
+ Here is the caller graph for this function:

◆ getTextHeight()

SurveyTextQuestion::getTextHeight ( )

Definition at line 316 of file class.SurveyTextQuestion.php.

References $textheight.

Referenced by insertXML(), and saveToDb().

316  : ?int
317  {
318  return $this->textheight;
319  }
+ Here is the caller graph for this function:

◆ getTextWidth()

SurveyTextQuestion::getTextWidth ( )

Definition at line 311 of file class.SurveyTextQuestion.php.

References $textwidth.

Referenced by insertXML(), and saveToDb().

311  : ?int
312  {
313  return $this->textwidth;
314  }
+ Here is the caller graph for this function:

◆ getWorkingDataFromUserInput()

SurveyTextQuestion::getWorkingDataFromUserInput ( array  $post_data)

Definition at line 218 of file class.SurveyTextQuestion.php.

References $data, and SurveyQuestion\getId().

220  : array {
221  $entered_value = $post_data[$this->getId() . "_text_question"] ?? "";
222  $data = array();
223  if (strlen($entered_value ?? "")) {
224  $data[] = array("textanswer" => $entered_value);
225  }
226  return $data;
227  }
+ Here is the call graph for this function:

◆ importResponses()

SurveyTextQuestion::importResponses ( array  $a_data)

Definition at line 291 of file class.SurveyTextQuestion.php.

References $data, SurveyQuestion\$id, setMaxChars(), setTextHeight(), and setTextWidth().

291  : void
292  {
293  foreach ($a_data as $id => $data) {
294  if ($data["maxlength"] > 0) {
295  $this->setMaxChars($data["maxlength"]);
296  }
297  if ($data["rows"] > 0) {
298  $this->setTextHeight($data["rows"]);
299  }
300  if ($data["columns"] > 0) {
301  $this->setTextWidth($data["columns"]);
302  }
303  }
304  }
setTextHeight(?int $a_textheight=null)
setTextWidth(?int $a_textwidth=null)
+ Here is the call graph for this function:

◆ insertXML()

SurveyTextQuestion::insertXML ( ilXmlWriter  $a_xml_writer,
  $a_include_header = true 
)

Definition at line 153 of file class.SurveyTextQuestion.php.

References SurveyQuestion\addMaterialTag(), SurveyQuestion\getAuthor(), SurveyQuestion\getDescription(), SurveyQuestion\getId(), getMaxChars(), SurveyQuestion\getObligatory(), SurveyQuestion\getQuestiontext(), getQuestionType(), getTextHeight(), getTextWidth(), SurveyQuestion\getTitle(), IL_INST_ID, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by toXML().

156  : void {
157  $attrs = array(
158  "id" => $this->getId(),
159  "title" => $this->getTitle(),
160  "type" => $this->getQuestionType(),
161  "obligatory" => $this->getObligatory()
162  );
163  $a_xml_writer->xmlStartTag("question", $attrs);
164 
165  $a_xml_writer->xmlElement("description", null, $this->getDescription());
166  $a_xml_writer->xmlElement("author", null, $this->getAuthor());
167  if (strlen($this->label ?? "")) {
168  $attrs = array(
169  "label" => $this->label,
170  );
171  } else {
172  $attrs = array();
173  }
174  $a_xml_writer->xmlStartTag("questiontext", $attrs);
175  $this->addMaterialTag($a_xml_writer, $this->getQuestiontext());
176  $a_xml_writer->xmlEndTag("questiontext");
177 
178  $a_xml_writer->xmlStartTag("responses");
179  $attrs = array(
180  "id" => "0",
181  "rows" => $this->getTextHeight(),
182  "columns" => $this->getTextWidth()
183  );
184  if ($this->getMaxChars() > 0) {
185  $attrs["maxlength"] = $this->getMaxChars();
186  }
187  $a_xml_writer->xmlElement("response_text", $attrs);
188  $a_xml_writer->xmlEndTag("responses");
189 
190  if (count($this->material)) {
191  if (preg_match("/il_(\d*?)_(\w+)_(\d+)/", $this->material["internal_link"], $matches)) {
192  $attrs = array(
193  "label" => $this->material["title"]
194  );
195  $a_xml_writer->xmlStartTag("material", $attrs);
196  $intlink = "il_" . IL_INST_ID . "_" . $matches[2] . "_" . $matches[3];
197  if (strcmp($matches[1], "") != 0) {
198  $intlink = $this->material["internal_link"];
199  }
200  $a_xml_writer->xmlElement("mattext", null, $intlink);
201  $a_xml_writer->xmlEndTag("material");
202  }
203  }
204 
205  $a_xml_writer->xmlEndTag("question");
206  }
const IL_INST_ID
Definition: constants.php:40
xmlEndTag(string $tag)
Writes an endtag.
addMaterialTag(ilXmlWriter $a_xml_writer, string $a_material, bool $close_material_tag=true, bool $add_mobs=true, ?array $a_attrs=null)
Creates an XML material tag from a plain text or xhtml text.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isComplete()

SurveyTextQuestion::isComplete ( )

Definition at line 95 of file class.SurveyTextQuestion.php.

References SurveyQuestion\getAuthor(), SurveyQuestion\getQuestiontext(), and SurveyQuestion\getTitle().

95  : bool
96  {
97  if (
98  strlen($this->getTitle() ?? "") &&
99  strlen($this->getAuthor() ?? "") &&
100  strlen($this->getQuestiontext() ?? "")
101  ) {
102  return true;
103  } else {
104  return false;
105  }
106  }
+ Here is the call graph for this function:

◆ loadFromDb()

SurveyTextQuestion::loadFromDb ( int  $question_id)

Definition at line 65 of file class.SurveyTextQuestion.php.

References $data, SurveyQuestion\$db, $ilDB, ilRTE\_replaceMediaObjectImageSrc(), getAdditionalTableName(), SurveyQuestion\setAuthor(), SurveyQuestion\setComplete(), SurveyQuestion\setDescription(), SurveyQuestion\setId(), setMaxChars(), SurveyQuestion\setObjId(), SurveyQuestion\setObligatory(), SurveyQuestion\setOriginalId(), SurveyQuestion\setOwner(), SurveyQuestion\setQuestiontext(), setTextHeight(), setTextWidth(), and SurveyQuestion\setTitle().

65  : void
66  {
67  $ilDB = $this->db;
68 
69  $result = $ilDB->queryF(
70  "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",
71  array('integer'),
72  array($question_id)
73  );
74  if ($result->numRows() === 1) {
75  $data = $ilDB->fetchAssoc($result);
76  $this->setId((int) $data["question_id"]);
77  $this->setTitle((string) $data["title"]);
78  $this->label = (string) $data['label'];
79  $this->setDescription((string) $data["description"]);
80  $this->setObjId((int) $data["obj_fi"]);
81  $this->setAuthor((string) $data["author"]);
82  $this->setOwner((int) $data["owner_fi"]);
83  $this->setQuestiontext(ilRTE::_replaceMediaObjectImageSrc((string) $data["questiontext"], 1));
84  $this->setObligatory((bool) $data["obligatory"]);
85  $this->setComplete((bool) $data["complete"]);
86  $this->setOriginalId((int) $data["original_id"]);
87 
88  $this->setMaxChars((int) $data["maxchars"]);
89  $this->setTextWidth($data["width"] ? (int) $data["width"] : null);
90  $this->setTextHeight($data["height"] ? (int) $data["height"] : null);
91  }
92  parent::loadFromDb($question_id);
93  }
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...
setQuestiontext(string $questiontext="")
setTextHeight(?int $a_textheight=null)
setObligatory(bool $obligatory=true)
setOriginalId(?int $original_id)
setComplete(bool $a_complete)
setAuthor(string $author="")
setTitle(string $title="")
setTextWidth(?int $a_textwidth=null)
setOwner(int $owner=0)
setDescription(string $description="")
setObjId(int $obj_id=0)
Set the reference(?) id of the container object.
+ Here is the call graph for this function:

◆ saveToDb()

SurveyTextQuestion::saveToDb ( int  $original_id = 0)

Definition at line 118 of file class.SurveyTextQuestion.php.

References SurveyQuestion\$db, $ilDB, SurveyQuestion\$original_id, getAdditionalTableName(), SurveyQuestion\getId(), getMaxChars(), getTextHeight(), and getTextWidth().

118  : int
119  {
120  $ilDB = $this->db;
121 
122  $affectedRows = parent::saveToDb($original_id);
123  if ($affectedRows === 1) {
124  $ilDB->manipulateF(
125  "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
126  array('integer'),
127  array($this->getId())
128  );
129  $ilDB->manipulateF(
130  "INSERT INTO " . $this->getAdditionalTableName() . " (question_fi, maxchars, width, height) VALUES (%s, %s, %s, %s)",
131  array('integer', 'integer', 'integer', 'integer'),
132  array($this->getId(), $this->getMaxChars(), $this->getTextWidth(), $this->getTextHeight())
133  );
134  }
135  return $affectedRows;
136  }
+ Here is the call graph for this function:

◆ saveUserInput()

SurveyTextQuestion::saveUserInput ( array  $post_data,
int  $active_id,
bool  $a_return = false 
)

Definition at line 255 of file class.SurveyTextQuestion.php.

References SurveyQuestion\$db, $ilDB, SurveyQuestion\getId(), getMaxChars(), SurveyQuestion\stripSlashesAddSpaceFallback(), and ilStr\subStr().

259  : ?array {
260  $ilDB = $this->db;
261 
262  $entered_value = $this->stripSlashesAddSpaceFallback($post_data[$this->getId() . "_text_question"]);
263  $maxchars = $this->getMaxChars();
264 
265  if ($maxchars > 0) {
266  $entered_value = ilStr::subStr($entered_value, 0, $maxchars);
267  }
268 
269  if ($a_return) {
270  return array(array("value" => null, "textanswer" => $entered_value));
271  }
272  if (strlen($entered_value ?? "") == 0) {
273  return null;
274  }
275 
276  $next_id = $ilDB->nextId('svy_answer');
277  #20216
278  $fields = array();
279  $fields['answer_id'] = array("integer", $next_id);
280  $fields['question_fi'] = array("integer", $this->getId());
281  $fields['active_fi'] = array("integer", $active_id);
282  $fields['value'] = array("float", null);
283  $fields['textanswer'] = array("clob", (strlen($entered_value ?? "")) ? $entered_value : null);
284  $fields['tstamp'] = array("integer", time());
285 
286  $ilDB->insert("svy_answer", $fields);
287 
288  return null;
289  }
static subStr(string $a_str, int $a_start, ?int $a_length=null)
Definition: class.ilStr.php:24
stripSlashesAddSpaceFallback(string $a_str)
Strip slashes with add space fallback, see https://mantis.ilias.de/view.php?id=19727 and https://mant...
+ Here is the call graph for this function:

◆ setMaxChars()

SurveyTextQuestion::setMaxChars ( int  $maxchars = 0)

Definition at line 108 of file class.SurveyTextQuestion.php.

References $maxchars.

Referenced by importResponses(), and loadFromDb().

108  : void
109  {
110  $this->maxchars = $maxchars;
111  }
+ Here is the caller graph for this function:

◆ setTextHeight()

SurveyTextQuestion::setTextHeight ( ?int  $a_textheight = null)

Definition at line 330 of file class.SurveyTextQuestion.php.

Referenced by importResponses(), and loadFromDb().

330  : void
331  {
332  if ($a_textheight < 1) {
333  $this->textheight = 5;
334  } else {
335  $this->textheight = $a_textheight;
336  }
337  }
+ Here is the caller graph for this function:

◆ setTextWidth()

SurveyTextQuestion::setTextWidth ( ?int  $a_textwidth = null)

Definition at line 321 of file class.SurveyTextQuestion.php.

Referenced by importResponses(), and loadFromDb().

321  : void
322  {
323  if ($a_textwidth < 1) {
324  $this->textwidth = 50;
325  } else {
326  $this->textwidth = $a_textwidth;
327  }
328  }
+ Here is the caller graph for this function:

◆ toXML()

SurveyTextQuestion::toXML ( bool  $a_include_header = true,
bool  $obligatory_state = false 
)

Definition at line 138 of file class.SurveyTextQuestion.php.

References insertXML().

141  : string {
142  $a_xml_writer = new ilXmlWriter();
143  $a_xml_writer->xmlHeader();
144  $this->insertXML($a_xml_writer, $a_include_header);
145  $xml = $a_xml_writer->xmlDumpMem(false);
146  if (!$a_include_header) {
147  $pos = strpos($xml, "?>");
148  $xml = substr($xml, $pos + 2);
149  }
150  return $xml;
151  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertXML(ilXmlWriter $a_xml_writer, $a_include_header=true)
+ Here is the call graph for this function:

◆ usableForPrecondition()

SurveyTextQuestion::usableForPrecondition ( )

Definition at line 306 of file class.SurveyTextQuestion.php.

306  : bool
307  {
308  return false;
309  }

Field Documentation

◆ $maxchars

int SurveyTextQuestion::$maxchars = null
protected

Definition at line 29 of file class.SurveyTextQuestion.php.

Referenced by getMaxChars(), and setMaxChars().

◆ $textheight

int SurveyTextQuestion::$textheight = null
protected

Definition at line 31 of file class.SurveyTextQuestion.php.

Referenced by getTextHeight().

◆ $textwidth

int SurveyTextQuestion::$textwidth = null
protected

Definition at line 30 of file class.SurveyTextQuestion.php.

Referenced by getTextWidth().


The documentation for this class was generated from the following file: