ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjExerciseGUI Class Reference
+ Inheritance diagram for ilObjExerciseGUI:
+ Collaboration diagram for ilObjExerciseGUI:

Public Member Functions

 __construct ($a_data, int $a_id, bool $a_call_by_reference)
 
 viewObject ()
 
 addContentSubTabs (string $a_activate)
 
 infoScreenObject ()
 
 editObject ()
 
 showOverviewObject ()
 
 certificateObject ()
 
 outCertificateObject ()
 
 startAssignmentObject ()
 Start assignment with relative deadline. More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target, string $a_raw)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 afterSave (ilObject $a_new_object)
 
 listAssignmentsObject ()
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 getService ()
 
 setSettingsSubTabs ()
 
 addLocatorItems ()
 Add locator item. More...
 
 getCurrentMode ()
 
 getModeLink (string $mode)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Protected Attributes

ilCertificateDownloadValidator $certificateDownloadValidator
 
ILIAS DI UIServices $ui
 
Exercise Assignment AssignmentManager $ass_manager
 
Exercise Notification NotificationManager $notification
 
Exercise InternalGUIService $gui
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
ilExAssignment $ass = null
 
InternalService $service
 
Exercise GUIRequest $exercise_request
 
Exercise InternalGUIService $exercise_ui
 
int $requested_ass_id
 
int $lp_user_id
 
string $requested_sort_order
 
string $requested_sort_by
 
int $requested_offset
 
int $requested_ref_id
 
int $requested_ass_id_goto
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Attributes

Exercise Assignment ItemBuilderUI $item_builder
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjExerciseGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference 
)
Exceptions
ilExerciseException

Definition at line 57 of file class.ilObjExerciseGUI.php.

