47 $this->
lng = $DIC->language();
48 $this->question = $a_question;
58 $this->users_answered = $a_value;
68 $this->users_skipped = $a_value;
81 int $a_nr_of_selections
83 $this->mode_value = is_array($a_value)
85 : trim($a_value ??
"");
86 $this->mode_nr_of_selections = $a_nr_of_selections;
94 return $this->mode_value;
99 if ($this->mode_value ===
null) {
105 $mvalues = $this->mode_value;
106 if (!is_array($mvalues)) {
107 $mvalues = array($mvalues);
109 sort($mvalues, SORT_NUMERIC);
110 foreach ($mvalues as $value) {
111 $res[] = $this->getScaleText($value);
114 return implode(
", ",
$res);
119 return $this->mode_nr_of_selections;
124 $this->arithmetic_mean = $a_mean;
129 return $this->arithmetic_mean;
137 $this->median = is_array($a_value)
139 : trim($a_value ??
"");
147 return $this->median;
154 if ($this->median ===
null) {
158 if (!is_array($this->median)) {
159 return $this->getScaleText($this->median);
162 return $lng->txt(
"median_between") .
" " .
163 $this->getScaleText($this->median[0]) .
" " .
164 $lng->txt(
"and") .
" " .
165 $this->getScaleText($this->median[1]);
171 $this->variables[] = $a_variable;
176 return $this->variables ?? [];
182 $this->answers[] = $a_answer;
187 return $this->answers ?? [];
197 if (!count($this->variables)) {
200 foreach ($this->variables as $var) {
201 if ($var->cat->scale == $a_value) {
202 return $var->cat->title .
" [" . $a_value .
"]";
212 if (!count($this->variables)) {
215 foreach ($this->variables as $var) {
216 if ($var->cat->scale == $a_value) {
217 return $var->cat->title;
228 foreach ($this->answers as $answer) {
230 $res[$this->getScaleText($answer->value)][] = $answer->text;
242 $answers = $this->getAnswers();
244 foreach ($answers as $answer) {
245 if ($answer->active_id == $a_active_id) {
247 $this->getScaleText($answer->value),
250 $this->getCatTitle($answer->value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(SurveyQuestion $a_question)
getCatTitle(float $a_value)
int $mode_nr_of_selections
setUsersSkipped(int $a_value)
addVariable(ilSurveyEvaluationResultsVariable $a_variable)
addAnswer(ilSurveyEvaluationResultsAnswer $a_answer)
getUserResults(int $a_active_id)
setMode( $a_value, int $a_nr_of_selections)
setUsersAnswered(int $a_value)
if(!file_exists('../ilias.ini.php'))