4 include_once
"Modules/SurveyQuestionPool/classes/class.SurveyQuestionEvaluation.php";
20 parent::parseResults($a_results, $a_answers);
24 foreach($a_answers as $answers)
26 foreach($answers as $answer)
29 $sum += $answer[
"value"];
43 public function getGrid($a_results, $a_abs =
true, $a_perc =
true)
47 if((
bool)$a_abs && (
bool)$a_perc)
50 $lng->txt(
"category_nr_selected"),
51 $lng->txt(
"svy_fraction_of_selections")
57 $lng->txt(
"category_nr_selected")
63 $lng->txt(
"svy_fraction_of_selections")
73 $total =
sizeof($a_results->getAnswers());
77 foreach($a_results->getAnswers() as $answer)
79 $cumulated[$answer->value]++;
81 foreach($cumulated as $value => $count)
83 $perc = sprintf(
"%.2f", $count/
$total*100).
"%";
84 if((
bool)$a_abs && (
bool)$a_perc)
86 $res[
"rows"][] =
array(
94 $res[
"rows"][] =
array(
101 $res[
"rows"][] =
array(
116 include_once
"Services/Chart/classes/class.ilChart.php";
118 $chart->setYAxisToInteger(
true);
121 $chart->setColors($colors);
124 $chart->setsize($this->chart_width, $this->chart_height);
127 $data->setLabel($lng->txt(
"category_nr_selected"));
128 $data->setBarOptions(0.5,
"center");
131 $total =
sizeof($a_results->getAnswers());
134 $cumulated =
array();
135 foreach($a_results->getAnswers() as $answer)
137 $cumulated[$answer->value]++;
141 foreach($cumulated as $value => $count)
143 $data->addPoint($value, $count);
144 $labels[$value] = $value;
148 $chart->setTicks($labels,
false,
true);
172 $lng->txt(
"category_nr_selected"),
173 $lng->txt(
"svy_fraction_of_selections")
179 $total =
sizeof($a_results->getAnswers());
182 $cumulated =
array();
183 foreach($a_results->getAnswers() as $answer)
185 $cumulated[$answer->value]++;
187 foreach($cumulated as $value => $count)
192 sprintf(
"%.2f", $count/$total*100).
"%" 202 $answer = $a_results->getUserResults($a_user_id);
209 $a_row[] = $answer[0][0];
Survey question evaluation.
Survey evaluation answers.
addUserSpecificResults(array &$a_row, $a_user_id, $a_results)
getExportGrid($a_results)
Get grid data.
Create styles array
The data for the language used.
Survey metric evaluation.
parseResults(ilSurveyEvaluationResults $a_results, array $a_answers, SurveyCategories $a_categories=null)
getSkippedValue()
Get caption for skipped value.
getGrid($a_results, $a_abs=true, $a_perc=true)
static getInstanceByType($a_type, $a_id)
Get type instance.