24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
47 $this->
setId(
"svy_cum");
48 parent::__construct($a_parent_obj, $a_parent_cmd);
53 $this->
addColumn($this->lng->txt(
"title"));
56 if (strcmp($c,
'question') == 0) $this->
addColumn($this->lng->txt(
"question"));
57 if (strcmp($c,
'question_type') == 0) $this->
addColumn($this->lng->txt(
"question_type"));
58 if (strcmp($c,
'users_answered') == 0) $this->
addColumn($this->lng->txt(
"users_answered"));
59 if (strcmp($c,
'users_skipped') == 0) $this->
addColumn($this->lng->txt(
"users_skipped"));
60 if (strcmp($c,
'mode') == 0) $this->
addColumn($this->lng->txt(
"mode"));
61 if (strcmp($c,
'mode_nr_of_selections') == 0) $this->
addColumn($this->lng->txt(
"mode_nr_of_selections"));
62 if (strcmp($c,
'median') == 0) $this->
addColumn($this->lng->txt(
"median"));
63 if (strcmp($c,
'arithmetic_mean') == 0) $this->
addColumn($this->lng->txt(
"arithmetic_mean"));
66 $this->
setRowTemplate(
"tpl.il_svy_svy_results_cumulated_row.html",
"Modules/Survey");
67 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
76 $cols[
"question"] =
array(
77 "txt" => $lng->txt(
"question"),
80 $cols[
"question_type"] =
array(
81 "txt" => $lng->txt(
"question_type"),
84 $cols[
"users_answered"] =
array(
85 "txt" => $lng->txt(
"users_answered"),
88 $cols[
"users_skipped"] =
array(
89 "txt" => $lng->txt(
"users_skipped"),
92 $cols[
"mode"] =
array(
93 "txt" => $lng->txt(
"mode"),
96 $cols[
"mode_nr_of_selections"] =
array(
97 "txt" => $lng->txt(
"mode_nr_of_selections"),
100 $cols[
"median"] =
array(
101 "txt" => $lng->txt(
"median"),
104 $cols[
"arithmetic_mean"] =
array(
105 "txt" => $lng->txt(
"arithmetic_mean"),
115 foreach($a_results as $question_res)
126 if(!is_array($question_res))
128 $question = $question_res->getQuestion();
131 "title" => $question->getTitle(),
132 "question" => $question->getQuestiontext(),
134 "users_answered" => $question_res->getUsersAnswered(),
135 "users_skipped" => $question_res->getUsersSkipped(),
136 "mode" => $question_res->getModeValueAsText(),
137 "mode_nr_of_selections" => $question_res->getModeNrOfSelections(),
138 "median" => $question_res->getMedianAsText(),
139 "arithmetic_mean" => $question_res->getMean()
148 foreach($question_res as $idx => $item)
150 $row_title = $item[0];
152 $question = $row_res->getQuestion();
155 "title" => $question->getTitle(),
156 "question" => $row_title,
158 "users_answered" => $row_res->getUsersAnswered(),
159 "users_skipped" => $row_res->getUsersSkipped(),
160 "mode" => $row_res->getModeValueAsText(),
161 "mode_nr_of_selections" => $row_res->getModeNrOfSelections(),
162 "median" => $row_res->getMedianAsText(),
163 "arithmetic_mean" => $row_res->getMean()
174 return !in_array($a_field,
array(
"question",
"question_type"));
186 $this->tpl->setVariable(
"TITLE",
$data[
'title']);
190 if (strcmp($c,
'question') == 0)
192 $this->tpl->setCurrentBlock(
'question');
193 $this->tpl->setVariable(
"QUESTION",
$data[
'question']);
194 $this->tpl->parseCurrentBlock();
196 if (strcmp($c,
'question_type') == 0)
198 $this->tpl->setCurrentBlock(
'question_type');
199 $this->tpl->setVariable(
"QUESTION_TYPE", trim(
$data[
'question_type']));
200 $this->tpl->parseCurrentBlock();
202 if (strcmp($c,
'users_answered') == 0)
204 $this->tpl->setCurrentBlock(
'users_answered');
205 $this->tpl->setVariable(
"USERS_ANSWERED", trim(
$data[
'users_answered']));
206 $this->tpl->parseCurrentBlock();
208 if (strcmp($c,
'users_skipped') == 0)
210 $this->tpl->setCurrentBlock(
'users_skipped');
211 $this->tpl->setVariable(
"USERS_SKIPPED", trim(
$data[
'users_skipped']));
212 $this->tpl->parseCurrentBlock();
214 if (strcmp($c,
'mode') == 0)
216 $this->tpl->setCurrentBlock(
'mode');
217 $this->tpl->setVariable(
"MODE", trim(
$data[
'mode']));
219 $this->tpl->parseCurrentBlock();
221 if (strcmp($c,
'mode_nr_of_selections') == 0)
223 $this->tpl->setCurrentBlock(
'mode_nr_of_selections');
224 $this->tpl->setVariable(
"MODE_NR_OF_SELECTIONS", trim(
$data[
'mode_nr_of_selections']));
226 $this->tpl->parseCurrentBlock();
228 if (strcmp($c,
'median') == 0)
230 $this->tpl->setCurrentBlock(
'median');
231 $this->tpl->setVariable(
"MEDIAN", trim(
$data[
'median']));
233 $this->tpl->parseCurrentBlock();
235 if (strcmp($c,
'arithmetic_mean') == 0)
237 $this->tpl->setCurrentBlock(
'arithmetic_mean');
238 $this->tpl->setVariable(
"ARITHMETIC_MEAN", trim(
$data[
'arithmetic_mean']));
240 $this->tpl->parseCurrentBlock();
numericOrdering($a_field)
getItems(array $a_results)
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
getSelectedColumns()
Get selected columns.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
__construct($a_parent_obj, $a_parent_cmd, array $a_results)
Constructor.