ILIAS  release_7 Revision v7.30-3-g800a261c036
SurveyMultipleChoiceQuestionEvaluation Class Reference

Survey mc evaluation. More...

+ Inheritance diagram for SurveyMultipleChoiceQuestionEvaluation:
+ Collaboration diagram for SurveyMultipleChoiceQuestionEvaluation:

Public Member Functions

 getUserSpecificVariableTitles (array &$a_title_row, array &$a_title_row2, $a_do_title, $a_do_label)
 
 addUserSpecificResults (array &$a_row, $a_user_id, $a_results)
 
- Public Member Functions inherited from SurveyQuestionEvaluation
 __construct (SurveyQuestion $a_question, array $a_finished_ids=null)
 Constructor. More...
 
 getResults ()
 Get results. More...
 
 getSumScores ()
 Get sum score for this question for all active ids of run. More...
 
 parseUserSpecificResults ($a_qres, $a_user_id)
 
 getGrid ($a_results, $a_abs=true, $a_perc=true)
 Get grid data. More...
 
 getTextAnswers ($a_results)
 Get text answers. More...
 
 getChart ($a_results)
 Get chart. More...
 
 getSkippedValue ()
 Get caption for skipped value. More...
 
 exportResults ($a_results, $a_do_title, $a_do_label)
 
 getExportGrid ($a_results)
 Get grid data. More...
 
 getUserSpecificVariableTitles (array &$a_title_row, array &$a_title_row2, $a_do_title, $a_do_label)
 Get title columns for user-specific export. More...
 
 addUserSpecificResults (array &$a_row, $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 ()
 Supports sum score? More...
 
 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
 $lng
 
 $db
 
 $question
 
 $finished_ids
 
 $chart_width = 400
 
 $chart_height = 300
 

Detailed Description

Survey mc 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 10 of file class.SurveyMultipleChoiceQuestionEvaluation.php.

Member Function Documentation

◆ addUserSpecificResults()

SurveyMultipleChoiceQuestionEvaluation::addUserSpecificResults ( array &  $a_row,
  $a_user_id,
  $a_results 
)

Definition at line 35 of file class.SurveyMultipleChoiceQuestionEvaluation.php.

References $i, and SurveyQuestionEvaluation\getSkippedValue().

36  {
37  $categories = $this->question->getCategories();
38 
39  $answers = $a_results->getUserResults($a_user_id);
40  if ($answers === null) {
41  $a_row[] = $this->getSkippedValue();
42 
43  for ($i = 0; $i < $categories->getCategoryCount(); $i++) {
44  $cat = $categories->getCategory($i);
45  $a_row[] = "";
46 
47  if ($cat->other) {
48  $a_row[] = "";
49  }
50  }
51  } else {
52  $a_row[] = "";
53 
54  for ($i = 0; $i < $categories->getCategoryCount(); $i++) {
55  $cat = $categories->getCategory($i);
56  $found = false;
57  foreach ($answers as $answer) {
58  if ($answer[2] == $cat->scale) {
59  $a_row[] = $answer[2];
60  if ($cat->other) {
61  $a_row[] = $answer[1];
62  }
63  $found = true;
64  }
65  }
66  if (!$found) {
67  $a_row[] = ""; // "0" ?!
68  if ($cat->other) {
69  $a_row[] = "";
70  }
71  }
72  }
73  }
74  }
getSkippedValue()
Get caption for skipped value.
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ getUserSpecificVariableTitles()

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

Definition at line 17 of file class.SurveyMultipleChoiceQuestionEvaluation.php.

References $i, and SurveyQuestionEvaluation\$lng.

18  {
19  $lng = $this->lng;
20 
21  $categories = $this->question->getCategories();
22  for ($i = 0; $i < $categories->getCategoryCount(); $i++) {
23  $cat = $categories->getCategory($i);
24 
25  $a_title_row[] = $cat->title . " [" . $cat->scale . "]";
26  $a_title_row2[] = "";
27 
28  if ($cat->other) {
29  $a_title_row[] = $cat->title . " [" . $cat->scale . "]";
30  $a_title_row2[] = $lng->txt('other');
31  }
32  }
33  }
$i
Definition: metadata.php:24

◆ supportsSumScore()

SurveyMultipleChoiceQuestionEvaluation::supportsSumScore ( )
protected

Definition at line 79 of file class.SurveyMultipleChoiceQuestionEvaluation.php.

79  : bool
80  {
81  return true;
82  }

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