19declare(strict_types=1);
47 $ts_results = new \ilRadioGroupInputGUI(
$lng->txt(
"survey_360_results"),
"ts_res");
51 $option->setInfo(
$lng->txt(
"survey_360_results_none_info"));
52 $ts_results->addOption($option);
54 $option = new \ilRadioOption(
55 $lng->txt(
"survey_360_results_own"),
58 $option->setInfo(
$lng->txt(
"survey_360_results_own_info"));
59 $ts_results->addOption($option);
61 $items[] = $ts_results;
74 $cb = new \ilCheckboxInputGUI(
$lng->txt(
"survey_notification_target_group"),
"remind_appraisees");
75 $cb->setOptionTitle(
$lng->txt(
"survey_360_appraisees"));
76 $cb->setInfo(
$lng->txt(
"survey_360_appraisees_remind_info"));
88 $cb = new \ilCheckboxInputGUI(
"",
"remind_raters");
89 $cb->setOptionTitle(
$lng->txt(
"survey_360_raters"));
90 $cb->setInfo(
$lng->txt(
"survey_360_raters_remind_info"));
108 if ($form->getInput(
"remind_appraisees") && $form->getInput(
"remind_raters")) {
110 } elseif ($form->getInput(
"remind_appraisees")) {
112 } elseif ($form->getInput(
"remind_raters")) {
126 $this->addApprSelectionToToolbar(
132 return $this->getExportAndPrintComponents(
143 $toolbar = $this->gui->
toolbar();
145 $this->addApprSelectionToToolbar(
151 $this->addRaterSelectionToToolbar(
168 $lng = $this->service->gui()->
lng();
169 $ctrl = $this->service->gui()->ctrl();
170 $req = $this->service->gui()->evaluation($survey)->request();
172 $evaluation_manager = $this->service->domain()->evaluation(
175 $req->getAppraiseeId(),
179 if (!$evaluation_manager->isMultiParticipantsView()) {
180 $raters = $evaluation_manager->getSelectableRaters();
182 if (count($raters) > 0) {
185 foreach ($raters as $rater) {
186 $options[$rater[
"user_id"]] = $rater[
"name"];
189 $rat = new \ilSelectInputGUI(
$lng->txt(
"svy_rater"),
"rater_id");
191 $rat->setValue($evaluation_manager->getCurrentRater(
true));
195 $this->gui->lng()->txt(
"svy_select_rater"),
197 )->submit()->toToolbar(
false, $toolbar);
219 protected function getPanelTable(
224 $a_results = $a_eval->getResults();
225 $lng = $this->service->gui()->lng();
227 if (is_array($a_results)) {
228 $answers = $a_results[0][1]->getAnswers();
229 $q = $a_results[0][1]->getQuestion();
232 $answers = $a_results->getAnswers();
233 $q = $a_results->getQuestion();
236 if (!in_array(
$q->getQuestionType(), [
237 "SurveySingleChoiceQuestion",
238 "SurveyMultipleChoiceQuestion",
239 "SurveyMetricQuestion",
249 $a_tpl = new \ilTemplate(
250 "tpl.svy_results_details_table.html",
253 "components/ILIAS/Survey/Evaluation"
258 if ($request->getShowTable()) {
261 $a_tpl->setCurrentBlock(
"grid_col_header_bl");
262 $a_tpl->setVariable(
"COL_HEADER",
$lng->txt(
"svy_rater"));
263 $a_tpl->parseCurrentBlock();
266 $a_tpl->setCurrentBlock(
"grid_col_header_bl");
267 $a_tpl->setVariable(
"COL_HEADER",
$lng->txt(
"date"));
268 $a_tpl->parseCurrentBlock();
271 $a_tpl->setCurrentBlock(
"grid_col_header_bl");
272 $a_tpl->setVariable(
"COL_HEADER",
$lng->txt(
"answers"));
273 $a_tpl->parseCurrentBlock();
275 $condensed_answers = [];
276 foreach ($answers as $answer) {
277 $condensed_answers[$answer->active_id][
"tstamp"] = $answer->tstamp;
278 $condensed_answers[$answer->active_id][
"active_id"] = $answer->active_id;
280 $condensed_answers[$answer->active_id][
"value"][] = $answer->value;
281 $condensed_answers[$answer->active_id][
"text"] = $answer->text;
285 foreach ($condensed_answers as $answer) {
287 $a_tpl->setCurrentBlock(
"grid_col_bl");
288 $a_tpl->setVariable(
"COL_CAPTION",
" ");
289 $a_tpl->parseCurrentBlock();
292 $participant = $this->getParticipantByActiveId($participants, $answer[
"active_id"]);
295 $part_caption = $this->getCaptionForParticipant($participant);
297 $a_tpl->setCurrentBlock(
"grid_col_bl");
298 $a_tpl->setVariable(
"COL_CAPTION", $part_caption);
299 $a_tpl->parseCurrentBlock();
302 $a_tpl->setCurrentBlock(
"grid_col_bl");
303 $date = new \ilDate($answer[
"tstamp"],
IL_CAL_UNIX);
308 $a_tpl->parseCurrentBlock();
311 $a_tpl->setCurrentBlock(
"grid_col_bl");
312 if (
$q->getQuestionType() ===
"SurveyTextQuestion") {
315 $a_results->getScaleText($answer[
"text"])
318 $scale_texts = array_map(
static function ($v) use ($a_results):
string {
319 return $a_results->getScaleText($v);
320 }, $answer[
"value"]);
323 implode(
", ", $scale_texts)
326 $a_tpl->parseCurrentBlock();
328 $a_tpl->touchBlock(
"grid_row_bl");
330 $ret = $a_tpl->get();
333 foreach ($answers as $answer) {
336 $cats =
$q->getColumns();
337 foreach ($cats->getCategories() as $cat) {
338 $a_tpl->touchBlock(
"grid_col_head_center");
339 $a_tpl->setCurrentBlock(
"grid_col_header_bl");
340 $a_tpl->setVariable(
"COL_HEADER", $cat->title);
341 $a_tpl->parseCurrentBlock();
344 $cats_rows =
$q->getRows();
347 foreach ($cats_rows->getCategories() as $cat) {
348 $a_tpl->setCurrentBlock(
"grid_col_bl");
349 $a_tpl->setVariable(
"COL_CAPTION", $cat->title);
350 $a_tpl->parseCurrentBlock();
352 $r = current($a_results);
353 $row_answers = $r[1]->getAnswers();
354 $user_answers =
null;
355 foreach ($row_answers as $ra) {
356 if ($ra->active_id == $answer->active_id) {
361 foreach ($cats->getCategories() as $catr) {
362 if ($user_answers && $user_answers->value == $catr->scale) {
363 $a_tpl->touchBlock(
"grid_col_center");
364 $a_tpl->setCurrentBlock(
"grid_col_bl");
365 $a_tpl->setVariable(
"COL_CAPTION",
"X");
367 $a_tpl->setCurrentBlock(
"grid_col_bl");
368 $a_tpl->setVariable(
"COL_CAPTION",
" ");
371 $a_tpl->parseCurrentBlock();
374 $a_tpl->touchBlock(
"grid_row_bl");
379 $participant = $this->getParticipantByActiveId($participants, $answer->active_id);
382 $part_caption = $participant[
"sortname"];
387 $a_tpl->setVariable(
"HEADER", $part_caption);
388 $ret .= $a_tpl->get();
389 $a_tpl = new \ilTemplate(
390 "tpl.svy_results_details_table.html",
393 "components/ILIAS/Survey/Evaluation"
403 foreach ($participants as $part) {
404 if ((
int) $part[
"active_id"] === $active_id) {
413 return $part_array[
"sortname"];
Survey internal ui service.
addRaterSelectionToToolbar(\ilObjSurvey $survey, \ilToolbarGUI $toolbar, int $user_id)
Add rater selection to toolbar.
getSurveySettingsResults(\ilObjSurvey $survey, InternalGUIService $ui_service)
getCaptionForParticipant(array $part_array)
getSurveySettingsGeneral(\ilObjSurvey $survey)
setResultsDetailToolbar(\ilObjSurvey $survey, int $user_id, \ilTemplate $eval_tpl)
getPanelChart(\ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
getSurveySettingsReminderTargets(\ilObjSurvey $survey, InternalGUIService $ui_service)
getParticipantByActiveId(array $participants, int $active_id)
setResultsCompetenceToolbar(\ilObjSurvey $survey, int $user_id)
getPanelText(\ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval, \ilSurveyEvaluationResults $question_res)
setValuesFromForm(\ilObjSurvey $survey, \ilPropertyFormGUI $form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
set360Results(int $a_value)
const NOTIFICATION_APPRAISEES_AND_RATERS
setReminderTarget(int $a_value)
const NOTIFICATION_APPRAISEES
const NOTIFICATION_RATERS
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
catch(\Exception $e) $req
if(!file_exists('../ilias.ini.php'))