31 $lng = $DIC->language();
32 $ilCtrl = $DIC->ctrl();
34 $this->
setId(
"svy_cum");
38 $this->
ctrl = $ilCtrl;
42 if (strcmp(
$c,
'question') === 0) {
45 if (strcmp(
$c,
'question_type') === 0) {
48 if (strcmp(
$c,
'users_answered') === 0) {
51 if (strcmp(
$c,
'users_skipped') === 0) {
54 if (strcmp(
$c,
'mode') === 0) {
57 if (strcmp(
$c,
'mode_nr_of_selections') === 0) {
58 $this->
addColumn($this->
lng->txt(
"mode_nr_of_selections"));
60 if (strcmp(
$c,
'median') === 0) {
63 if (strcmp(
$c,
'arithmetic_mean') === 0) {
69 "tpl.il_svy_svy_results_cumulated_row.html",
70 "Modules/Survey/Evaluation" 81 $cols[
"question"] = array(
85 $cols[
"question_type"] = array(
86 "txt" =>
$lng->
txt(
"question_type"),
89 $cols[
"users_answered"] = array(
90 "txt" =>
$lng->
txt(
"users_answered"),
93 $cols[
"users_skipped"] = array(
94 "txt" =>
$lng->
txt(
"users_skipped"),
97 $cols[
"mode"] = array(
101 $cols[
"mode_nr_of_selections"] = array(
102 "txt" =>
$lng->
txt(
"mode_nr_of_selections"),
105 $cols[
"median"] = array(
109 $cols[
"arithmetic_mean"] = array(
110 "txt" =>
$lng->
txt(
"arithmetic_mean"),
121 foreach ($a_results as $question_res) {
122 if (!is_array($question_res)) {
123 $question = $question_res->getQuestion();
126 "title" => $question->getTitle(),
127 "question" => strip_tags($question->getQuestiontext()),
129 "users_answered" => $question_res->getUsersAnswered(),
130 "users_skipped" => $question_res->getUsersSkipped(),
131 "mode" => $question_res->getModeValueAsText(),
132 "mode_nr_of_selections" => $question_res->getModeNrOfSelections(),
133 "median" => $question_res->getMedianAsText(),
134 "arithmetic_mean" => $question_res->getMean()
142 foreach ($question_res as $idx => $item) {
143 $row_title = $item[0];
145 $question = $row_res->getQuestion();
148 "title" => $question->getTitle(),
149 "question" => $row_title,
151 "users_answered" => $row_res->getUsersAnswered(),
152 "users_skipped" => $row_res->getUsersSkipped(),
153 "mode" => $row_res->getModeValueAsText(),
154 "mode_nr_of_selections" => $row_res->getModeNrOfSelections(),
155 "median" => $row_res->getMedianAsText(),
156 "arithmetic_mean" => $row_res->getMean()
167 return !in_array($a_field, array(
"question",
"question_type"));
170 protected function fillRow(array $a_set): void
172 $this->tpl->setVariable(
"TITLE", $a_set[
'title']);
175 if (strcmp($c,
'question') === 0) {
176 $this->tpl->setCurrentBlock(
'question');
177 $this->tpl->setVariable(
"QUESTION", $a_set[
'question']);
178 $this->tpl->parseCurrentBlock();
180 if (strcmp($c,
'question_type') === 0) {
181 $this->tpl->setCurrentBlock(
'question_type');
182 $this->tpl->setVariable(
"QUESTION_TYPE", trim($a_set[
'question_type']));
183 $this->tpl->parseCurrentBlock();
185 if (strcmp($c,
'users_answered') === 0) {
186 $this->tpl->setCurrentBlock(
'users_answered');
187 $this->tpl->setVariable(
"USERS_ANSWERED", trim($a_set[
'users_answered']));
188 $this->tpl->parseCurrentBlock();
190 if (strcmp($c,
'users_skipped') === 0) {
191 $this->tpl->setCurrentBlock(
'users_skipped');
192 $this->tpl->setVariable(
"USERS_SKIPPED", trim($a_set[
'users_skipped']));
193 $this->tpl->parseCurrentBlock();
195 if (strcmp($c,
'mode') === 0) {
196 $this->tpl->setCurrentBlock(
'mode');
197 $this->tpl->setVariable(
"MODE", trim($a_set[
'mode']));
199 $this->tpl->parseCurrentBlock();
201 if (strcmp($c,
'mode_nr_of_selections') === 0) {
202 $this->tpl->setCurrentBlock(
'mode_nr_of_selections');
203 $this->tpl->setVariable(
"MODE_NR_OF_SELECTIONS", trim($a_set[
'mode_nr_of_selections']));
205 $this->tpl->parseCurrentBlock();
207 if (strcmp($c,
'median') === 0) {
208 $this->tpl->setCurrentBlock(
'median');
209 $this->tpl->setVariable(
"MEDIAN", trim($a_set[
'median']));
211 $this->tpl->parseCurrentBlock();
213 if (strcmp($c,
'arithmetic_mean') === 0) {
214 $this->tpl->setCurrentBlock(
'arithmetic_mean');
215 $this->tpl->setVariable(
"ARITHMETIC_MEAN", trim($a_set[
'arithmetic_mean']));
217 $this->tpl->parseCurrentBlock();
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setFormAction(string $a_form_action, bool $a_multipart=false)
getItems(array $a_results)
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
numericOrdering(string $a_field)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
__construct(object $a_parent_obj, string $a_parent_cmd, array $a_results)
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)