3 declare(strict_types=1);
42 $this->service = $internal_service;
82 if ($config->usesAppraisees()) {
115 $request = $this->service
117 ->evaluation($survey)
120 $gui = $this->service->gui();
124 if ($config->usesAppraisees()) {
132 $captions = new \ilSelectInputGUI(
$lng->txt(
"svy_eval_captions"),
"cp");
133 $captions->setOptions(array(
134 "ap" =>
$lng->txt(
"svy_eval_captions_abs_perc"),
135 "a" =>
$lng->txt(
"svy_eval_captions_abs"),
136 "p" =>
$lng->txt(
"svy_eval_captions_perc")
138 $captions->setValue($request->getCP());
141 $view = new \ilSelectInputGUI(
$lng->txt(
"svy_eval_view"),
"vw");
142 $view->setOptions(array(
143 "tc" =>
$lng->txt(
"svy_eval_view_tables_charts"),
144 "t" =>
$lng->txt(
"svy_eval_view_tables"),
145 "c" =>
$lng->txt(
"svy_eval_view_charts")
147 $view->setValue($request->getVW());
151 $this->gui->lng()->txt(
"ok"),
153 )->submit()->toToolbar(
false, $toolbar);
169 $modal_id =
"svy_ev_exp";
175 $this->gui->lng()->txt(
"export"),
177 )->onClick(
'$(\'#' . $modal_id .
'\').modal(\
'show\')')->toToolbar(
false, $toolbar);
182 $pv = $this->service->gui()->print()->resultsDetails($survey->
getRefId());
183 $this->service->gui()->ctrl()->setParameterByClass(
184 "ilSurveyEvaluationGUI",
186 $this->service->gui()->evaluation($survey)->request()->getVW()
188 $this->service->gui()->ctrl()->setParameterByClass(
189 "ilSurveyEvaluationGUI",
191 $this->service->gui()->evaluation($survey)->request()->getCP()
193 $modal_elements = $pv->getModalElements(
194 $this->service->gui()->ctrl()->getLinkTargetByClass(
195 "ilSurveyEvaluationGUI",
196 "printResultsDetailsSelection" 200 $pv = $this->service->gui()->print()->resultsOverview($survey->
getRefId());
201 $modal_elements = $pv->getModalElements(
202 $this->service->gui()->ctrl()->getLinkTargetByClass(
203 "ilSurveyEvaluationGUI",
204 "printResultsOverviewSelection" 226 $tpl = $this->service->gui()->mainTemplate();
227 $lng = $this->service->gui()->lng();
228 $ctrl = $this->service->gui()->ctrl();
230 $form_id =
"svymdfrm";
233 $tpl->addOnLoadCode(
'$("#form_' . $form_id .
'").submit(function() { $("#' . $a_id .
'").modal("hide"); });');
236 $modal->setId($a_id);
237 $modal->setHeading((
$lng->txt(
"svy_export_format")));
239 $form = new \ilPropertyFormGUI();
240 $form->setId($form_id);
241 $form->setFormAction($ctrl->getFormActionByClass(
"ilsurveyevaluationgui", $a_cmd));
243 $format = new \ilSelectInputGUI(
$lng->txt(
"filetype"),
"export_format");
244 $format->setOptions(array(
248 $form->addItem($format);
250 $label = new \ilSelectInputGUI(
$lng->txt(
"title"),
"export_label");
251 $label->setOptions(array(
252 'label_only' =>
$lng->txt(
'export_label_only'),
253 'title_only' =>
$lng->txt(
'export_title_only'),
254 'title_label' =>
$lng->txt(
'export_title_label')
256 $form->addItem($label);
258 $form->addCommandButton($a_cmd,
$lng->txt(
"export"));
259 $form->setPreventDoubleSubmission(
false);
261 $modal->setBody($form->getHTML());
263 return $modal->getHTML();
271 $lng = $this->service->gui()->lng();
272 $ctrl = $this->service->gui()->ctrl();
273 $req = $this->service->gui()->evaluation($survey)->request();
275 $evaluation_manager = $this->service->domain()->evaluation(
278 $req->getAppraiseeId(),
282 if ($evaluation_manager->isMultiParticipantsView()) {
283 $appr_id = $evaluation_manager->getCurrentAppraisee();
286 $options[
""] =
$lng->txt(
"please_select");
289 foreach ($evaluation_manager->getSelectableAppraisees() as $appraisee_usr_id) {
299 $appr = new \ilSelectInputGUI(
$lng->txt(
"survey_360_appraisee"),
"appr_id");
300 $appr->setOptions($options);
301 $appr->setValue($appr_id);
305 $lng->txt(
"survey_360_select_appraisee"),
307 )->submit()->toToolbar(
false, $toolbar);
323 $ui_factory = $this->service->gui()->ui()->factory();
325 $a_tpl = new \ilTemplate(
"tpl.svy_results_details_panel.html",
true,
true,
"Modules/Survey/Evaluation");
327 $question_res = $a_results;
329 if (is_array($question_res)) {
330 $question_res = $question_res[0][1];
335 if (!is_object($question_res)) {
339 $question = $question_res->getQuestion();
342 $qst_title = $question->getTitle();
343 $svy_text = nl2br($question->getQuestiontext());
346 $anchor_id =
"svyrdq" . $question->getId();
347 $title =
"<span id='$anchor_id'>$qst_title</span>";
348 $panel_qst_card = $ui_factory->panel()->sub($title, $ui_factory->legacy($svy_text))
349 ->withFurtherInformation($this->
getPanelCard($question_res));
351 $panels[] = $panel_qst_card;
371 $panels[] = $ui_factory->panel()->sub(
"", $ui_factory->legacy($a_tpl->get()));
382 $a_tpl = new \ilTemplate(
"tpl.svy_results_details_table.html",
true,
true,
"Modules/Survey/Evaluation");
385 if ($request->getShowTable()) {
388 $request->getShowAbsolute(),
389 $request->getShowPercentage()
392 foreach ($grid[
"cols"] as $col) {
393 $a_tpl->setCurrentBlock(
"grid_col_header_bl");
394 $a_tpl->setVariable(
"COL_HEADER", $col);
395 $a_tpl->parseCurrentBlock();
397 foreach ($grid[
"rows"] as $cols) {
398 foreach ($cols as $idx => $col) {
400 $a_tpl->touchBlock(
"grid_col_nowrap_bl");
403 $a_tpl->setCurrentBlock(
"grid_col_bl");
404 $a_tpl->setVariable(
"COL_CAPTION", trim((
string) ($col ??
"")));
405 $a_tpl->parseCurrentBlock();
408 $a_tpl->touchBlock(
"grid_row_bl");
412 return $a_tpl->get();
421 $a_tpl = new \ilTemplate(
"tpl.svy_results_details_chart.html",
true,
true,
"Modules/Survey/Evaluation");
423 if ($request->getShowChart()) {
424 $chart = $a_eval->
getChart($a_results);
426 if (is_array($chart)) {
428 if (is_array($chart[1])) {
429 foreach ($chart[1] as $legend_item) {
430 $r = hexdec(substr($legend_item[1], 1, 2));
431 $g = hexdec(substr($legend_item[1], 3, 2));
432 $b = hexdec(substr($legend_item[1], 5, 2));
434 $a_tpl->setCurrentBlock(
"legend_bl");
435 $a_tpl->setVariable(
"LEGEND_CAPTION", $legend_item[0]);
436 $a_tpl->setVariable(
"LEGEND_COLOR", $legend_item[1]);
437 $a_tpl->setVariable(
"LEGEND_COLOR_SVG",
$r .
"," . $g .
"," .
$b);
438 $a_tpl->parseCurrentBlock();
445 $a_tpl->setVariable(
"CHART", $chart);
449 return $a_tpl->get();
459 $lng = $this->service->gui()->lng();
461 $a_tpl = new \ilTemplate(
"tpl.svy_results_details_text.html",
true,
true,
"Modules/Survey/Evaluation");
466 if (array_key_exists(
"", $texts)) {
467 $a_tpl->setVariable(
"TEXT_HEADING",
$lng->txt(
"given_answers"));
468 foreach ($texts[
""] as $item) {
469 $a_tpl->setCurrentBlock(
"text_direct_item_bl");
470 $a_tpl->setVariable(
"TEXT_DIRECT", nl2br(htmlentities($item)));
471 $a_tpl->parseCurrentBlock();
474 $acc = new \ilAccordionGUI();
475 $acc->setId(
"svyevaltxt" . $question->getId());
477 $a_tpl->setVariable(
"TEXT_HEADING",
$lng->txt(
"freetext_answers"));
479 foreach ($texts as $var => $items) {
480 $list = array(
"<ul class=\"small\">");
481 foreach ($items as $item) {
482 $list[] =
"<li>" . nl2br(htmlentities($item)) .
"</li>";
485 $acc->addItem((
string) $var, implode(
"\n", $list));
488 $a_tpl->setVariable(
"TEXT_ACC", $acc->getHTML());
491 return $a_tpl->get();
499 $ui_factory = $this->service->gui()->ui()->factory();
500 $lng = $this->service->gui()->lng();
507 $card_table_tpl = new \ilTemplate(
508 "tpl.svy_results_details_card.html",
511 "Modules/Survey/Evaluation" 519 if ($question_res->
getMedian() !== null) {
522 if ($question_res->
getMean() !== null) {
523 $kv[
"arithmetic_mean"] = $question_res->
getMean();
527 foreach ($kv as
$key => $value) {
528 $card_table_tpl->setCurrentBlock(
"question_statistics_card");
529 $card_table_tpl->setVariable(
"QUESTION_STATISTIC_KEY",
$lng->txt(
$key));
530 $card_table_tpl->setVariable(
"QUESTION_STATISTIC_VALUE", $value);
531 $card_table_tpl->parseCurrentBlock();
536 return $ui_factory->card()
537 ->standard($svy_type_title)
539 array($ui_factory->legacy($card_table_tpl->get()))
buildExportModal(string $a_id, string $a_cmd)
setResultsCompetenceToolbar(\ilObjSurvey $survey, \ilToolbarGUI $toolbar, int $user_id)
Survey internal ui service.
setValuesFromForm(\ilObjSurvey $survey, \ilPropertyFormGUI $form)
Class ChatMainBarProvider .
getPanelTable(array $participants, \ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSurveySettingsReminderTargets(\ilObjSurvey $survey, InternalGUIService $ui_service)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
catch(\Exception $e) $req
getDetailPanels(array $participants, \ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
addApprSelectionToToolbar(\ilObjSurvey $survey, \ilToolbarGUI $toolbar, int $user_id)
setResultsOverviewToolbar(\ilObjSurvey $survey, \ilToolbarGUI $toolbar, int $user_id)
getPanelCard(\ilSurveyEvaluationResults $question_res)
addExportAndPrintButton(\ilObjSurvey $survey, \ilToolbarGUI $toolbar, bool $details)
getPanelChart(\ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
setInternalService(InternalService $internal_service)
setResultsDetailToolbar(\ilObjSurvey $survey, \ilToolbarGUI $toolbar, int $user_id)
getSurveySettingsGeneral(\ilObjSurvey $survey)
__construct(InternalGUIService $gui)
getSurveySettingsResults(\ilObjSurvey $survey, InternalGUIService $ui_service)
getGrid( $a_results, bool $a_abs=true, bool $a_perc=true)
Get grid data.
getPanelText(\ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval, \ilSurveyEvaluationResults $question_res)
getTextAnswers($a_results)
Get text answers.