References $ass, ilObjectGUI\$ctrl, $DIC, $GLOBALS, ilObjectGUI\$lng, $lp_user_id, ilObjectGUI\$object, $tabs, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\access(), addContentSubTabs(), ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjectGUI\executeCommand(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getService(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\locator(), ilExAssignment\lookupExerciseId(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\UI\examples\Symbol\Glyph\Notification\notification(), ILIAS\Repository\object(), ilObjectGUI\prepareOutput(), setSettingsSubTabs(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

58  {
59  global $DIC;
60 
61  $this->lng = $DIC->language();
62  $this->user = $DIC->user();
63  $this->ctrl = $DIC->ctrl();
64  $this->tabs = $DIC->tabs();
65  $this->help = $DIC["ilHelp"];
66  $this->locator = $DIC["ilLocator"];
67  $this->tpl = $DIC["tpl"];
68  $this->toolbar = $DIC->toolbar();
69  $lng = $DIC->language();
70 
71  $this->lng->loadLanguageModule('cert');
72 
73  $this->type = "exc";
74  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
75 
76  $lng->loadLanguageModule("exercise");
77  $lng->loadLanguageModule("exc");
78  $this->ctrl->saveParameter($this, ["ass_id", "mode", "from_overview"]);
79 
80  $this->service = $DIC->exercise()->internal();
81  $this->gui = $this->service->gui();
82  $this->exercise_request = $DIC->exercise()->internal()->gui()->request();
83  $this->exercise_ui = $DIC->exercise()->internal()->gui();
84  $this->requested_ass_id = $this->exercise_request->getAssId();
85 
86  if ($this->requested_ass_id > 0 && is_object($this->object) && ilExAssignment::lookupExerciseId(
87  $this->requested_ass_id
88  ) === $this->object->getId()) {
89  $this->ass = $this->exercise_request->getAssignment();
90  } elseif ($this->requested_ass_id > 0) {
91  throw new ilExerciseException("Assignment ID does not match Exercise.");
92  }
93  $this->lp_user_id = ($this->exercise_request->getUserId() > 0 && $this->access->checkAccess("read_learning_progress", "", $this->exercise_request->getRefId()))
94  ? $this->exercise_request->getUserId()
95  : $this->user->getId();
96  $this->requested_sort_order = $this->exercise_request->getSortOrder();
97  $this->requested_sort_by = $this->exercise_request->getSortBy();
98  $this->requested_offset = $this->exercise_request->getOffset();
99  $this->requested_ref_id = $this->exercise_request->getRefId();
100  $this->requested_ass_id_goto = $this->exercise_request->getAssIdGoto();
101  $this->ui = $this->service->gui()->ui();
102  $this->certificateDownloadValidator = new ilCertificateDownloadValidator();
103  $this->notification = $this->service->domain()->notification($this->requested_ref_id);
104 
105  if ($this->object) {
106  $this->ass_manager = $this->service->domain()->assignment()->assignments(
107  $this->object->getId(),
108  $this->user->getId()
109  );
110  $this->item_builder = $this->service->gui()->assignment()->itemBuilder(
111  $this->object,
112  $this->service->domain()->assignment()->mandatoryAssignments($this->object)
113  );
114  }
115  }
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
ilLanguage $lng
__construct(VocabulariesInterface $vocabularies)
Validates if an active certificate is stored in the database and can be downloaded by the user...
static lookupExerciseId(int $a_ass_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjExerciseGUI::_goto ( string  $a_target,
string  $a_raw 
)
static

Definition at line 846 of file class.ilObjExerciseGUI.php.

References $DIC.

Referenced by ILIAS\StaticURL\Handler\LegacyGotoHandler\handle().

849  : void {
850  global $DIC;
851 
852  $DIC->exercise()->internal()->gui()->permanentLink()->goto($a_target, $a_raw);
853  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ addContentSubTabs()

ilObjExerciseGUI::addContentSubTabs ( string  $a_activate)

Definition at line 553 of file class.ilObjExerciseGUI.php.

References ilObjectGUI\$ctrl, $help, ilObjectGUI\$lng, $tabs, ILIAS\Repository\access(), ilLearningProgressAccess\checkAccess(), ilObjectGUI\checkPermissionBool(), ilCtrl\clearParametersByClass(), ILIAS\Repository\ctrl(), ilCtrl\getLinkTarget(), ilObjectGUI\getTabs(), ILIAS\Repository\object(), and ilLanguage\txt().

Referenced by __construct(), and showOverviewObject().

553  : void
554  {
555  $ilTabs = $this->tabs;
556  $lng = $this->lng;
557  $ilCtrl = $this->ctrl;
558 
559  $ilTabs->addSubTab(
560  "content",
561  $lng->txt("view"),
562  $ilCtrl->getLinkTarget($this, "showOverview")
563  );
564  if ($this->checkPermissionBool("write")) {
565  $ilTabs->addSubTab(
566  "list_assignments",
567  $lng->txt("edit"),
568  $ilCtrl->getLinkTargetByClass("ilExAssignmentEditorGUI", "listAssignments")
569  );
570  }
571  $ilTabs->activateSubTab($a_activate);
572  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjExerciseGUI::addLocatorItems ( )
protected

Add locator item.

Definition at line 858 of file class.ilObjExerciseGUI.php.

References ilObjectGUI\$locator, $requested_ref_id, ilLocatorGUI\addItem(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

858  : void
859  {
860  $ilLocator = $this->locator;
861 
862  if (is_object($this->object)) {
863  // #17955
864  $ilLocator->addItem(
865  $this->object->getTitle(),
866  $this->ctrl->getLinkTarget($this, "showOverview"),
867  "",
869  );
870  }
871  }
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ afterSave()

ilObjExerciseGUI::afterSave ( ilObject  $a_new_object)
protected

Definition at line 274 of file class.ilObjExerciseGUI.php.

References ilObjectGUI\$ctrl, ilObject\getRefId(), and ILIAS\Repository\lng().

274  : void
275  {
276  $ilCtrl = $this->ctrl;
277 
278  $a_new_object->saveData();
279 
280  $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_added"), true);
281 
282  $ilCtrl->setParameterByClass("ilExAssignmentEditorGUI", "ref_id", $a_new_object->getRefId());
283  $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "addAssignment");
284  }
+ Here is the call graph for this function:

◆ certificateObject()

ilObjExerciseGUI::certificateObject ( )
Exceptions
ilException

Definition at line 994 of file class.ilObjExerciseGUI.php.

References ilObjectGUI\checkPermission(), and setSettingsSubTabs().

994  : void
995  {
996  $this->checkPermission("write");
997  $this->setSettingsSubTabs();
998  $this->tabs_gui->activateTab("settings");
999  $this->tabs_gui->activateSubTab("certificate");
1000 
1001  $guiFactory = new ilCertificateGUIFactory();
1002  $output_gui = $guiFactory->create($this->object);
1003 
1004  $output_gui->certificateEditor();
1005  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ editObject()

ilObjExerciseGUI::editObject ( )

Definition at line 815 of file class.ilObjExerciseGUI.php.

References setSettingsSubTabs().

815  : void
816  {
817  $this->setSettingsSubTabs();
818  $this->tabs_gui->activateSubTab("edit");
819  parent::editObject();
820  }
+ Here is the call graph for this function:

◆ getCurrentMode()

ilObjExerciseGUI::getCurrentMode ( )
protected

Definition at line 978 of file class.ilObjExerciseGUI.php.

Referenced by showOverviewObject().

978  : string
979  {
980  return $this->ass_manager->getValidListMode($this->exercise_request->getMode());
981  }
+ Here is the caller graph for this function:

◆ getEditFormCustomValues()

ilObjExerciseGUI::getEditFormCustomValues ( array &  $a_values)
protected

Definition at line 464 of file class.ilObjExerciseGUI.php.

References ilObjectGUI\$user, ilContainer\_lookupContainerSetting(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilOrgUnitGlobalSettings\getInstance(), ilObject\getLongDescription(), ilNotification\hasNotification(), ILIAS\Repository\int(), ILIAS\Repository\object(), ilObjExercise\TUTOR_FEEDBACK_FILE, ilObjExercise\TUTOR_FEEDBACK_MAIL, ilObjExercise\TUTOR_FEEDBACK_TEXT, and ilNotification\TYPE_EXERCISE_SUBMISSION.

464  : void
465  {
466  $ilUser = $this->user;
467 
468  $a_values["desc"] = $this->object->getLongDescription();
469  $a_values["show_submissions"] = $this->object->getShowSubmissions();
470  $a_values["pass_mode"] = $this->object->getPassMode();
471  if ($a_values["pass_mode"] == "nr") {
472  $a_values["pass_nr"] = $this->object->getPassNr();
473  }
474 
475  $a_values["nr_random_mand"] = $this->object->getNrMandatoryRandom();
476 
477  $a_values["notification"] = ilNotification::hasNotification(
479  $ilUser->getId(),
480  $this->object->getId()
481  );
482 
483  $a_values['completion_by_submission'] = (int) $this->object->isCompletionBySubmissionEnabled();
484 
485  $tfeedback = array();
486  if ($this->object->hasTutorFeedbackMail()) {
487  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_MAIL;
488  }
489  if ($this->object->hasTutorFeedbackText()) {
490  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_TEXT;
491  }
492  if ($this->object->hasTutorFeedbackFile()) {
493  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_FILE;
494  }
495  $a_values['tfeedback'] = $tfeedback;
496 
497  // orgunit position setting enabled
498  $a_values['obj_orgunit_positions'] = ilOrgUnitGlobalSettings::getInstance()
499  ->isPositionAccessActiveForObject(
500  $this->object->getId()
501  );
502 
503  $a_values['cont_custom_md'] = ilContainer::_lookupContainerSetting(
504  $this->object->getId(),
506  false
507  );
508  }
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
getLongDescription()
get object long description (stored in object_description)
+ Here is the call graph for this function:

◆ getModeLink()

ilObjExerciseGUI::getModeLink ( string  $mode)
protected

Definition at line 983 of file class.ilObjExerciseGUI.php.

References ILIAS\Repository\ctrl().

Referenced by showOverviewObject().

983  : string
984  {
985  $this->ctrl->setParameterByClass(self::class, "mode", $mode);
986  $link = $this->ctrl->getLinkTargetByClass(self::class, "showOverview");
987  $this->ctrl->setParameterByClass(self::class, "mode", null);
988  return $link;
989  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getService()

◆ infoScreenObject()

ilObjExerciseGUI::infoScreenObject ( )
Exceptions
ilObjectException

Definition at line 674 of file class.ilObjExerciseGUI.php.

References ILIAS\Repository\ctrl().

Referenced by viewObject().

674  : void
675  {
676  $this->ctrl->setCmd("showSummary");
677  $this->ctrl->setCmdClass("ilinfoscreengui");
678  $this->infoScreen();
679  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listAssignmentsObject()

◆ outCertificateObject()

ilObjExerciseGUI::outCertificateObject ( )

Definition at line 1007 of file class.ilObjExerciseGUI.php.

References $DIC, ilObjectGUI\$user, ILIAS\Repository\ctrl(), ilCertificatePdfAction\downloadPdf(), ilObject\getId(), and ILIAS\Repository\lng().

1007  : void
1008  {
1009  global $DIC;
1010 
1011  $database = $DIC->database();
1012  $logger = $DIC->logger()->root();
1013 
1014  $ilUser = $this->user;
1015 
1016  $objectId = $this->object->getId();
1017 
1018  if (!$this->certificateDownloadValidator->isCertificateDownloadable($ilUser->getId(), $objectId)) {
1019  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
1020  $this->ctrl->redirect($this);
1021  }
1022 
1023  $ilUserCertificateRepository = new ilUserCertificateRepository($database, $logger);
1024  $pdfGenerator = new ilPdfGenerator($ilUserCertificateRepository);
1025 
1026  $pdfAction = new ilCertificatePdfAction(
1027  $pdfGenerator,
1029  $this->lng->txt('error_creating_certificate_pdf')
1030  );
1031 
1032  $pdfAction->downloadPdf($ilUser->getId(), $objectId);
1033  }
global $DIC
Definition: feed.php:28
Just a wrapper class to create Unit Test for other classes.
downloadPdf(int $userId, int $objectId)
+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjExerciseGUI::setSettingsSubTabs ( )
protected

Definition at line 822 of file class.ilObjExerciseGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by __construct(), certificateObject(), and editObject().

822  : void
823  {
824  $this->tabs_gui->addSubTab(
825  "edit",
826  $this->lng->txt("general_settings"),
827  $this->ctrl->getLinkTarget($this, "edit")
828  );
829 
830  $this->tabs_gui->addSubTab(
831  "crit",
832  $this->lng->txt("exc_criteria_catalogues"),
833  $this->ctrl->getLinkTargetByClass("ilexccriteriacataloguegui", "")
834  );
835 
836  $validator = new ilCertificateActiveValidator();
837  if ($validator->validate()) {
838  $this->tabs_gui->addSubTab(
839  "certificate",
840  $this->lng->txt("certificate"),
841  $this->ctrl->getLinkTarget($this, "certificate")
842  );
843  }
844  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showOverviewObject()

ilObjExerciseGUI::showOverviewObject ( )
Exceptions
ilObjectNotFoundException
ilCtrlException
ilDatabaseException
ilObjectException
ilExcUnknownAssignmentTypeException
ilDateTimeException

Definition at line 886 of file class.ilObjExerciseGUI.php.

References $ass, $ass_manager, Vendor\Package\$f, ilObjectGUI\$html, ilObjectGUI\$object, $r, ilObjectGUI\$toolbar, $txt, ilObjectGUI\$user, ilLearningProgress\_tracProgress(), ilTabsGUI\activateTab(), ilToolbarGUI\addButton(), addContentSubTabs(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), getCurrentMode(), ilExAssignment\getId(), ilObject\getId(), ilExAssignment\getInstancesByExercise(), getModeLink(), getService(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

886  : void
887  {
888  $this->ctrl->setParameterByClass(self::class, "from_overview", "1");
889  $user = $this->service->domain()->user();
890  $toolbar = $this->service->gui()->toolbar();
891  $tabs = $this->service->gui()->tabs();
892 
893  $this->checkPermission("read");
894 
895  $tabs->activateTab("content");
896  $this->addContentSubTabs("list");
897 
898  if ($this->handleRandomAssignmentEntryPage()) {
899  return;
900  }
901 
902  //$tpl->addJavaScript("./Modules/Exercise/js/ilExcPresentation.js");
903 
904  $exc = $this->object;
905 
907  $user->getId(),
908  $exc->getId(),
909  $exc->getRefId(),
910  'exc'
911  );
912 
913  if ($this->certificateDownloadValidator->isCertificateDownloadable(
914  $user->getId(),
915  $exc->getId()
916  )) {
918  $this->lng->txt("certificate"),
919  $this->ctrl->getLinkTarget($this, "outCertificate")
920  );
921  }
922 
923  $ass_gui = new ilExAssignmentGUI($exc, $this->getService());
924 
925  $f = $this->ui->factory();
926  $r = $this->ui->renderer();
927 
928  $ass_data = ilExAssignment::getInstancesByExercise($exc->getId());
929  $random_manager = $this->service->domain()->assignment()->randomAssignments($exc);
930  $am = $this->ass_manager;
931  if ($this->getCurrentMode() === $am::TYPE_ALL) {
932  $list_modes = [$am::TYPE_ONGOING,$am::TYPE_FUTURE,$am::TYPE_PAST];
933  } else {
934  $list_modes = [$this->getCurrentMode()];
935  }
936  foreach ($list_modes as $lm) {
937  $items[$lm] = [];
938  foreach ($this->ass_manager->getList($lm) as $ass) {
939  if (!$random_manager->isAssignmentVisible($ass->getId(), $this->user->getId())) {
940  continue;
941  }
942  $items[$lm][] = $this->item_builder->getItem($ass, $user->getId());
943  }
944  }
945 
946  // new
947  $groups = [];
948  foreach ($items as $lm => $it) {
949  if (count($it) > 0) {
950  $groups[] = $f->item()->group($this->lng->txt("exc_" . $lm), $it);
951  }
952  }
953  if (count($groups) > 0) {
954  $panel = $f->panel()->listing()->standard($this->lng->txt("exc_assignments"), $groups);
955  } else {
956  $panel = $f->panel()->standard($this->lng->txt("exc_assignments"), $f->messageBox()->info($this->lng->txt("exc_no_assignments")));
957  }
958 
959  $mode_options = [];
960  foreach ($am->getListModes() as $mode => $txt) {
961  $mode_options[$txt] = $this->getModeLink($mode);
962  }
963  $mode = $f->viewControl()->mode(
964  $mode_options,
965  $this->lng->txt("exc_mode_selection")
966  )->withActive($am->getListModeLabel($this->getCurrentMode()));
967 
968  $html = "";
969  $l = $f->legacy("<br><br>");
970  $html .= $r->render([$mode, $l, $panel]);
971 
972  $this->tpl->setContent(
973  $html
974  );
975  $this->ctrl->setParameterByClass(self::class, "from_overview", null);
976  }
addContentSubTabs(string $a_activate)
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
Exercise Assignment AssignmentManager $ass_manager
GUI class for exercise assignments.
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')
ilToolbarGUI $toolbar
$txt
Definition: error.php:14
static getInstancesByExercise(int $a_exc_id)
activateTab(string $a_id)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
$r
+ Here is the call graph for this function:

◆ startAssignmentObject()

ilObjExerciseGUI::startAssignmentObject ( )

Start assignment with relative deadline.

Definition at line 1038 of file class.ilObjExerciseGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$object, ilObjectGUI\$user, ILIAS\Exercise\InternalService\domain(), ilObject\getId(), ilExcAssMemberState\getInstanceByIds(), getService(), ILIAS\UI\examples\Symbol\Glyph\Notification\notification(), ilCtrl\redirectByClass(), and ilCtrl\setParameterByClass().

1038  : void
1039  {
1040  $ctrl = $this->ctrl;
1041  $user = $this->user;
1042 
1043  if ($this->ass !== null) {
1044  $state = ilExcAssMemberState::getInstanceByIds($this->ass->getId(), $user->getId());
1045  if (!$state->getCommonDeadline() && $state->getRelativeDeadline()) {
1046  $idl = $state->getIndividualDeadlineObject();
1047  $idl->setStartingTimestamp(time());
1048  $idl->save();
1049  }
1050  }
1051 
1052  $ctrl->setParameterByClass(ilAssignmentPresentationGUI::class, "ass_id", $this->ass->getId());
1053  $ctrl->redirectByClass(ilAssignmentPresentationGUI::class, "");
1054  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
+ Here is the call graph for this function:

◆ updateCustom()

ilObjExerciseGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Definition at line 510 of file class.ilObjExerciseGUI.php.

References ilObjectGUI\$user, ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilPropertyFormGUI\getInput(), ilObjectGUI\getObjectService(), ILIAS\Repository\object(), ilObjectServiceSettingsGUI\ORGU_POSITION_ACCESS, ilObjExercise\PASS_MODE_RANDOM, ilNotification\setNotification(), ilNotification\TYPE_EXERCISE_SUBMISSION, and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

510  : void
511  {
512  $obj_service = $this->getObjectService();
513 
514  $ilUser = $this->user;
515  $this->object->setShowSubmissions($a_form->getInput("show_submissions"));
516  $this->object->setPassMode($a_form->getInput("pass_mode"));
517  if ($this->object->getPassMode() == "nr") {
518  $this->object->setPassNr($a_form->getInput("pass_nr"));
519  }
520  if ($this->object->getPassMode() == ilObjExercise::PASS_MODE_RANDOM) {
521  $this->object->setNrMandatoryRandom($a_form->getInput("nr_random_mand"));
522  }
523 
524  $this->object->setCompletionBySubmission($a_form->getInput('completion_by_submission') == 1);
525 
526  $feedback = $a_form->getInput("tfeedback");
527  $this->object->setTutorFeedback(
528  is_array($feedback)
529  ? array_sum($feedback)
530  : null
531  );
532 
535  $ilUser->getId(),
536  $this->object->getId(),
537  (bool) $a_form->getInput("notification")
538  );
539 
540  // tile image
541  $obj_service->commonSettings()->legacyForm($a_form, $this->object)->saveTileImage();
542 
544  $this->object->getId(),
545  $a_form,
546  array(
549  )
550  );
551  }
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
+ Here is the call graph for this function:

◆ viewObject()

ilObjExerciseGUI::viewObject ( )

Definition at line 269 of file class.ilObjExerciseGUI.php.

References infoScreenObject().

269  : void
270  {
271  $this->infoScreenObject();
272  }
+ Here is the call graph for this function:

Field Documentation

◆ $ass

ilExAssignment ilObjExerciseGUI::$ass = null
protected

Definition at line 42 of file class.ilObjExerciseGUI.php.

Referenced by __construct(), and showOverviewObject().

◆ $ass_manager

Exercise Assignment AssignmentManager ilObjExerciseGUI::$ass_manager
protected

Definition at line 36 of file class.ilObjExerciseGUI.php.

Referenced by showOverviewObject().

◆ $certificateDownloadValidator

ilCertificateDownloadValidator ilObjExerciseGUI::$certificateDownloadValidator
protected

Definition at line 34 of file class.ilObjExerciseGUI.php.

◆ $exercise_request

Exercise GUIRequest ilObjExerciseGUI::$exercise_request
protected

Definition at line 44 of file class.ilObjExerciseGUI.php.

◆ $exercise_ui

Exercise InternalGUIService ilObjExerciseGUI::$exercise_ui
protected

Definition at line 45 of file class.ilObjExerciseGUI.php.

◆ $gui

Exercise InternalGUIService ilObjExerciseGUI::$gui
protected

Definition at line 39 of file class.ilObjExerciseGUI.php.

◆ $help

ilHelpGUI ilObjExerciseGUI::$help
protected

Definition at line 41 of file class.ilObjExerciseGUI.php.

Referenced by addContentSubTabs().

◆ $item_builder

Exercise Assignment ItemBuilderUI ilObjExerciseGUI::$item_builder
private

Definition at line 37 of file class.ilObjExerciseGUI.php.

◆ $lp_user_id

int ilObjExerciseGUI::$lp_user_id
protected

Definition at line 47 of file class.ilObjExerciseGUI.php.

Referenced by __construct().

◆ $notification

Exercise Notification NotificationManager ilObjExerciseGUI::$notification
protected

Definition at line 38 of file class.ilObjExerciseGUI.php.

◆ $requested_ass_id

int ilObjExerciseGUI::$requested_ass_id
protected

Definition at line 46 of file class.ilObjExerciseGUI.php.

◆ $requested_ass_id_goto

int ilObjExerciseGUI::$requested_ass_id_goto
protected

Definition at line 52 of file class.ilObjExerciseGUI.php.

◆ $requested_offset

int ilObjExerciseGUI::$requested_offset
protected

Definition at line 50 of file class.ilObjExerciseGUI.php.

◆ $requested_ref_id

int ilObjExerciseGUI::$requested_ref_id
protected

Definition at line 51 of file class.ilObjExerciseGUI.php.

Referenced by addLocatorItems().

◆ $requested_sort_by

string ilObjExerciseGUI::$requested_sort_by
protected

Definition at line 49 of file class.ilObjExerciseGUI.php.

◆ $requested_sort_order

string ilObjExerciseGUI::$requested_sort_order
protected

Definition at line 48 of file class.ilObjExerciseGUI.php.

◆ $service

InternalService ilObjExerciseGUI::$service
protected

Definition at line 43 of file class.ilObjExerciseGUI.php.

Referenced by getService().

◆ $tabs

ilTabsGUI ilObjExerciseGUI::$tabs
protected

Definition at line 40 of file class.ilObjExerciseGUI.php.

Referenced by __construct(), addContentSubTabs(), and getService().

◆ $ui

ILIAS DI UIServices ilObjExerciseGUI::$ui
protected

Definition at line 35 of file class.ilObjExerciseGUI.php.


The documentation for this class was generated from the following file: