51 $subtype->addOption($opt);
56 $minimum1->setSize(6);
57 $opt->addSubItem($minimum1);
62 $maximum1->setSize(6);
63 $opt->addSubItem($maximum1);
66 $subtype->addOption($opt);
71 $minimum2->setSize(6);
72 $minimum2->setMinValue(0);
73 $opt->addSubItem($minimum2);
78 $maximum2->setSize(6);
79 $opt->addSubItem($maximum2);
82 $subtype->addOption($opt);
87 $minimum3->setSize(6);
88 $minimum3->setMinValue(0);
89 $minimum3->setDecimals(0);
90 $opt->addSubItem($minimum3);
95 $maximum3->setRequired(
false);
96 $maximum3->setSize(6);
97 $opt->addSubItem($maximum3);
101 $subtype->setValue($this->
object->getSubtype());
103 switch ($this->
object->getSubtype()) {
105 $minimum1->setValue($this->
object->getMinimum());
106 $maximum1->setValue($this->
object->getMaximum());
110 $minimum2->setValue($this->
object->getMinimum());
111 $maximum2->setValue($this->
object->getMaximum());
115 $minimum3->setValue($this->
object->getMinimum());
116 $maximum3->setValue($this->
object->getMaximum());
124 $this->
object->setOrientation((
int) $a_form->
getInput(
"orientation"));
125 $this->
object->setSubtype((
int)
$type);
126 $min = ($a_form->
getInput(
"minimum" . $type) !=
"")
127 ? (
float) $a_form->
getInput(
"minimum" . $type)
129 $max = ($a_form->
getInput(
"maximum" . $type) !=
"")
130 ? (
float) $a_form->
getInput(
"maximum" . $type)
132 $this->
object->setMinimum($min);
133 $this->
object->setMaximum($max);
137 array $a_working_data = null,
138 $a_only_user_anwers =
false 142 if (is_array($a_working_data)) {
143 $res[] = array(
"value" => $a_working_data[0][
"value"]);
155 int $question_title = 1,
156 bool $show_questiontext =
true,
157 ?
int $survey_id = null,
158 ?array $working_data = null
163 $user_answer = $user_answer[0][
"value"];
165 $template =
new ilTemplate(
"tpl.il_svy_qpl_metric_printview.html",
true,
true,
"Modules/SurveyQuestionPool");
166 $template->setVariable(
"MIN_MAX", $this->
object->getMinMaxText());
168 if ($show_questiontext) {
171 if ($question_title) {
174 $template->setVariable(
"TEXT_ANSWER", $this->
lng->txt(
"answer"));
175 $template->setVariable(
"QUESTION_ID", $this->
object->getId());
177 if (!is_array($working_data) || !trim($user_answer)) {
179 $solution_text = str_repeat(
" ", 10);
181 $solution_text = $user_answer;
183 $template->setVariable(
"TEXT_SOLUTION", $solution_text);
185 $template->parseCurrentBlock();
186 return $template->get();
195 array $working_data = null,
196 int $question_title = 1,
197 bool $show_questiontext =
true,
198 string $error_message =
"",
199 int $survey_id = null,
200 bool $compress_view =
false 202 $template =
new ilTemplate(
"tpl.il_svy_out_metric.html",
true,
true,
"Modules/SurveyQuestionPool");
203 $template->setCurrentBlock(
"material_metric");
205 $template->parseCurrentBlock();
206 $template->setVariable(
"MIN_MAX", $this->
object->getMinMaxText());
208 if ($show_questiontext) {
211 $template->setVariable(
"QUESTION_TITLE", $this->
getQuestionTitle($question_title));
212 $template->setVariable(
"TEXT_ANSWER", $this->
lng->txt(
"answer"));
213 $template->setVariable(
"QUESTION_ID", $this->
object->getId());
214 if (is_array($working_data)) {
215 $template->setVariable(
"VALUE_METRIC", $working_data[0][
"value"] ??
"");
218 $template->setVariable(
"INPUT_SIZE", 10);
220 if (strcmp($error_message,
"") !== 0) {
221 $template->setVariable(
"ERROR_MESSAGE",
"<p class=\"warning\">$error_message</p>");
223 $template->parseCurrentBlock();
224 return $template->get();
const SUBTYPE_RATIO_NON_ABSOLUTE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMaterialOutput()
Creates the HTML output of the question material(s)
getQuestionTitle(int $question_title_mode=1)
getPrintViewQuestionTitle(int $question_title=1)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPrintView(int $question_title=1, bool $show_questiontext=true, ?int $survey_id=null, ?array $working_data=null)
Creates a HTML representation of the question Creates a HTML representation of the question...
outQuestionText(ilTemplate $template)
setQuestionTabsForClass(string $guiclass)
getParsedAnswers(array $a_working_data=null, $a_only_user_anwers=false)
addFieldsToEditForm(ilPropertyFormGUI $a_form)
const SUBTYPE_RATIO_ABSOLUTE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Basic class for all survey question types The SurveyQuestionGUI class defines and encapsulates basic ...
importEditFormValues(ilPropertyFormGUI $a_form)
getWorkingForm(array $working_data=null, int $question_title=1, bool $show_questiontext=true, string $error_message="", int $survey_id=null, bool $compress_view=false)