ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 Get title columns for user-specific export. More...
 
 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...
 
 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)
 

Additional Inherited Members

- Protected Member Functions inherited from SurveyQuestionEvaluation
 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 ()
 
- Protected Attributes inherited from SurveyQuestionEvaluation
 $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 12 of file class.SurveyMultipleChoiceQuestionEvaluation.php.

Member Function Documentation

◆ addUserSpecificResults()

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

Reimplemented from SurveyQuestionEvaluation.

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

40 {
41 $categories = $this->question->getCategories();
42
43 $answers = $a_results->getUserResults($a_user_id);
44 if($answers === null)
45 {
46 $a_row[] = $this->getSkippedValue();
47
48 for ($i = 0; $i < $categories->getCategoryCount(); $i++)
49 {
50 $cat = $categories->getCategory($i);
51 $a_row[] = "";
52
53 if($cat->other)
54 {
55 $a_row[] = "";
56 }
57 }
58 }
59 else
60 {
61 $a_row[] = "";
62
63 for ($i = 0; $i < $categories->getCategoryCount(); $i++)
64 {
65 $cat = $categories->getCategory($i);
66 $found = false;
67 foreach($answers as $answer)
68 {
69 if($answer[2] == $cat->scale)
70 {
71 $a_row[] = $answer[2];
72 if ($cat->other)
73 {
74 $a_row[] = $answer[1];
75 }
76 $found = true;
77 }
78 }
79 if(!$found)
80 {
81 $a_row[] = ""; // "0" ?!
82 if ($cat->other)
83 {
84 $a_row[] = "";
85 }
86 }
87 }
88 }
89 }
getSkippedValue()
Get caption for skipped value.

References SurveyQuestionEvaluation\getSkippedValue().

+ 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 
)

Get title columns for user-specific export.

Parameters
array$a_title_row
array$a_title_row2
bool$a_do_title
bool$a_do_label

Reimplemented from SurveyQuestionEvaluation.

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

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

References $lng.


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