24 $this->question = $a_question;
34 $this->users_answered = (int)$a_value;
44 $this->users_skipped = (int)$a_value;
52 public function setMode($a_value, $a_nr_of_selections)
54 $this->mode_value = is_array($a_value)
57 $this->mode_nr_of_selections = (int)$a_nr_of_selections;
67 if($this->mode_value === null)
75 if(!is_array($mvalues))
77 $mvalues =
array($mvalues);
79 sort($mvalues, SORT_NUMERIC);
80 foreach($mvalues as $value)
85 return implode(
", ",
$res);
95 $this->arithmetic_mean = (float)$a_mean;
105 $this->median = is_array($a_value)
119 if($this->median === null)
124 if(!is_array($this->median))
130 return $lng->txt(
"median_between").
" ".
132 $lng->txt(
"and").
" ".
139 $this->variables[] = $a_variable;
144 if(
sizeof($this->variables))
152 $this->answers[] = $a_answer;
157 if(
sizeof($this->answers))
165 if(!
sizeof($this->variables))
171 foreach($this->variables as $var)
173 if($var->cat->scale == $a_value)
175 return $var->cat->title.
" [".$a_value.
"]";
183 if(!
sizeof($this->variables))
189 foreach($this->variables as $var)
191 if($var->cat->scale == $a_value)
193 return $var->cat->title;
203 foreach($this->answers as $answer)
223 if($answer->active_id == $a_active_id)
229 $this->getCatTitle($answer->value)
248 $this->abs = (int)$a_abs;
249 $this->perc = (float)$a_perc;
261 $this->active_id = (int)$a_active_id;
262 $this->value = $a_value;
263 $this->text = trim($a_text);
__construct(ilSurveyCategory $a_cat, $a_abs, $a_perc)
Survey evaluation answers.
Basic class for all survey question types.
addVariable(ilSurveyEvaluationResultsVariable $a_variable)
setMode($a_value, $a_nr_of_selections)
setUsersAnswered($a_value)
getUserResults($a_active_id)
Create styles array
The data for the language used.
__construct($a_active_id, $a_value, $a_text)
__construct(SurveyQuestion $a_question)
addAnswer(ilSurveyEvaluationResultsAnswer $a_answer)
setUsersSkipped($a_value)