ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjExerciseGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 require_once "./Services/Object/classes/class.ilObjectGUI.php";
6 
24 {
29  function __construct($a_data,$a_id,$a_call_by_reference,$a_prepare_output = true)
30  {
31  global $lng;
32 
33  $this->type = "exc";
34  parent::__construct($a_data,$a_id,$a_call_by_reference,false);
35 
36  $lng->loadLanguageModule("exercise");
37  $lng->loadLanguageModule("exc");
38  $this->ctrl->saveParameter($this, "ass_id");
39 
40  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
41  if ($_REQUEST["ass_id"] > 0 && is_object($this->object) && ilExAssignment::lookupExerciseId($_REQUEST["ass_id"]) == $this->object->getId())
42  {
43  $this->ass = new ilExAssignment((int) $_REQUEST["ass_id"]);
44  }
45  else if ($_REQUEST["ass_id"] > 0)
46  {
47  include_once("./Modules/Exercise/exceptions/class.ilExerciseException.php");
48  throw new ilExerciseException("Assignment ID does not match Exercise.");
49  }
50  }
51 
52  function executeCommand()
53  {
54  global $ilUser,$ilCtrl, $ilTabs, $lng;
55 
56  $next_class = $this->ctrl->getNextClass($this);
57  $cmd = $this->ctrl->getCmd();
58  $this->prepareOutput();
59 
60 //echo "-".$next_class."-".$cmd."-"; exit;
61  switch($next_class)
62  {
63  case "ilinfoscreengui":
64  $ilTabs->activateTab("info");
65  $this->infoScreen(); // forwards command
66  break;
67 
68  case 'ilpermissiongui':
69  $ilTabs->activateTab("permissions");
70  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
71  $perm_gui = new ilPermissionGUI($this);
72  $ret =& $this->ctrl->forwardCommand($perm_gui);
73  break;
74 
75  case "illearningprogressgui":
76  $ilTabs->activateTab("learning_progress");
77  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
78 
80  $this->object->getRefId(),
81  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
82  $this->ctrl->forwardCommand($new_gui);
83  $this->tabs_gui->setTabActive('learning_progress');
84  break;
85 
86  case 'ilobjectcopygui':
87  $ilCtrl->saveParameter($this, 'new_type');
88  $ilCtrl->setReturnByClass(get_class($this),'create');
89 
90  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
91  $cp = new ilObjectCopyGUI($this);
92  $cp->setType('exc');
93  $this->ctrl->forwardCommand($cp);
94  break;
95 
96  case "ilexportgui":
97  $ilTabs->activateTab("export");
98  include_once("./Services/Export/classes/class.ilExportGUI.php");
99  $exp_gui = new ilExportGUI($this);
100  $exp_gui->addFormat("xml");
101  $ret = $this->ctrl->forwardCommand($exp_gui);
102 // $this->tpl->show();
103  break;
104 
105  case "ilcommonactiondispatchergui":
106  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
108  $this->ctrl->forwardCommand($gui);
109  break;
110 
111  case "ilcertificategui":
112  $this->setSettingsSubTabs();
113  $this->tabs_gui->activateTab("settings");
114  $this->tabs_gui->activateSubTab("certificate");
115  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
116  include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
117  $output_gui = new ilCertificateGUI(new ilExerciseCertificateAdapter($this->object));
118  $this->ctrl->forwardCommand($output_gui);
119  break;
120 
121  case "ilexassignmenteditorgui":
122  $this->checkPermission("write");
123  $ilTabs->activateTab("content");
124  $this->addContentSubTabs("list_assignments");
125  include_once("./Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php");
126  $ass_gui = new ilExAssignmentEditorGUI($this->object->getId(), $this->object->isCompletionBySubmissionEnabled(), $this->ass);
127  $this->ctrl->forwardCommand($ass_gui);
128  break;
129 
130  case "ilexsubmissiongui":
131  $this->checkPermission("read");
132  $ilTabs->activateTab("content");
133  $this->addContentSubTabs("content");
134  $this->ctrl->setReturn($this, "showOverview");
135  include_once("./Modules/Exercise/classes/class.ilExSubmissionGUI.php");
136  $sub_gui = new ilExSubmissionGUI($this->object, $this->ass, (int)$_REQUEST["member_id"]);
137  $this->ctrl->forwardCommand($sub_gui);
138  break;
139 
140  case "ilexercisemanagementgui":
141  $this->checkPermission("write");
142  $ilTabs->activateTab("grades");
143  include_once("./Modules/Exercise/classes/class.ilExerciseManagementGUI.php");
144  $mgmt_gui = new ilExerciseManagementGUI($this->object, $this->ass);
145  $this->ctrl->forwardCommand($mgmt_gui);
146  break;
147 
148  case "ilexccriteriacataloguegui":
149  $this->checkPermission("write");
150  $ilTabs->activateTab("settings");
151  $this->setSettingsSubTabs();
152  $ilTabs->activateSubTab("crit");
153  include_once("./Modules/Exercise/classes/class.ilExcCriteriaCatalogueGUI.php");
154  $crit_gui = new ilExcCriteriaCatalogueGUI($this->object);
155  $this->ctrl->forwardCommand($crit_gui);
156  break;
157 
158  default:
159  if(!$cmd)
160  {
161  $cmd = "infoScreen";
162  }
163 
164  $cmd .= "Object";
165 
166  $this->$cmd();
167 
168  break;
169  }
170 
171  $this->addHeaderAction();
172 
173  return true;
174  }
175 
176  function viewObject()
177  {
178  $this->infoScreenObject();
179  }
180 
181  protected function afterSave(ilObject $a_new_object)
182  {
183  global $ilCtrl;
184 
185  $a_new_object->saveData();
186 
187  ilUtil::sendSuccess($this->lng->txt("exc_added"), true);
188 
189  $ilCtrl->setParameterByClass("ilExAssignmentEditorGUI", "ref_id", $a_new_object->getRefId());
190  $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "addAssignment");
191  }
192 
193  protected function listAssignmentsObject()
194  {
195  global $ilCtrl;
196 
197  $this->checkPermissionBool("write");
198 
199  // #16587
200  $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "listAssignments");
201  }
202 
206  protected function initEditCustomForm(ilPropertyFormGUI $a_form)
207  {
208  $a_form->setTitle($this->lng->txt("exc_edit_exercise"));
209 
211  $section->setTitle($this->lng->txt('exc_passing_exc'));
212  $a_form->addItem($section);
213 
214  // pass mode
215  $radg = new ilRadioGroupInputGUI($this->lng->txt("exc_pass_mode"), "pass_mode");
216 
217  $op1 = new ilRadioOption($this->lng->txt("exc_pass_all"), "all",
218  $this->lng->txt("exc_pass_all_info"));
219  $radg->addOption($op1);
220  $op2 = new ilRadioOption($this->lng->txt("exc_pass_minimum_nr"), "nr",
221  $this->lng->txt("exc_pass_minimum_nr_info"));
222  $radg->addOption($op2);
223 
224  // minimum number of assignments to pass
225  $ni = new ilNumberInputGUI($this->lng->txt("exc_min_nr"), "pass_nr");
226  $ni->setSize(4);
227  $ni->setMaxLength(4);
228  $ni->setRequired(true);
229  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
230  $mand = ilExAssignment::countMandatory($this->object->getId());
231  $min = max($mand, 1);
232  $ni->setMinValue($min, true);
233  $ni->setInfo($this->lng->txt("exc_min_nr_info"));
234  $op2->addSubItem($ni);
235 
236  $a_form->addItem($radg);
237 
238  // completion by submission
239  $subcompl = new ilRadioGroupInputGUI($this->lng->txt("exc_passed_status_determination"), "completion_by_submission");
240  $op1 = new ilRadioOption($this->lng->txt("exc_completion_by_tutor"), 0, "");
241  $subcompl->addOption($op1);
242  $op2 = new ilRadioOption($this->lng->txt("exc_completion_by_submission"), 1,$this->lng->txt("exc_completion_by_submission_info"));
243  $subcompl->addOption($op2);
244  $a_form->addItem($subcompl);
245 
246  /*$subcompl = new ilCheckboxInputGUI($this->lng->txt('exc_completion_by_submission'), 'completion_by_submission');
247  $subcompl->setInfo($this->lng->txt('exc_completion_by_submission_info'));
248  $subcompl->setValue(1);
249  $a_form->addItem($subcompl);*/
250 
252  $section->setTitle($this->lng->txt('exc_publishing'));
253  $a_form->addItem($section);
254 
255  // show submissions
256  $cb = new ilCheckboxInputGUI($this->lng->txt("exc_show_submissions"), "show_submissions");
257  $cb->setInfo($this->lng->txt("exc_show_submissions_info"));
258  $a_form->addItem($cb);
259 
261  $section->setTitle($this->lng->txt('exc_notification'));
262  $a_form->addItem($section);
263 
264  // submission notifications
265  $cbox = new ilCheckboxInputGUI($this->lng->txt("exc_submission_notification"), "notification");
266  $cbox->setInfo($this->lng->txt("exc_submission_notification_info"));
267  $a_form->addItem($cbox);
268 
269 
270  // feedback settings
271 
273  $section->setTitle($this->lng->txt('exc_feedback'));
274  $a_form->addItem($section);
275 
276  $fdb = new ilCheckboxGroupInputGUI($this->lng->txt("exc_settings_feedback"), "tfeedback");
277  $a_form->addItem($fdb);
278 
279  $option = new ilCheckboxOption($this->lng->txt("exc_settings_feedback_mail"), ilObjExercise::TUTOR_FEEDBACK_MAIL);
280  $option->setInfo($this->lng->txt("exc_settings_feedback_mail_info"));
281  $fdb->addOption($option);
282  $option = new ilCheckboxOption($this->lng->txt("exc_settings_feedback_file"), ilObjExercise::TUTOR_FEEDBACK_FILE);
283  $option->setInfo($this->lng->txt("exc_settings_feedback_file_info"));
284  $fdb->addOption($option);
285  $option = new ilCheckboxOption($this->lng->txt("exc_settings_feedback_text"), ilObjExercise::TUTOR_FEEDBACK_TEXT);
286  $option->setInfo($this->lng->txt("exc_settings_feedback_text_info"));
287  $fdb->addOption($option);
288  }
289 
293  protected function getEditFormCustomValues(array &$a_values)
294  {
295  global $ilUser;
296 
297  $a_values["desc"] = $this->object->getLongDescription();
298  $a_values["show_submissions"] = $this->object->getShowSubmissions();
299  $a_values["pass_mode"] = $this->object->getPassMode();
300  if ($a_values["pass_mode"] == "nr")
301  {
302  $a_values["pass_nr"] = $this->object->getPassNr();
303  }
304 
305  include_once "./Services/Notification/classes/class.ilNotification.php";
306  $a_values["notification"] = ilNotification::hasNotification(
308  $this->object->getId());
309 
310  $a_values['completion_by_submission'] = (int) $this->object->isCompletionBySubmissionEnabled();
311 
312  $tfeedback = array();
313  if($this->object->hasTutorFeedbackMail())
314  {
315  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_MAIL;
316  }
317  if($this->object->hasTutorFeedbackText())
318  {
319  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_TEXT;
320  }
321  if($this->object->hasTutorFeedbackFile())
322  {
323  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_FILE;
324  }
325  $a_values['tfeedback'] = $tfeedback;
326  }
327 
328  protected function updateCustom(ilPropertyFormGUI $a_form)
329  {
330  global $ilUser;
331  $this->object->setShowSubmissions($a_form->getInput("show_submissions"));
332  $this->object->setPassMode($a_form->getInput("pass_mode"));
333  if ($this->object->getPassMode() == "nr")
334  {
335  $this->object->setPassNr($a_form->getInput("pass_nr"));
336  }
337 
338  $this->object->setCompletionBySubmission($a_form->getInput('completion_by_submission') == 1 ? true : false);
339 
340  $feedback = $a_form->getInput("tfeedback");
341  $this->object->setTutorFeedback(is_array($feedback)
342  ? array_sum($feedback)
343  : null);
344 
345  include_once "./Services/Notification/classes/class.ilNotification.php";
347  $ilUser->getId(), $this->object->getId(),
348  (bool)$a_form->getInput("notification"));
349  }
350 
356  function addContentSubTabs($a_activate)
357  {
358  global $ilTabs, $lng, $ilCtrl;
359 
360  $ilTabs->addSubTab("content", $lng->txt("view"),
361  $ilCtrl->getLinkTarget($this, "showOverview"));
362  if ($this->checkPermissionBool("write"))
363  {
364  $ilTabs->addSubTab("list_assignments", $lng->txt("edit"),
365  $ilCtrl->getLinkTargetByClass("ilExAssignmentEditorGUI", "listAssignments"));
366  }
367  $ilTabs->activateSubTab($a_activate);
368  }
369 
375  function getTabs()
376  {
377  global $lng, $ilHelp;
378 
379  $ilHelp->setScreenIdComponent("exc");
380 
381  if ($this->checkPermissionBool("read"))
382  {
383  $this->tabs_gui->addTab("content",
384  $lng->txt("exc_assignments"),
385  $this->ctrl->getLinkTarget($this, "showOverview"));
386  }
387 
388  $next_class = strtolower($this->ctrl->getNextClass());
389  if ($this->checkPermissionBool("visible"))
390  {
391  $this->tabs_gui->addTab("info",
392  $lng->txt("info_short"),
393  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
394  }
395 
396  // edit properties
397  if ($this->checkPermissionBool("write"))
398  {
399  /*$tabs_gui->addTab("assignments",
400  $lng->txt("exc_edit_assignments"),
401  $this->ctrl->getLinkTarget($this, 'listAssignments'));*/
402 
403  $this->tabs_gui->addTab("settings",
404  $lng->txt("settings"),
405  $this->ctrl->getLinkTarget($this, 'edit'));
406 
407  $this->tabs_gui->addTab("grades",
408  $lng->txt("exc_submissions_and_grades"),
409  $this->ctrl->getLinkTargetByClass("ilexercisemanagementgui", "members"));
410  }
411 
412  // learning progress
413  $save_sort_order = $_GET["sort_order"]; // hack, because exercise sort parameters
414  $save_sort_by = $_GET["sort_by"]; // must not be forwarded to learning progress
415  $save_offset = $_GET["offset"];
416  $_GET["offset"] = $_GET["sort_by"] = $_GET["sort_order"] = "";
417 
418  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
419  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
420  {
421  $this->tabs_gui->addTab('learning_progress',
422  $lng->txt('learning_progress'),
423  $this->ctrl->getLinkTargetByClass(array('ilobjexercisegui','illearningprogressgui'),''));
424  }
425 
426  $_GET["sort_order"] = $save_sort_order; // hack, part ii
427  $_GET["sort_by"] = $save_sort_by;
428  $_GET["offset"] = $save_offset;
429 
430  // export
431  if ($this->checkPermissionBool("write"))
432  {
433  $this->tabs_gui->addTab("export",
434  $lng->txt("export"),
435  $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
436  }
437 
438 
439  // permissions
440  if ($this->checkPermissionBool("edit_permission"))
441  {
442  $this->tabs_gui->addTab('permissions',
443  $lng->txt("perm_settings"),
444  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
445  }
446  }
447 
453  function infoScreenObject()
454  {
455  $this->ctrl->setCmd("showSummary");
456  $this->ctrl->setCmdClass("ilinfoscreengui");
457  $this->infoScreen();
458  }
459 
463  function infoScreen()
464  {
465  global $ilUser, $ilTabs, $lng;
466 
467  $ilTabs->activateTab("info");
468 
469  $this->checkPermission("visible");
470 
471  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
472  $info = new ilInfoScreenGUI($this);
473 
474  $info->enablePrivateNotes();
475 
476  $info->enableNews();
477  if ($this->checkPermissionBool("write"))
478  {
479  $info->enableNewsEditing();
480  $info->setBlockProperty("news", "settings", true);
481  }
482 
483  // standard meta data
484  //$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
485 
486  // instructions
487  $info->addSection($this->lng->txt("exc_overview"));
488  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
489  $ass = ilExAssignment::getAssignmentDataOfExercise($this->object->getId());
490  $cnt = 0;
491  $mcnt = 0;
492  foreach ($ass as $a)
493  {
494  $cnt++;
495  if ($a["mandatory"])
496  {
497  $mcnt++;
498  }
499  }
500  $info->addProperty($lng->txt("exc_assignments"), $cnt);
501  $info->addProperty($lng->txt("exc_mandatory"), $mcnt);
502  if ($this->object->getPassMode() != "nr")
503  {
504  $info->addProperty($lng->txt("exc_pass_mode"),
505  $lng->txt("exc_msg_all_mandatory_ass"));
506  }
507  else
508  {
509  $info->addProperty($lng->txt("exc_pass_mode"),
510  sprintf($lng->txt("exc_msg_min_number_ass"), $this->object->getPassNr()));
511  }
512 
513  // feedback from tutor
514  include_once("Services/Tracking/classes/class.ilLPMarks.php");
515  if ($this->checkPermissionBool("read"))
516  {
517  $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
518  $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
519  //$status = ilExerciseMembers::_lookupStatus($this->object->getId(), $ilUser->getId());
520  $st = $this->object->determinStatusOfUser($ilUser->getId());
521  $status = $st["overall_status"];
522  if ($lpcomment != "" || $mark != "" || $status != "notgraded")
523  {
524  $info->addSection($this->lng->txt("exc_feedback_from_tutor"));
525  if ($lpcomment != "")
526  {
527  $info->addProperty($this->lng->txt("exc_comment"),
528  $lpcomment);
529  }
530  if ($mark != "")
531  {
532  $info->addProperty($this->lng->txt("exc_mark"),
533  $mark);
534  }
535 
536  //if ($status == "")
537  //{
538  // $info->addProperty($this->lng->txt("status"),
539  // $this->lng->txt("message_no_delivered_files"));
540  //}
541  //else
542  if ($status != "notgraded")
543  {
544  $img = '<img src="'.ilUtil::getImagePath("scorm/".$status.".svg").'" '.
545  ' alt="'.$lng->txt("exc_".$status).'" title="'.$lng->txt("exc_".$status).
546  '" />';
547 
548  $add = "";
549  if ($st["failed_a_mandatory"])
550  {
551  $add = " (".$lng->txt("exc_msg_failed_mandatory").")";
552  }
553  else if ($status == "failed")
554  {
555  $add = " (".$lng->txt("exc_msg_missed_minimum_number").")";
556  }
557  $info->addProperty($this->lng->txt("status"),
558  $img." ".$this->lng->txt("exc_".$status).$add);
559  }
560  }
561  }
562 
563  // forward the command
564  $this->ctrl->forwardCommand($info);
565  }
566 
567  function editObject()
568  {
569  $this->setSettingsSubTabs();
570  $this->tabs_gui->activateSubTab("edit");
571  return parent::editObject();
572  }
573 
574  protected function setSettingsSubTabs()
575  {
576  $this->tabs_gui->addSubTab("edit",
577  $this->lng->txt("general_settings"),
578  $this->ctrl->getLinkTarget($this, "edit"));
579 
580  $this->tabs_gui->addSubTab("crit",
581  $this->lng->txt("exc_criteria_catalogues"),
582  $this->ctrl->getLinkTargetByClass("ilexccriteriacataloguegui", ""));
583 
584  include_once "Services/Certificate/classes/class.ilCertificate.php";
586  {
587  $this->tabs_gui->addSubTab("certificate",
588  $this->lng->txt("certificate"),
589  $this->ctrl->getLinkTarget($this, "certificate"));
590  }
591  }
592 
598  public static function _goto($a_target, $a_raw)
599  {
600  global $lng, $ilAccess;
601 
602  $ass_id = null;
603  $parts = explode("_", $a_raw);
604  if(sizeof($parts) == 2)
605  {
606  $ass_id = (int)$parts[1];
607  }
608 
609  if ($ilAccess->checkAccess("read", "", $a_target))
610  {
611  if($ass_id)
612  {
613  $_GET["ass_id_goto"] = $ass_id;
614  }
615  $_GET["ref_id"] = $a_target;
616  $_GET["cmd"] = "showOverview";
617  $_GET["baseClass"] = "ilExerciseHandlerGUI";
618  include("ilias.php");
619  exit;
620  }
621  else if ($ilAccess->checkAccess("visible", "", $a_target))
622  {
623  $_GET["ref_id"] = $a_target;
624  $_GET["cmd"] = "infoScreen";
625  $_GET["baseClass"] = "ilExerciseHandlerGUI";
626  include("ilias.php");
627  exit;
628  }
629  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
630  {
631  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
634  }
635  }
636 
640  function addLocatorItems()
641  {
642  global $ilLocator;
643 
644  if (is_object($this->object))
645  {
646  // #17955
647  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "showOverview"), "", $_GET["ref_id"]);
648  }
649  }
650 
651 
655 
660  {
661  global $tpl, $ilTabs, $ilUser, $ilToolbar;
662 
663  $this->checkPermission("read");
664 
665  include_once("./Services/Tracking/classes/class.ilLearningProgress.php");
666  ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),
667  $this->object->getRefId(), 'exc');
668 
669  $ilTabs->activateTab("content");
670  $this->addContentSubTabs("content");
671 
672  // show certificate?
673  if($this->object->hasUserCertificate($ilUser->getId()))
674  {
675  include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
676  include_once "./Services/Certificate/classes/class.ilCertificate.php";
677  $adapter = new ilExerciseCertificateAdapter($this->object);
679  {
680  $ilToolbar->addButton($this->lng->txt("certificate"),
681  $this->ctrl->getLinkTarget($this, "outCertificate"));
682  }
683  }
684 
685  include_once("./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
686  $ass_gui = new ilExAssignmentGUI($this->object);
687 
688  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
689  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
690  $acc = new ilAccordionGUI();
691  $acc->setId("exc_ow_".$this->object->getId());
692 
693  $ass_data = ilExAssignment::getInstancesByExercise($this->object->getId());
694  foreach ($ass_data as $ass)
695  {
696  // incoming assignment deeplink
697  $force_open = false;
698  if(isset($_GET["ass_id_goto"]) &&
699  (int)$_GET["ass_id_goto"] == $ass->getId())
700  {
701  $force_open = true;
702  }
703 
704  $acc->addItem($ass_gui->getOverviewHeader($ass),
705  $ass_gui->getOverviewBody($ass),
706  $force_open);
707  }
708 
709  if (count($ass_data) < 2)
710  {
711  $acc->setBehaviour("FirstOpen");
712  }
713  else
714  {
715  $acc->setUseSessionStorage(true);
716  }
717 
718  $tpl->setContent($acc->getHTML());
719  }
720 
721  function certificateObject()
722  {
723  $this->setSettingsSubTabs();
724  $this->tabs_gui->activateTab("settings");
725  $this->tabs_gui->activateSubTab("certificate");
726 
727  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
728  include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
729  $output_gui = new ilCertificateGUI(new ilExerciseCertificateAdapter($this->object));
730  $output_gui->certificateEditor();
731  }
732 
734  {
735  global $ilUser;
736 
737  if($this->object->hasUserCertificate($ilUser->getId()))
738  {
739  ilUtil::sendFailure($this->lng->txt("msg_failed"));
740  $this->showOverviewObject();
741  }
742 
743  include_once "./Services/Certificate/classes/class.ilCertificate.php";
744  include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
745  $certificate = new ilCertificate(new ilExerciseCertificateAdapter($this->object));
746  $certificate->outCertificate(array("user_id" => $ilUser->getId()));
747  }
748 
749 }
750 
751 ?>
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilExAssignmentEditorGUI.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor public.
This class represents an option in a radio group.
Class ilExcCriteriaCatalogueGUI.
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
Class ilInfoScreenGUI.
Exercise assignment.
static countMandatory($a_ex_id)
Order assignments by deadline date.
This class represents an option in a checkbox group.
static _isComplete($adapter)
Checks the status of the certificate.
This class represents a property form user interface.
GUI class for the workflow of copying objects.
$_GET["client_id"]
This class represents a section header in a property form.
Class ilObjExerciseGUI.
Class ilObject Basic functions for all objects.
updateCustom(ilPropertyFormGUI $a_form)
$cmd
Definition: sahs_server.php:35
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
addItem($a_item)
Add Item (Property, SectionHeader).
getEditFormCustomValues(array &$a_values)
Get values for properties form.
setInfo($a_info)
Set Info.
static _goto($a_target, $a_raw)
redirect script
addContentSubTabs($a_activate)
Add subtabs of content view.
global $ilCtrl
Definition: ilias.php:18
showOverviewObject()
Show overview of assignments.
setInfo($a_info)
Set Information Text.
GUI class for exercise assignments.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77
$section
Definition: Utf8Test.php:83
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
$info
Definition: example_052.php:80
prepareOutput($a_show_subobjects=true)
prepare output
This class represents a property in a property form.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
getTabs()
adds tabs to tab gui object
setTitle($a_title)
Set Title.
This class represents a number property in a property form.
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
static getInstancesByExercise($a_exc_id)
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
GUI class to create PDF certificates.
$ilUser
Definition: imgupload.php:18
This class represents a property in a property form.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilExerciseManagementGUI.
setSize($a_size)
Set Size.
afterSave(ilObject $a_new_object)
Create new PHPExcel object
obj_idprivate
$ret
Definition: parser.php:6
getRefId()
get reference id public
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Create PDF certificates.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static lookupExerciseId($a_ass_id)
Lookup excercise id for assignment id.
static _lookupMark($a_usr_id, $a_obj_id)
static _lookupComment($a_usr_id, $a_obj_id)
initEditCustomForm(ilPropertyFormGUI $a_form)
Init properties form.
Accordion user interface class.
addHeaderAction()
Add header action menu.
infoScreen()
show information screen
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilExSubmissionGUI.
addLocatorItems()
Add locator item.
Class to report exception.