ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
SurveySingleChoiceQuestionEvaluation Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for SurveySingleChoiceQuestionEvaluation:
+ Collaboration diagram for SurveySingleChoiceQuestionEvaluation:

Public Member Functions

 getUserSpecificVariableTitles (array &$a_title_row, array &$a_title_row2, bool $a_do_title, bool $a_do_label)
 
 addUserSpecificResults (array &$a_row, int $a_user_id, $a_results)
 
- Public Member Functions inherited from SurveyQuestionEvaluation
 __construct (SurveyQuestion $a_question, array $a_finished_ids=[])
 
 getResults ()
 Get results. More...
 
 getSumScores ()
 Get sum score for this question for all active ids of run. More...
 
 parseUserSpecificResults ($a_qres, int $a_user_id)
 
 getGrid ( $a_results, bool $a_abs=true, bool $a_perc=true)
 Get grid data. More...
 
 getTextAnswers ($a_results)
 Get text answers. More...
 
 getChart ($a_results)
 
 getSkippedValue ()
 Get caption for skipped value. More...
 
 exportResults ( $a_results, bool $a_do_title, bool $a_do_label)
 
 getExportGrid ($a_results)
 Get grid data. More...
 
 getUserSpecificVariableTitles (array &$a_title_row, array &$a_title_row2, bool $a_do_title, bool $a_do_label)
 Get title columns for user-specific export. More...
 
 addUserSpecificResults (array &$a_row, int $a_user_id, $a_results)
 

Protected Member Functions

 supportsSumScore ()
 
- Protected Member Functions inherited from SurveyQuestionEvaluation
 isSumScoreValid (int $nr_answer_records)
 Is sum score ok (question needs to be fully answered) More...
 
 supportsSumScore ()
 
 parseResults (ilSurveyEvaluationResults $a_results, array $a_answers, SurveyCategories $a_categories=null)
 Parse answer data into results instance. More...
 
 getChartColors ()
 
 getSurveyId ()
 
 getNrOfParticipants ()
 Returns the number of participants for a survey. More...
 
 getAnswerData ()
 

Additional Inherited Members

- Protected Attributes inherited from SurveyQuestionEvaluation
ilLanguage $lng
 
ilDBInterface $db
 
SurveyQuestion $question
 
array $finished_ids
 
int $chart_width = 400
 
int $chart_height = 300
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Survey sc evaluation

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 24 of file class.SurveySingleChoiceQuestionEvaluation.php.

Member Function Documentation

◆ addUserSpecificResults()

SurveySingleChoiceQuestionEvaluation::addUserSpecificResults ( array &  $a_row,
int  $a_user_id,
  $a_results 
)
Parameters
array | ilSurveyEvaluationResults$a_results

Definition at line 55 of file class.SurveySingleChoiceQuestionEvaluation.php.

References $i, and SurveyQuestionEvaluation\getSkippedValue().

59  : void {
60  // check if text answer column is needed
61  $other = array();
62  $categories = $this->question->getCategories();
63  for ($i = 0; $i < $categories->getCategoryCount(); $i++) {
64  $cat = $categories->getCategory($i);
65  if ($cat->other) {
66  $other[] = $cat->scale;
67  // outcommented due to #0021525
68 // break;
69  }
70  }
71 
72  $answer = $a_results->getUserResults($a_user_id);
73  if (count($answer) === 0) {
74  $a_row[] = $this->getSkippedValue();
75  $a_row[] = ""; // see #20646
76  foreach ($other as $dummy) {
77  $a_row[] = "";
78  }
79  } else {
80  //$a_row[] = $answer[0][0]; // see #20646
81  $a_row[] = $answer[0][3]; // see #20646
82  $a_row[] = $answer[0][2]; // see #20646
83 
84  foreach ($other as $scale) {
85  if ($scale == $answer[0][2]) {
86  $a_row[] = $answer[0][1];
87  } else {
88  $a_row[] = "";
89  }
90  }
91  }
92  }
getSkippedValue()
Get caption for skipped value.
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ getUserSpecificVariableTitles()

SurveySingleChoiceQuestionEvaluation::getUserSpecificVariableTitles ( array &  $a_title_row,
array &  $a_title_row2,
bool  $a_do_title,
bool  $a_do_label 
)

Definition at line 30 of file class.SurveySingleChoiceQuestionEvaluation.php.

References $i, SurveyQuestionEvaluation\$lng, and ilLanguage\txt().

35  : void {
36  $lng = $this->lng;
37 
38  // this is for the separation of title and scale, see #20646
39  $a_title_row[] = $a_title_row[count($a_title_row) - 1];
40  $a_title_row2[] = $a_title_row2[count($a_title_row2) - 1];
41 
42  $categories = $this->question->getCategories();
43  for ($i = 0; $i < $categories->getCategoryCount(); $i++) {
44  $cat = $categories->getCategory($i);
45  if ($cat->other) {
46  $a_title_row[] = $cat->title . " [" . $cat->scale . "]";
47  $a_title_row2[] = $lng->txt('other');
48  }
49  }
50  }
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...
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ supportsSumScore()

SurveySingleChoiceQuestionEvaluation::supportsSumScore ( )
protected

Definition at line 94 of file class.SurveySingleChoiceQuestionEvaluation.php.

94  : bool
95  {
96  return true;
97  }

The documentation for this class was generated from the following file: