32 $this->lng = $DIC->language();
33 $this->question = $a_question;
43 $this->users_answered = (int) $a_value;
53 $this->users_skipped = (int) $a_value;
61 public function setMode($a_value, $a_nr_of_selections)
63 $this->mode_value = is_array($a_value)
66 $this->mode_nr_of_selections = (int) $a_nr_of_selections;
76 if ($this->mode_value === null) {
83 if (!is_array($mvalues)) {
84 $mvalues = array($mvalues);
86 sort($mvalues, SORT_NUMERIC);
87 foreach ($mvalues as $value) {
91 return implode(
", ",
$res);
101 $this->arithmetic_mean = (float) $a_mean;
111 $this->median = is_array($a_value)
125 if ($this->median === null) {
129 if (!is_array($this->median)) {
132 return $lng->txt(
"median_between") .
" " .
134 $lng->txt(
"and") .
" " .
141 $this->variables[] = $a_variable;
146 if (
sizeof($this->variables)) {
153 $this->answers[] = $a_answer;
158 if (
sizeof($this->answers)) {
166 if (!
sizeof($this->variables)) {
169 foreach ($this->variables as $var) {
170 if ($var->cat->scale == $a_value) {
171 return $var->cat->title .
" [" . $a_value .
"]";
179 if (!
sizeof($this->variables)) {
182 foreach ($this->variables as $var) {
183 if ($var->cat->scale == $a_value) {
184 return $var->cat->title;
194 foreach ($this->answers as $answer) {
210 if ($answer->active_id == $a_active_id) {
215 $this->getCatTitle($answer->value)
234 $this->abs = (int) $a_abs;
235 $this->perc = (float) $a_perc;
247 $this->active_id = (int) $a_active_id;
248 $this->value = $a_value;
249 $this->text = trim($a_text);
__construct(ilSurveyCategory $a_cat, $a_abs, $a_perc)
Survey evaluation answers.
foreach($_POST as $key=> $value) $res
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)
__construct($a_active_id, $a_value, $a_text)
__construct(SurveyQuestion $a_question)
addAnswer(ilSurveyEvaluationResultsAnswer $a_answer)
setUsersSkipped($a_value)