24include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
 
   43    public function __construct($a_parent_obj, $a_parent_cmd, array $a_results)
 
   50        $this->
setId(
"svy_cum");
 
   51        parent::__construct($a_parent_obj, $a_parent_cmd);
 
   56        $this->
addColumn($this->lng->txt(
"title"));
 
   58            if (strcmp(
$c, 
'question') == 0) {
 
   59                $this->
addColumn($this->lng->txt(
"question"));
 
   61            if (strcmp(
$c, 
'question_type') == 0) {
 
   62                $this->
addColumn($this->lng->txt(
"question_type"));
 
   64            if (strcmp(
$c, 
'users_answered') == 0) {
 
   65                $this->
addColumn($this->lng->txt(
"users_answered"));
 
   67            if (strcmp(
$c, 
'users_skipped') == 0) {
 
   68                $this->
addColumn($this->lng->txt(
"users_skipped"));
 
   70            if (strcmp(
$c, 
'mode') == 0) {
 
   71                $this->
addColumn($this->lng->txt(
"mode"));
 
   73            if (strcmp(
$c, 
'mode_nr_of_selections') == 0) {
 
   74                $this->
addColumn($this->lng->txt(
"mode_nr_of_selections"));
 
   76            if (strcmp(
$c, 
'median') == 0) {
 
   77                $this->
addColumn($this->lng->txt(
"median"));
 
   79            if (strcmp(
$c, 
'arithmetic_mean') == 0) {
 
   80                $this->
addColumn($this->lng->txt(
"arithmetic_mean"));
 
   84        $this->
setRowTemplate(
"tpl.il_svy_svy_results_cumulated_row.html", 
"Modules/Survey");
 
   85        $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
 
   94        $cols[
"question"] = array(
 
   95            "txt" => 
$lng->txt(
"question"),
 
   98        $cols[
"question_type"] = array(
 
   99            "txt" => 
$lng->txt(
"question_type"),
 
  102        $cols[
"users_answered"] = array(
 
  103            "txt" => 
$lng->txt(
"users_answered"),
 
  106        $cols[
"users_skipped"] = array(
 
  107            "txt" => 
$lng->txt(
"users_skipped"),
 
  110        $cols[
"mode"] = array(
 
  111            "txt" => 
$lng->txt(
"mode"),
 
  114        $cols[
"mode_nr_of_selections"] = array(
 
  115            "txt" => 
$lng->txt(
"mode_nr_of_selections"),
 
  118        $cols[
"median"] = array(
 
  119            "txt" => 
$lng->txt(
"median"),
 
  122        $cols[
"arithmetic_mean"] = array(
 
  123            "txt" => 
$lng->txt(
"arithmetic_mean"),
 
  133        foreach ($a_results as $question_res) {
 
  143            if (!is_array($question_res)) {
 
  144                $question = $question_res->getQuestion();
 
  147                    "title" => $question->getTitle(),
 
  148                    "question" => strip_tags($question->getQuestiontext()),
 
  150                    "users_answered" => $question_res->getUsersAnswered(),
 
  151                    "users_skipped" => $question_res->getUsersSkipped(),
 
  152                    "mode" => $question_res->getModeValueAsText(),
 
  153                    "mode_nr_of_selections" => $question_res->getModeNrOfSelections(),
 
  154                    "median" => $question_res->getMedianAsText(),
 
  155                    "arithmetic_mean" => $question_res->getMean()
 
  163                foreach ($question_res as $idx => $item) {
 
  164                    $row_title = $item[0];
 
  166                    $question = $row_res->getQuestion();
 
  169                        "title" => $question->getTitle(),
 
  170                        "question" => $row_title,
 
  172                        "users_answered" => $row_res->getUsersAnswered(),
 
  173                        "users_skipped" => $row_res->getUsersSkipped(),
 
  174                        "mode" => $row_res->getModeValueAsText(),
 
  175                        "mode_nr_of_selections" => $row_res->getModeNrOfSelections(),
 
  176                        "median" => $row_res->getMedianAsText(),
 
  177                        "arithmetic_mean" => $row_res->getMean()
 
  188        return !in_array($a_field, array(
"question", 
"question_type"));
 
  200        $this->tpl->setVariable(
"TITLE", 
$data[
'title']);
 
  203            if (strcmp(
$c, 
'question') == 0) {
 
  204                $this->tpl->setCurrentBlock(
'question');
 
  205                $this->tpl->setVariable(
"QUESTION", 
$data[
'question']);
 
  206                $this->tpl->parseCurrentBlock();
 
  208            if (strcmp(
$c, 
'question_type') == 0) {
 
  209                $this->tpl->setCurrentBlock(
'question_type');
 
  210                $this->tpl->setVariable(
"QUESTION_TYPE", trim(
$data[
'question_type']));
 
  211                $this->tpl->parseCurrentBlock();
 
  213            if (strcmp(
$c, 
'users_answered') == 0) {
 
  214                $this->tpl->setCurrentBlock(
'users_answered');
 
  215                $this->tpl->setVariable(
"USERS_ANSWERED", trim(
$data[
'users_answered']));
 
  216                $this->tpl->parseCurrentBlock();
 
  218            if (strcmp(
$c, 
'users_skipped') == 0) {
 
  219                $this->tpl->setCurrentBlock(
'users_skipped');
 
  220                $this->tpl->setVariable(
"USERS_SKIPPED", trim(
$data[
'users_skipped']));
 
  221                $this->tpl->parseCurrentBlock();
 
  223            if (strcmp(
$c, 
'mode') == 0) {
 
  224                $this->tpl->setCurrentBlock(
'mode');
 
  225                $this->tpl->setVariable(
"MODE", trim(
$data[
'mode']));
 
  227                $this->tpl->parseCurrentBlock();
 
  229            if (strcmp(
$c, 
'mode_nr_of_selections') == 0) {
 
  230                $this->tpl->setCurrentBlock(
'mode_nr_of_selections');
 
  231                $this->tpl->setVariable(
"MODE_NR_OF_SELECTIONS", trim(
$data[
'mode_nr_of_selections']));
 
  233                $this->tpl->parseCurrentBlock();
 
  235            if (strcmp(
$c, 
'median') == 0) {
 
  236                $this->tpl->setCurrentBlock(
'median');
 
  237                $this->tpl->setVariable(
"MEDIAN", trim(
$data[
'median']));
 
  239                $this->tpl->parseCurrentBlock();
 
  241            if (strcmp(
$c, 
'arithmetic_mean') == 0) {
 
  242                $this->tpl->setCurrentBlock(
'arithmetic_mean');
 
  243                $this->tpl->setVariable(
"ARITHMETIC_MEAN", trim(
$data[
'arithmetic_mean']));
 
  245                $this->tpl->parseCurrentBlock();
 
An exception for terminatinating execution or to throw for unit testing.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
__construct($a_parent_obj, $a_parent_cmd, array $a_results)
Constructor.
numericOrdering($a_field)
Should this field be sorted numeric?
getSelectableColumns()
Get selectable columns.
getItems(array $a_results)
getSelectedColumns()
Get selected columns.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.