46         $maxchars->setRequired(
false);
    47         $maxchars->setSize(5);
    48         $maxchars->setDecimals(0);
    53         $textwidth->setRequired(
true);
    54         $textwidth->setSize(3);
    55         $textwidth->setDecimals(0);
    56         $textwidth->setMinValue(10, 
true);
    61         $textheight->setRequired(
true);
    62         $textheight->setSize(3);
    64         $textheight->setDecimals(0);
    65         $textheight->setMinValue(1);
    69         if ($this->
object->getMaxChars() > 0) {
    70             $maxchars->setValue($this->
object->getMaxChars());
    72         $textwidth->setValue($this->
object->getTextWidth());
    73         $textheight->setValue($this->
object->getTextHeight());
    78         $max = $a_form->
getInput(
"maxchars");
    79         $this->
object->setMaxChars((
int) $max);
    80         $this->
object->setTextWidth($a_form->
getInput(
"textwidth"));
    81         $this->
object->setTextHeight($a_form->
getInput(
"textheight"));
    85         array $a_working_data = null,
    86         $a_only_user_anwers = 
false    89         if (is_array($a_working_data) && isset($a_working_data[0])) {
    90             $res[] = array(
"textanswer" => trim($a_working_data[0][
"textanswer"] ?? 
""));
    97         int $question_title = 1,
    98         bool $show_questiontext = 
true,
    99         ?
int $survey_id = null,
   100         ?array $working_data = null
   105             $user_answer = $user_answer[0][
"textanswer"];
   108         $template = 
new ilTemplate(
"tpl.il_svy_qpl_text_printview.html", 
true, 
true, 
"Modules/SurveyQuestionPool");
   109         if ($show_questiontext) {
   112         if ($question_title) {
   115         $template->setVariable(
"QUESTION_ID", $this->
object->getId());
   116         $template->setVariable(
"TEXT_ANSWER", $this->
lng->txt(
"answer"));
   117         if (is_array($working_data) && trim($user_answer)) {
   118             $template->setVariable(
"TEXT", nl2br($user_answer));
   121             $template->setVariable(
"TEXTBOX", $this->
lng->txt(
"textbox"));
   122             $template->setVariable(
"TEXTBOX_WIDTH", $this->
object->getTextWidth() * 16);
   123             $template->setVariable(
"TEXTBOX_HEIGHT", $this->
object->getTextHeight() * 16);
   125         if ($this->
object->getMaxChars()) {
   126             $template->setVariable(
"TEXT_MAXCHARS", sprintf($this->
lng->txt(
"text_maximum_chars_allowed"), $this->
object->getMaxChars()));
   128         return $template->get();
   140         array $working_data = null,
   141         int $question_title = 1,
   142         bool $show_questiontext = 
true,
   143         string $error_message = 
"",
   144         int $survey_id = null,
   145         bool $compress_view = 
false   147         $template = 
new ilTemplate(
"tpl.il_svy_out_text.html", 
true, 
true, 
"Modules/SurveyQuestionPool");
   149         if ($this->
object->getTextHeight() === 1) {
   150             $template->setCurrentBlock(
"textinput");
   151             if (is_array($working_data)) {
   152                 if (isset($working_data[0][
"textanswer"])) {
   156             $template->setVariable(
"QUESTION_ID", $this->
object->getId());
   157             $template->setVariable(
"WIDTH", $this->
object->getTextWidth());
   158             if ($this->
object->getMaxChars()) {
   159                 $template->setVariable(
"MAXLENGTH", 
" maxlength=\"" . $this->
object->getMaxChars() . 
"\"");
   162             $template->setCurrentBlock(
"textarea");
   163             if (is_array($working_data) && isset($working_data[0][
"textanswer"])) {
   166             $template->setVariable(
"QUESTION_ID", $this->
object->getId());
   167             $template->setVariable(
"WIDTH", $this->
object->getTextWidth());
   168             $template->setVariable(
"HEIGHT", $this->
object->getTextHeight());
   170         $template->parseCurrentBlock();
   171         $template->setCurrentBlock(
"question_data_text");
   172         if ($show_questiontext) {
   175         $template->setVariable(
"QUESTION_TITLE", $this->
getQuestionTitle($question_title));
   176         $template->setVariable(
"TEXT_ANSWER", $this->
lng->txt(
"answer"));
   177         $template->setVariable(
"LABEL_QUESTION_ID", $this->
object->getId());
   178         if (strcmp($error_message, 
"") !== 0) {
   179             $template->setVariable(
"ERROR_MESSAGE", 
"<p class=\"warning\">$error_message</p>");
   181         if ($this->
object->getMaxChars()) {
   182             $template->setVariable(
"TEXT_MAXCHARS", sprintf($this->
lng->txt(
"text_maximum_chars_allowed"), $this->
object->getMaxChars()));
   184         $template->parseCurrentBlock();
   185         return $template->get();
 addFieldsToEditForm(ilPropertyFormGUI $a_form)
 
getQuestionTitle(int $question_title_mode=1)
 
getPrintView(int $question_title=1, bool $show_questiontext=true, ?int $survey_id=null, ?array $working_data=null)
 
getPrintViewQuestionTitle(int $question_title=1)
 
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
outQuestionText(ilTemplate $template)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setQuestionTabsForClass(string $guiclass)
 
static getHtmlPath(string $relative_path)
get url of path 
 
getParsedAnswers(array $a_working_data=null, $a_only_user_anwers=false)
 
getWorkingForm(array $working_data=null, int $question_title=1, bool $show_questiontext=true, string $error_message="", int $survey_id=null, bool $compress_view=false)
Creates the question output form for the learner. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
importEditFormValues(ilPropertyFormGUI $a_form)
 
Basic class for all survey question types The SurveyQuestionGUI class defines and encapsulates basic ...