4 include_once
"Modules/SurveyQuestionPool/classes/class.SurveyQuestionEvaluation.php";
20 parent::parseResults($a_results, $a_answers);
24 foreach ($a_answers as $answers) {
25 foreach ($answers as $answer) {
27 $sum += $answer[
"value"];
40 public function getGrid($a_results, $a_abs =
true, $a_perc =
true)
44 if ((
bool) $a_abs && (
bool) $a_perc) {
46 $lng->txt(
"category_nr_selected"),
47 $lng->txt(
"svy_fraction_of_selections")
49 } elseif ((
bool) $a_abs) {
51 $lng->txt(
"category_nr_selected")
55 $lng->txt(
"svy_fraction_of_selections")
65 $answ = $a_results->getAnswers();
66 if (is_array($answ)) {
67 $total =
sizeof($a_results->getAnswers());
70 foreach ($a_results->getAnswers() as $answer) {
71 $cumulated[$answer->value]++;
73 foreach ($cumulated as $value => $count) {
74 $perc = sprintf(
"%.2f", $count /
$total * 100) .
"%";
75 if ((
bool) $a_abs && (
bool) $a_perc) {
76 $res[
"rows"][] =
array(
81 } elseif ((
bool) $a_abs) {
82 $res[
"rows"][] =
array(
87 $res[
"rows"][] =
array(
103 include_once
"Services/Chart/classes/class.ilChart.php";
105 $chart->setYAxisToInteger(
true);
108 $chart->setColors($colors);
111 $chart->setsize($this->chart_width, $this->chart_height);
114 $data->setLabel(
$lng->txt(
"category_nr_selected"));
115 $data->setBarOptions(0.5,
"center");
118 $total =
sizeof($a_results->getAnswers());
120 $cumulated =
array();
121 foreach ($a_results->getAnswers() as $answer) {
122 $cumulated[$answer->value]++;
126 foreach ($cumulated as $value => $count) {
127 $data->addPoint($value, $count);
128 $labels[$value] = $value;
132 $chart->setTicks($labels,
false,
true);
156 $lng->txt(
"category_nr_selected"),
157 $lng->txt(
"svy_fraction_of_selections")
163 $total =
sizeof($a_results->getAnswers());
165 $cumulated =
array();
166 foreach ($a_results->getAnswers() as $answer) {
167 $cumulated[$answer->value]++;
169 foreach ($cumulated as $value => $count) {
173 sprintf(
"%.2f", $count/$total*100) .
"%" 183 $answer = $a_results->getUserResults($a_user_id);
184 if ($answer === null) {
187 $a_row[] = $answer[0][0];
Survey question evaluation.
Survey evaluation answers.
foreach($_POST as $key=> $value) $res
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.