31 $this->lng = $DIC->language();
32 $this->question = $a_question;
42 $this->users_answered = (int) $a_value;
52 $this->users_skipped = (int) $a_value;
60 public function setMode($a_value, $a_nr_of_selections)
62 $this->mode_value = is_array($a_value)
65 $this->mode_nr_of_selections = (int) $a_nr_of_selections;
75 if ($this->mode_value === null) {
82 if (!is_array($mvalues)) {
83 $mvalues = array($mvalues);
85 sort($mvalues, SORT_NUMERIC);
86 foreach ($mvalues as $value) {
90 return implode(
", ",
$res);
100 $this->arithmetic_mean = (float) $a_mean;
110 $this->median = is_array($a_value)
124 if ($this->median === null) {
128 if (!is_array($this->median)) {
131 return $lng->txt(
"median_between") .
" " .
133 $lng->txt(
"and") .
" " .
140 $this->variables[] = $a_variable;
145 if (
sizeof($this->variables)) {
152 $this->answers[] = $a_answer;
157 if (
sizeof($this->answers)) {
165 if (!
sizeof($this->variables)) {
168 foreach ($this->variables as $var) {
169 if ($var->cat->scale == $a_value) {
170 return $var->cat->title .
" [" . $a_value .
"]";
178 if (!
sizeof($this->variables)) {
181 foreach ($this->variables as $var) {
182 if ($var->cat->scale == $a_value) {
183 return $var->cat->title;
193 foreach ($this->answers as $answer) {
209 if ($answer->active_id == $a_active_id) {
214 $this->getCatTitle($answer->value)
233 $this->abs = (int) $a_abs;
234 $this->perc = (float) $a_perc;
246 $this->active_id = (int) $a_active_id;
247 $this->value = $a_value;
248 $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)