24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
43 public function __construct($a_parent_obj, $a_parent_cmd, $detail)
45 $this->
setId(
"svy_cum");
53 $this->totalcount = 0;
56 $this->
setStyle(
'table',
'fullwidth');
58 $this->
addColumn($this->lng->txt(
"title"),
'counter',
'');
61 if (strcmp($c,
'question') == 0) $this->
addColumn($this->lng->txt(
"question"),
'question',
'');
62 if (strcmp($c,
'question_type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'question_type',
'');
63 if (strcmp($c,
'users_answered') == 0) $this->
addColumn($this->lng->txt(
"users_answered"),
'users_answered',
'');
64 if (strcmp($c,
'users_skipped') == 0) $this->
addColumn($this->lng->txt(
"users_skipped"),
'users_skipped',
'');
65 if (strcmp($c,
'mode') == 0) $this->
addColumn($this->lng->txt(
"mode"),
'mode',
'');
66 if (strcmp($c,
'mode_nr_of_selections') == 0) $this->
addColumn($this->lng->txt(
"mode_nr_of_selections"),
'mode_nr_of_selections',
'');
67 if (strcmp($c,
'median') == 0) $this->
addColumn($this->lng->txt(
"median"),
'median',
'');
68 if (strcmp($c,
'arithmetic_mean') == 0) $this->
addColumn($this->lng->txt(
"arithmetic_mean"),
'arithmetic_mean',
'');
71 $this->
setRowTemplate(
"tpl.il_svy_svy_results_cumulated_row.html",
"Modules/Survey");
73 $this->
addCommandButton(
'printEvaluation', $this->lng->txt(
'print'),
'javascript:window.print(); return false;');
75 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
88 $cols[
"question"] = array(
89 "txt" => $lng->txt(
"question"),
92 $cols[
"question_type"] = array(
93 "txt" => $lng->txt(
"question_type"),
96 $cols[
"users_answered"] = array(
97 "txt" => $lng->txt(
"users_answered"),
100 $cols[
"users_skipped"] = array(
101 "txt" => $lng->txt(
"users_skipped"),
104 $cols[
"mode"] = array(
105 "txt" => $lng->txt(
"mode"),
108 $cols[
"mode_nr_of_selections"] = array(
109 "txt" => $lng->txt(
"mode_nr_of_selections"),
112 $cols[
"median"] = array(
113 "txt" => $lng->txt(
"median"),
116 $cols[
"arithmetic_mean"] = array(
117 "txt" => $lng->txt(
"arithmetic_mean"),
125 return !in_array($a_field, array(
"question",
"question_type"));
137 $this->tpl->setVariable(
"TITLE",
$data[
'title']);
141 if (strcmp($c,
'question') == 0)
143 $this->tpl->setCurrentBlock(
'question');
144 $this->tpl->setVariable(
"QUESTION",
$data[
'question']);
145 $this->tpl->parseCurrentBlock();
147 if (strcmp($c,
'question_type') == 0)
149 $this->tpl->setCurrentBlock(
'question_type');
150 $this->tpl->setVariable(
"QUESTION_TYPE",
$data[
'question_type']);
151 $this->tpl->parseCurrentBlock();
153 if (strcmp($c,
'users_answered') == 0)
155 $this->tpl->setCurrentBlock(
'users_answered');
156 $this->tpl->setVariable(
"USERS_ANSWERED",
$data[
'users_answered']);
157 $this->tpl->parseCurrentBlock();
159 if (strcmp($c,
'users_skipped') == 0)
161 $this->tpl->setCurrentBlock(
'users_skipped');
162 $this->tpl->setVariable(
"USERS_SKIPPED",
$data[
'users_skipped']);
163 $this->tpl->parseCurrentBlock();
165 if (strcmp($c,
'mode') == 0)
167 $this->tpl->setCurrentBlock(
'mode');
168 $this->tpl->setVariable(
"MODE",
$data[
'mode']);
169 $this->tpl->parseCurrentBlock();
171 if (strcmp($c,
'mode_nr_of_selections') == 0)
173 $this->tpl->setCurrentBlock(
'mode_nr_of_selections');
174 $this->tpl->setVariable(
"MODE_NR_OF_SELECTIONS", strlen(
$data[
'mode_nr_of_selections']) ?
$data[
'mode_nr_of_selections'] : 0);
175 $this->tpl->parseCurrentBlock();
177 if (strcmp($c,
'median') == 0)
179 $this->tpl->setCurrentBlock(
'median');
180 $this->tpl->setVariable(
"MEDIAN",
$data[
'median']);
181 $this->tpl->parseCurrentBlock();
183 if (strcmp($c,
'arithmetic_mean') == 0)
185 $this->tpl->setCurrentBlock(
'arithmetic_mean');
186 $this->tpl->setVariable(
"ARITHMETIC_MEAN",
$data[
'arithmetic_mean']);
187 $this->tpl->parseCurrentBlock();
191 if(
$data[
"subitems"])
193 $this->tpl->setCurrentBlock(
"tbl_content");
194 $this->tpl->parseCurrentBlock();
196 foreach(
$data[
"subitems"] as $subitem)
200 $this->tpl->setCurrentBlock(
"tbl_content");
201 $this->css_row = ($this->css_row !=
"tblrow1")
204 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
205 $this->tpl->parseCurrentBlock();