3 declare(strict_types=1);
40 $this->service = $internal_service;
80 if (
$config->usesAppraisees()) {
113 $request = $this->service
115 ->evaluation($survey)
118 $gui = $this->service->gui();
122 if (
$config->usesAppraisees()) {
130 $captions = new \ilSelectInputGUI(
$lng->txt(
"svy_eval_captions"),
"cp");
131 $captions->setOptions(array(
132 "ap" =>
$lng->txt(
"svy_eval_captions_abs_perc"),
133 "a" =>
$lng->txt(
"svy_eval_captions_abs"),
134 "p" =>
$lng->txt(
"svy_eval_captions_perc")
136 $captions->setValue($request->getCP());
139 $view = new \ilSelectInputGUI(
$lng->txt(
"svy_eval_view"),
"vw");
140 $view->setOptions(array(
141 "tc" =>
$lng->txt(
"svy_eval_view_tables_charts"),
142 "t" =>
$lng->txt(
"svy_eval_view_tables"),
143 "c" =>
$lng->txt(
"svy_eval_view_charts")
145 $view->setValue($request->getVW());
149 $button->setCaption(
"ok");
150 $button->setCommand(
"evaluationdetails");
151 $button->setOmitPreventDoubleSubmission(
true);
168 $modal_id =
"svy_ev_exp";
174 $button->setCaption(
"export");
175 $button->setOnClick(
'$(\'#' . $modal_id .
'\').modal(\
'show\')');
181 $pv = $this->service->gui()->print()->resultsDetails($survey->
getRefId());
182 $this->service->gui()->ctrl()->setParameterByClass(
183 "ilSurveyEvaluationGUI",
185 $this->service->gui()->evaluation($survey)->request()->getVW()
187 $this->service->gui()->ctrl()->setParameterByClass(
188 "ilSurveyEvaluationGUI",
190 $this->service->gui()->evaluation($survey)->request()->getCP()
192 $modal_elements = $pv->getModalElements(
193 $this->service->gui()->ctrl()->getLinkTargetByClass(
194 "ilSurveyEvaluationGUI",
195 "printResultsDetailsSelection" 199 $pv = $this->service->gui()->print()->resultsOverview($survey->
getRefId());
200 $modal_elements = $pv->getModalElements(
201 $this->service->gui()->ctrl()->getLinkTargetByClass(
202 "ilSurveyEvaluationGUI",
203 "printResultsOverviewSelection" 225 $tpl = $this->service->gui()->mainTemplate();
226 $lng = $this->service->gui()->lng();
227 $ctrl = $this->service->gui()->ctrl();
229 $form_id =
"svymdfrm";
232 $tpl->addOnLoadCode(
'$("#form_' . $form_id .
'").submit(function() { $("#' . $a_id .
'").modal("hide"); });');
235 $modal->setId($a_id);
236 $modal->setHeading((
$lng->txt(
"svy_export_format")));
238 $form = new \ilPropertyFormGUI();
239 $form->setId($form_id);
240 $form->setFormAction($ctrl->getFormActionByClass(
"ilsurveyevaluationgui", $a_cmd));
242 $format = new \ilSelectInputGUI(
$lng->txt(
"filetype"),
"export_format");
249 $label = new \ilSelectInputGUI(
$lng->txt(
"title"),
"export_label");
250 $label->setOptions(array(
251 'label_only' =>
$lng->txt(
'export_label_only'),
252 'title_only' =>
$lng->txt(
'export_title_only'),
253 'title_label' =>
$lng->txt(
'export_title_label')
255 $form->addItem($label);
257 $form->addCommandButton($a_cmd,
$lng->txt(
"export"));
258 $form->setPreventDoubleSubmission(
false);
260 $modal->setBody($form->getHTML());
262 return $modal->getHTML();
270 $lng = $this->service->gui()->lng();
271 $ctrl = $this->service->gui()->ctrl();
272 $req = $this->service->gui()->evaluation($survey)->request();
274 $evaluation_manager = $this->service->domain()->evaluation(
277 $req->getAppraiseeId(),
281 if ($evaluation_manager->isMultiParticipantsView()) {
282 $appr_id = $evaluation_manager->getCurrentAppraisee();
285 $options[
""] =
$lng->txt(
"please_select");
288 foreach ($evaluation_manager->getSelectableAppraisees() as $appraisee_usr_id) {
298 $appr = new \ilSelectInputGUI(
$lng->txt(
"survey_360_appraisee"),
"appr_id");
299 $appr->setOptions($options);
300 $appr->setValue($appr_id);
304 $button->setCaption(
"survey_360_select_appraisee");
305 $button->setCommand($ctrl->getCmd());
322 $ui_factory = $this->service->gui()->ui()->factory();
324 $a_tpl = new \ilTemplate(
"tpl.svy_results_details_panel.html",
true,
true,
"Modules/Survey/Evaluation");
326 $question_res = $a_results;
328 if (is_array($question_res)) {
329 $question_res = $question_res[0][1];
334 if (!is_object($question_res)) {
338 $question = $question_res->getQuestion();
341 $qst_title = $question->getTitle();
342 $svy_text = nl2br($question->getQuestiontext());
345 $anchor_id =
"svyrdq" . $question->getId();
346 $title =
"<span id='$anchor_id'>$qst_title</span>";
347 $panel_qst_card = $ui_factory->panel()->sub($title, $ui_factory->legacy($svy_text))
348 ->withFurtherInformation($this->
getPanelCard($question_res));
350 $panels[] = $panel_qst_card;
370 $panels[] = $ui_factory->panel()->sub(
"", $ui_factory->legacy($a_tpl->get()));
381 $a_tpl = new \ilTemplate(
"tpl.svy_results_details_table.html",
true,
true,
"Modules/Survey/Evaluation");
384 if ($request->getShowTable()) {
387 $request->getShowAbsolute(),
388 $request->getShowPercentage()
391 foreach ($grid[
"cols"] as $col) {
392 $a_tpl->setCurrentBlock(
"grid_col_header_bl");
393 $a_tpl->setVariable(
"COL_HEADER", $col);
394 $a_tpl->parseCurrentBlock();
396 foreach ($grid[
"rows"] as
$cols) {
397 foreach ($cols as $idx => $col) {
399 $a_tpl->touchBlock(
"grid_col_nowrap_bl");
402 $a_tpl->setCurrentBlock(
"grid_col_bl");
403 $a_tpl->setVariable(
"COL_CAPTION", trim((
string) $col));
404 $a_tpl->parseCurrentBlock();
407 $a_tpl->touchBlock(
"grid_row_bl");
411 return $a_tpl->get();
420 $a_tpl = new \ilTemplate(
"tpl.svy_results_details_chart.html",
true,
true,
"Modules/Survey/Evaluation");
422 if ($request->getShowChart()) {
423 $chart = $a_eval->
getChart($a_results);
425 if (is_array($chart)) {
427 if (is_array($chart[1])) {
428 foreach ($chart[1] as $legend_item) {
429 $r = hexdec(substr($legend_item[1], 1, 2));
430 $g = hexdec(substr($legend_item[1], 3, 2));
431 $b = hexdec(substr($legend_item[1], 5, 2));
433 $a_tpl->setCurrentBlock(
"legend_bl");
434 $a_tpl->setVariable(
"LEGEND_CAPTION", $legend_item[0]);
435 $a_tpl->setVariable(
"LEGEND_COLOR", $legend_item[1]);
436 $a_tpl->setVariable(
"LEGEND_COLOR_SVG", $r .
"," . $g .
"," .
$b);
437 $a_tpl->parseCurrentBlock();
444 $a_tpl->setVariable(
"CHART", $chart);
448 return $a_tpl->get();
458 $lng = $this->service->gui()->lng();
460 $a_tpl = new \ilTemplate(
"tpl.svy_results_details_text.html",
true,
true,
"Modules/Survey/Evaluation");
465 if (array_key_exists(
"", $texts)) {
466 $a_tpl->setVariable(
"TEXT_HEADING",
$lng->txt(
"given_answers"));
467 foreach ($texts[
""] as $item) {
468 $a_tpl->setCurrentBlock(
"text_direct_item_bl");
469 $a_tpl->setVariable(
"TEXT_DIRECT", nl2br(htmlentities($item)));
470 $a_tpl->parseCurrentBlock();
473 $acc = new \ilAccordionGUI();
474 $acc->setId(
"svyevaltxt" . $question->getId());
476 $a_tpl->setVariable(
"TEXT_HEADING",
$lng->txt(
"freetext_answers"));
478 foreach ($texts as $var => $items) {
479 $list = array(
"<ul class=\"small\">");
480 foreach ($items as $item) {
481 $list[] =
"<li>" . nl2br(htmlentities($item)) .
"</li>";
484 $acc->addItem((
string) $var, implode(
"\n", $list));
487 $a_tpl->setVariable(
"TEXT_ACC", $acc->getHTML());
490 return $a_tpl->get();
498 $ui_factory = $this->service->gui()->ui()->factory();
499 $lng = $this->service->gui()->lng();
506 $card_table_tpl = new \ilTemplate(
507 "tpl.svy_results_details_card.html",
510 "Modules/Survey/Evaluation" 518 if ($question_res->
getMedian() !== null) {
521 if ($question_res->
getMean() !== null) {
522 $kv[
"arithmetic_mean"] = $question_res->
getMean();
526 foreach ($kv as
$key => $value) {
527 $card_table_tpl->setCurrentBlock(
"question_statistics_card");
528 $card_table_tpl->setVariable(
"QUESTION_STATISTIC_KEY",
$lng->txt(
$key));
529 $card_table_tpl->setVariable(
"QUESTION_STATISTIC_VALUE", $value);
530 $card_table_tpl->parseCurrentBlock();
535 return $ui_factory->card()
536 ->standard($svy_type_title)
538 array($ui_factory->legacy($card_table_tpl->get()))
buildExportModal(string $a_id, string $a_cmd)
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:
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...
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)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
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.