24 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
25 include_once
"./Modules/Survey/classes/inc.SurveyConstants.php";
55 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveySingleChoiceQuestion.php";
59 $this->
object->loadFromDb($id);
71 $hasErrors = (!$always) ? $this->
editQuestion(
true) :
false;
74 $this->
object->setTitle(
$_POST[
"title"]);
75 $this->
object->setAuthor(
$_POST[
"author"]);
76 $this->
object->setDescription(
$_POST[
"description"]);
77 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
78 $questiontext =
$_POST[
"question"];
79 $this->
object->setQuestiontext($questiontext);
80 $this->
object->setObligatory((
$_POST[
"obligatory"]) ? 1 : 0);
81 $this->
object->setOrientation(
$_POST[
"orientation"]);
83 $this->
object->categories->flushCategories();
85 foreach (
$_POST[
'answers'][
'answer'] as
$key => $value)
87 if (strlen($value)) $this->
object->getCategories()->addCategory($value);
104 $save = ((strcmp($this->ctrl->getCmd(),
"save") == 0) ||
105 (strcmp($this->ctrl->getCmd(),
"wizardanswers") == 0) ||
106 (strcmp($this->ctrl->getCmd(),
"savePhraseanswers") == 0)
109 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
111 $form->setFormAction($this->ctrl->getFormAction($this));
112 $form->setTitle($this->lng->txt($this->getQuestionType()));
113 $form->setMultipart(FALSE);
114 $form->setTableWidth(
"100%");
115 $form->setId(
"singlechoice");
119 $title->setValue($this->object->getTitle());
120 $title->setRequired(TRUE);
124 $author =
new ilTextInputGUI($this->lng->txt(
"author"),
"author");
125 $author->
setValue($this->object->getAuthor());
126 $author->setRequired(TRUE);
127 $form->addItem($author);
130 $description =
new ilTextInputGUI($this->lng->txt(
"description"),
"description");
131 $description->
setValue($this->object->getDescription());
132 $description->setRequired(FALSE);
133 $form->addItem($description);
137 $question->
setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
138 $question->setRequired(TRUE);
139 $question->setRows(10);
140 $question->setCols(80);
141 $question->setUseRte(TRUE);
142 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
144 $question->addPlugin(
"latex");
145 $question->addButton(
"latex");
146 $question->addButton(
"pastelatex");
147 $question->removePlugin(
"ibrowser");
148 $question->setRTESupport($this->object->getId(),
"spl",
"survey");
149 $form->addItem($question);
154 $shuffle->setChecked($this->object->getObligatory());
155 $shuffle->setRequired(FALSE);
156 $form->addItem($shuffle);
161 $orientation->setValue($this->object->getOrientation());
162 $orientation->addOption(
new ilRadioOption($this->lng->txt(
'vertical'), 0));
163 $orientation->addOption(
new ilRadioOption($this->lng->txt(
'horizontal'), 1));
164 $orientation->addOption(
new ilRadioOption($this->lng->txt(
'combobox'), 2));
165 $form->addItem($orientation);
168 include_once
"./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
171 $answers->setAllowMove(
true);
172 $answers->setShowWizard(
true);
173 $answers->setShowSavePhrase(
true);
174 if (!$this->object->getCategories()->getCategoryCount())
176 $this->
object->getCategories()->addCategory(
"");
178 $answers->setValues($this->object->getCategories());
179 $form->addItem($answers);
181 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
187 $form->setValuesByPost();
188 $errors = !$form->checkInput();
189 $form->setValuesByPost();
190 if (
$errors) $checkonly =
false;
193 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
203 $position = key(
$_POST[
'cmd'][
'addanswers']);
204 $this->
object->getCategories()->addCategoryAtPosition(
"", $position+1);
214 $position = key(
$_POST[
'cmd'][
'removeanswers']);
215 $this->
object->getCategories()->removeCategory($position);
225 $position = key(
$_POST[
'cmd'][
'upanswers']);
226 $this->
object->getCategories()->moveCategoryUp($position);
236 $position = key(
$_POST[
'cmd'][
'downanswers']);
237 $this->
object->getCategories()->moveCategoryDown($position);
249 if (
$result == 0 || !$save_post_data)
251 if ($save_post_data) $this->
object->saveToDb();
252 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_qpl_addphrase.html",
"Modules/SurveyQuestionPool");
255 $this->tpl->setCurrentBlock(
"hidden");
256 $this->tpl->setVariable(
"HIDDEN_NAME",
"id");
257 $this->tpl->setVariable(
"HIDDEN_VALUE", $this->object->getId());
258 $this->tpl->parseCurrentBlock();
260 include_once
"./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrases.php";
262 $colors = array(
"tblrow1",
"tblrow2");
264 foreach ($phrases as $phrase_id => $phrase_array)
266 $this->tpl->setCurrentBlock(
"phraserow");
267 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter++ % 2]);
268 $this->tpl->setVariable(
"PHRASE_VALUE", $phrase_id);
269 $this->tpl->setVariable(
"PHRASE_NAME", $phrase_array[
"title"]);
271 $this->tpl->setVariable(
"PHRASE_CONTENT", join($categories,
","));
272 $this->tpl->parseCurrentBlock();
275 $this->tpl->setCurrentBlock(
"adm_content");
276 $this->tpl->setVariable(
"TEXT_CANCEL", $this->lng->txt(
"cancel"));
277 $this->tpl->setVariable(
"TEXT_PHRASE", $this->lng->txt(
"phrase"));
278 $this->tpl->setVariable(
"TEXT_CONTENT", $this->lng->txt(
"categories"));
279 $this->tpl->setVariable(
"TEXT_ADD_PHRASE", $this->lng->txt(
"add_phrase"));
280 $this->tpl->setVariable(
"TEXT_INTRODUCTION",$this->lng->txt(
"add_phrase_introduction"));
281 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
282 $this->tpl->parseCurrentBlock();
294 $this->ctrl->redirect($this,
'editQuestion');
304 if (strcmp(
$_POST[
"phrases"],
"") == 0)
311 if (strcmp($this->object->getPhrase(
$_POST[
"phrases"]),
"dp_standard_numbers") != 0)
313 $this->
object->addPhrase(
$_POST[
"phrases"]);
314 $this->
object->saveToDb();
322 $this->ctrl->redirect($this,
'editQuestion');
333 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_qpl_addphrase_standard_numbers.html",
"Modules/SurveyQuestionPool");
336 $this->tpl->setCurrentBlock(
"hidden");
337 $this->tpl->setVariable(
"HIDDEN_NAME",
"id");
338 $this->tpl->setVariable(
"HIDDEN_VALUE", $this->object->getId());
339 $this->tpl->parseCurrentBlock();
341 $this->tpl->setCurrentBlock(
"adm_content");
342 $this->tpl->setVariable(
"ADD_STANDARD_NUMBERS", $this->lng->txt(
"add_standard_numbers"));
343 $this->tpl->setVariable(
"TEXT_ADD_LIMITS", $this->lng->txt(
"add_limits_for_standard_numbers"));
344 $this->tpl->setVariable(
"TEXT_LOWER_LIMIT",$this->lng->txt(
"lower_limit"));
345 $this->tpl->setVariable(
"TEXT_UPPER_LIMIT",$this->lng->txt(
"upper_limit"));
346 $this->tpl->setVariable(
"VALUE_LOWER_LIMIT",
$_POST[
"lower_limit"]);
347 $this->tpl->setVariable(
"VALUE_UPPER_LIMIT",
$_POST[
"upper_limit"]);
348 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
"add_phrase"));
349 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
"cancel"));
350 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
351 $this->tpl->parseCurrentBlock();
362 $this->ctrl->redirect($this,
"editQuestion");
372 if ((strcmp(
$_POST[
"lower_limit"],
"") == 0) or (strcmp(
$_POST[
"upper_limit"],
"") == 0))
377 else if ((
int)
$_POST[
"upper_limit"] <= (
int)
$_POST[
"lower_limit"])
384 $this->
object->addStandardNumbers($_POST[
"lower_limit"], $_POST[
"upper_limit"]);
385 $this->
object->saveToDb();
387 $this->ctrl->redirect($this,
"editQuestion");
401 if (!$haserror) $this->
object->saveToDb();
402 $nothing_selected =
true;
403 $nothing_selected =
false;
404 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_qpl_savephrase.html",
"Modules/SurveyQuestionPool");
405 $rowclass = array(
"tblrow1",
"tblrow2");
407 foreach (
$_POST[
'answers'][
'answer'] as
$key => $value)
411 $this->tpl->setCurrentBlock(
"row");
413 $this->tpl->setVariable(
"COLOR_CLASS", $rowclass[$counter % 2]);
414 $this->tpl->parseCurrentBlock();
415 $this->tpl->setCurrentBlock(
"hidden");
416 $this->tpl->setVariable(
"HIDDEN_NAME",
"answers[answer][]");
418 $this->tpl->parseCurrentBlock();
425 $this->ctrl->redirect($this,
"editQuestion");
427 $this->tpl->setCurrentBlock(
"adm_content");
428 $this->tpl->setVariable(
"SAVE_PHRASE_INTRODUCTION", $this->lng->txt(
"save_phrase_introduction"));
429 $this->tpl->setVariable(
"TEXT_PHRASE_TITLE", $this->lng->txt(
"enter_phrase_title"));
430 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"category"));
431 $this->tpl->setVariable(
"VALUE_PHRASE_TITLE",
$_POST[
"phrase_title"]);
432 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
"cancel"));
433 $this->tpl->setVariable(
"BTN_CONFIRM",$this->lng->txt(
"confirm"));
434 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
435 $this->tpl->parseCurrentBlock();
447 $this->ctrl->redirect($this,
"editQuestion");
457 if (!
$_POST[
"phrase_title"])
464 if ($this->object->phraseExists(
$_POST[
"phrase_title"]))
471 $this->
object->savePhrase(
$_POST[
'answers'][
'answer'],
$_POST[
"phrase_title"]);
473 $this->ctrl->redirect($this,
"editQuestion");
482 function getWorkingForm($working_data =
"", $question_title = 1, $show_questiontext = 1, $error_message =
"", $survey_id = null)
484 $template =
new ilTemplate(
"tpl.il_svy_out_sc.html", TRUE, TRUE,
"Modules/SurveyQuestionPool");
485 $template->setCurrentBlock(
"material");
487 $template->parseCurrentBlock();
488 switch ($this->object->orientation)
492 for ($i = 0; $i < $this->
object->categories->getCategoryCount(); $i++)
494 $category = $this->
object->categories->getCategory($i);
495 $template->setCurrentBlock(
"row");
497 $template->setVariable(
"VALUE_SC", $i);
498 $template->setVariable(
"QUESTION_ID", $this->object->getId());
499 if (is_array($working_data))
501 if (strcmp($working_data[0][
"value"],
"") != 0)
503 if ($working_data[0][
"value"] == $i)
505 $template->setVariable(
"CHECKED_SC",
" checked=\"checked\"");
509 $template->parseCurrentBlock();
514 for ($i = 0; $i < $this->
object->categories->getCategoryCount(); $i++)
516 $category = $this->
object->categories->getCategory($i);
517 $template->setCurrentBlock(
"radio_col");
518 $template->setVariable(
"VALUE_SC", $i);
519 $template->setVariable(
"QUESTION_ID", $this->object->getId());
520 if (is_array($working_data))
522 if (strcmp($working_data[0][
"value"],
"") != 0)
524 if ($working_data[0][
"value"] == $i)
526 $template->setVariable(
"CHECKED_SC",
" checked=\"checked\"");
530 $template->parseCurrentBlock();
532 for ($i = 0; $i < $this->
object->categories->getCategoryCount(); $i++)
534 $category = $this->
object->categories->getCategory($i);
535 $template->setCurrentBlock(
"text_col");
536 $template->setVariable(
"VALUE_SC", $i);
538 $template->setVariable(
"QUESTION_ID", $this->object->getId());
539 $template->parseCurrentBlock();
544 for ($i = 0; $i < $this->
object->categories->getCategoryCount(); $i++)
546 $category = $this->
object->categories->getCategory($i);
547 $template->setCurrentBlock(
"comborow");
548 $template->setVariable(
"TEXT_SC", $category);
549 $template->setVariable(
"VALUE_SC", $i);
550 if (is_array($working_data))
552 if (strcmp($working_data[0][
"value"],
"") != 0)
554 if ($working_data[0][
"value"] == $i)
556 $template->setVariable(
"SELECTED_SC",
" selected=\"selected\"");
560 $template->parseCurrentBlock();
562 $template->setCurrentBlock(
"combooutput");
563 $template->setVariable(
"QUESTION_ID", $this->object->getId());
564 $template->setVariable(
"SELECT_OPTION", $this->lng->txt(
"select_option"));
565 $template->setVariable(
"TEXT_SELECTION", $this->lng->txt(
"selection"));
566 $template->parseCurrentBlock();
571 $template->setVariable(
"QUESTION_TITLE", $this->object->getTitle());
573 $template->setCurrentBlock(
"question_data");
574 if (strcmp($error_message,
"") != 0)
576 $template->setVariable(
"ERROR_MESSAGE",
"<p class=\"warning\">$error_message</p>");
578 if ($show_questiontext)
580 $questiontext = $this->
object->getQuestiontext();
581 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
583 if (! $this->object->getObligatory($survey_id))
585 $template->setVariable(
"OBLIGATORY_TEXT", $this->lng->txt(
"survey_question_optional"));
587 $template->parseCurrentBlock();
588 return $template->get();
596 function getPrintView($question_title = 1, $show_questiontext = 1, $survey_id = null)
598 $template =
new ilTemplate(
"tpl.il_svy_qpl_sc_printview.html", TRUE, TRUE,
"Modules/SurveyQuestionPool");
599 switch ($this->object->orientation)
603 for ($i = 0; $i < $this->
object->categories->getCategoryCount(); $i++)
605 $category = $this->
object->categories->getCategory($i);
606 $template->setCurrentBlock(
"row");
608 $template->setVariable(
"ALT_RADIO", $this->lng->txt(
"unchecked"));
609 $template->setVariable(
"TITLE_RADIO", $this->lng->txt(
"unchecked"));
611 $template->parseCurrentBlock();
616 for ($i = 0; $i < $this->
object->categories->getCategoryCount(); $i++)
618 $category = $this->
object->categories->getCategory($i);
619 $template->setCurrentBlock(
"radio_col");
621 $template->setVariable(
"ALT_RADIO", $this->lng->txt(
"unchecked"));
622 $template->setVariable(
"TITLE_RADIO", $this->lng->txt(
"unchecked"));
623 $template->parseCurrentBlock();
625 for ($i = 0; $i < $this->
object->categories->getCategoryCount(); $i++)
627 $category = $this->
object->categories->getCategory($i);
628 $template->setCurrentBlock(
"text_col");
629 $template->setVariable(
"TEXT_SC", $category);
630 $template->parseCurrentBlock();
635 for ($i = 0; $i < $this->
object->categories->getCategoryCount(); $i++)
637 $category = $this->
object->categories->getCategory($i);
638 $template->setCurrentBlock(
"comborow");
640 $template->setVariable(
"VALUE_SC", $i);
641 if (is_array($working_data))
643 if (strcmp($working_data[0][
"value"],
"") != 0)
645 if ($working_data[0][
"value"] == $i)
647 $template->setVariable(
"SELECTED_SC",
" selected=\"selected\"");
651 $template->parseCurrentBlock();
653 $template->setCurrentBlock(
"combooutput");
654 $template->setVariable(
"QUESTION_ID", $this->object->getId());
655 $template->setVariable(
"SELECT_OPTION", $this->lng->txt(
"select_option"));
656 $template->setVariable(
"TEXT_SELECTION", $this->lng->txt(
"selection"));
657 $template->parseCurrentBlock();
662 $template->setVariable(
"QUESTION_TITLE", $this->object->getTitle());
664 if ($show_questiontext)
666 $questiontext = $this->
object->getQuestiontext();
667 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
669 if (! $this->object->getObligatory($survey_id))
671 $template->setVariable(
"OBLIGATORY_TEXT", $this->lng->txt(
"survey_question_optional"));
673 $template->parseCurrentBlock();
674 return $template->get();
684 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_qpl_preview.html",
"Modules/SurveyQuestionPool");
686 $this->tpl->setVariable(
"QUESTION_OUTPUT", $question_output);
691 global $rbacsystem,$ilTabs;
692 $this->ctrl->setParameter($this,
"sel_question_types", $this->
getQuestionType());
693 $this->ctrl->setParameter($this,
"q_id",
$_GET[
"q_id"]);
695 if ((
$_GET[
"calling_survey"] > 0) || (
$_GET[
"new_for_survey"] > 0))
700 if (strlen(
$_GET[
"new_for_survey"]))
702 $addurl =
"&new_id=" .
$_GET[
"q_id"];
704 $ilTabs->setBackTarget($this->lng->txt(
"menubacktosurvey"),
"ilias.php?baseClass=ilObjSurveyGUI&ref_id=$ref_id&cmd=questions" . $addurl);
708 $this->ctrl->setParameterByClass(
"ilObjSurveyQuestionPoolGUI",
"q_id_table_nav",
$_SESSION[
'q_id_table_nav']);
709 $ilTabs->setBackTarget($this->lng->txt(
"spl"), $this->ctrl->getLinkTargetByClass(
"ilObjSurveyQuestionPoolGUI",
"questions"));
713 $ilTabs->addTarget(
"preview",
714 $this->ctrl->getLinkTarget($this,
"preview"),
720 if ($rbacsystem->checkAccess(
'edit',
$_GET[
"ref_id"])) {
721 $ilTabs->addTarget(
"edit_properties",
722 $this->ctrl->getLinkTarget($this,
"editQuestion"),
723 array(
"editQuestion",
"save",
"cancel",
"wizardanswers",
"addSelectedPhrase",
724 "insertStandardNumbers",
"savePhraseanswers",
"confirmSavePhrase"),
731 $ilTabs->addTarget(
"material",
732 $this->ctrl->getLinkTarget($this,
"material"),
733 array(
"material",
"cancelExplorer",
"linkChilds",
"addGIT",
"addST",
734 "addPG",
"addMaterial",
"removeMaterial"),
740 if ($this->object->getId() > 0)
742 $title = $this->lng->txt(
"edit") .
" "" . $this->
object->getTitle() .
""";
749 $this->tpl->setVariable(
"HEADER",
$title);
762 if (count($this->cumulated) == 0)
764 include_once
"./Modules/Survey/classes/class.ilObjSurvey.php";
766 $this->cumulated =& $this->
object->getCumulatedResults($survey_id, $nr_of_users);
769 include_once
"./classes/class.ilTemplate.php";
770 $template =
new ilTemplate(
"tpl.il_svy_svy_cumulated_results_detail.html", TRUE, TRUE,
"Modules/Survey");
772 $template->setCurrentBlock(
"detail_row");
773 $template->setVariable(
"TEXT_OPTION", $this->lng->txt(
"question"));
774 $questiontext = $this->
object->getQuestiontext();
775 $template->setVariable(
"TEXT_OPTION_VALUE", $this->object->prepareTextareaOutput($questiontext, TRUE));
776 $template->parseCurrentBlock();
777 $template->setCurrentBlock(
"detail_row");
778 $template->setVariable(
"TEXT_OPTION", $this->lng->txt(
"question_type"));
779 $template->setVariable(
"TEXT_OPTION_VALUE", $this->lng->txt($this->getQuestionType()));
780 $template->parseCurrentBlock();
781 $template->setCurrentBlock(
"detail_row");
782 $template->setVariable(
"TEXT_OPTION", $this->lng->txt(
"users_answered"));
783 $template->setVariable(
"TEXT_OPTION_VALUE", $this->cumulated[
"USERS_ANSWERED"]);
784 $template->parseCurrentBlock();
785 $template->setCurrentBlock(
"detail_row");
786 $template->setVariable(
"TEXT_OPTION", $this->lng->txt(
"users_skipped"));
787 $template->setVariable(
"TEXT_OPTION_VALUE", $this->cumulated[
"USERS_SKIPPED"]);
788 $template->parseCurrentBlock();
790 $template->setCurrentBlock(
"detail_row");
791 $template->setVariable(
"TEXT_OPTION", $this->lng->txt(
"mode"));
792 $template->setVariable(
"TEXT_OPTION_VALUE", $this->cumulated[
"MODE"]);
793 $template->parseCurrentBlock();
794 $template->setCurrentBlock(
"detail_row");
795 $template->setVariable(
"TEXT_OPTION", $this->lng->txt(
"mode_nr_of_selections"));
796 $template->setVariable(
"TEXT_OPTION_VALUE", $this->cumulated[
"MODE_NR_OF_SELECTIONS"]);
797 $template->parseCurrentBlock();
798 $template->setCurrentBlock(
"detail_row");
799 $template->setVariable(
"TEXT_OPTION", $this->lng->txt(
"median"));
800 $template->setVariable(
"TEXT_OPTION_VALUE", $this->cumulated[
"MEDIAN"]);
801 $template->parseCurrentBlock();
803 $template->setCurrentBlock(
"detail_row");
804 $template->setVariable(
"TEXT_OPTION", $this->lng->txt(
"categories"));
806 foreach ($this->cumulated[
"variables"] as
$key => $value)
808 $categories .=
"<li>" . $this->lng->txt(
"title") .
":" .
"<span class=\"bold\">" . $value[
"title"] .
"</span><br />" .
809 $this->lng->txt(
"category_nr_selected") .
": " .
"<span class=\"bold\">" . $value[
"selected"] .
"</span><br />" .
810 $this->lng->txt(
"percentage_of_selections") .
": " .
"<span class=\"bold\">" . sprintf(
"%.2f", 100*$value[
"percentage"]) .
"</span></li>";
812 $categories =
"<ol>$categories</ol>";
813 $template->setVariable(
"TEXT_OPTION_VALUE", $categories);
814 $template->parseCurrentBlock();
817 $template->setCurrentBlock(
"chart");
818 $template->setVariable(
"TEXT_CHART", $this->lng->txt(
"chart"));
819 $template->setVariable(
"ALT_CHART",
$data[
"title"] .
"( " . $this->lng->txt(
"chart") .
")");
821 include_once
"./Services/Administration/classes/class.ilSetting.php";
822 $surveySetting =
new ilSetting(
"survey");
823 if ($surveySetting->get(
"googlechart") == 1)
825 $chartcolors = array(
"2A4BD7",
"9DAFFF",
"1D6914",
"81C57A",
"814A19",
"E9DEBB",
"8126C0",
"AD2323",
"29D0D0",
"FFEE33",
"FF9233",
"FFCDF3",
"A0A0A0",
"575757",
"000000");
826 $selections = array();
830 foreach ($this->cumulated[
"variables"] as $val)
832 if ($val[
"selected"] > $maxselection) $maxselection = $val[
"selected"];
833 array_push($selections, $val[
"selected"]);
834 array_push($values, str_replace(
" ",
"+", $val[
"title"]));
837 if ($maxselection % 2 == 0)
839 $selectionlabels =
"0|" . ($maxselection / 2) .
"|$maxselection";
843 $selectionlabels =
"0|$maxselection";
845 $charturl =
"http://chart.apis.google.com/chart?chco=" . implode(
"|", array_slice($chartcolors, 0, count($values))).
"&cht=bvs&chs=" . $chartwidth .
"x250&chd=t:" . implode(
",", $selections) .
"&chds=0,$maxselection&chxt=y,y&chxl=0:|".$selectionlabels.
"|1:||".str_replace(
" ",
"+", $this->lng->txt(
"mode_nr_of_selections")).
"|" .
"&chxr=1,0,$maxselection&chtt=" . str_replace(
" ",
"+", $this->object->getTitle()) .
"&chbh=20," . (round($chartwidth/count($values))-25) .
"&chdl=" . implode(
"|", $values) .
"&chdlp=b";
849 $this->ctrl->setParameterByClass(
"ilsurveyevaluationgui",
"survey", $survey_id);
850 $this->ctrl->setParameterByClass(
"ilsurveyevaluationgui",
"question", $this->object->getId());
851 $charturl = $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"outChart");
853 $template->setVariable(
"CHART", $charturl);
854 $template->parseCurrentBlock();
856 $template->setVariable(
"QUESTION_TITLE",
"$counter. ".$this->object->getTitle());
857 return $template->get();