ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 addContentSubTabs (string $a_activate)
 
 infoScreenObject ()
 
 editObject ()
 
 showOverviewObject ()
 
 certificateObject ()
 
 outCertificateObject ()
 
 startAssignmentObject ()
 Start assignment with relative deadline. More...
 
- Public Member Functions inherited from ilObjectGUI
 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)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 listAssignmentsObject ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 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...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 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...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 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 ()
 @abstract 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...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

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
 
GlobalHttpState $http
 
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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
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

- 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)
 
- Data Fields inherited from ilObjectGUI
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
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

60 {
61 global $DIC;
62
63 $this->lng = $DIC->language();
64 $this->user = $DIC->user();
65 $this->ctrl = $DIC->ctrl();
66 $this->tabs = $DIC->tabs();
67 $this->help = $DIC["ilHelp"];
68 $this->locator = $DIC["ilLocator"];
69 $this->tpl = $DIC["tpl"];
70 $this->toolbar = $DIC->toolbar();
71 $lng = $DIC->language();
72
73 $this->lng->loadLanguageModule('cert');
74
75 $this->type = "exc";
76 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
77
78 $lng->loadLanguageModule("exercise");
80 $this->ctrl->saveParameter($this, ["ass_id", "mode", "from_overview"]);
81
82 $this->service = $DIC->exercise()->internal();
83 $this->gui = $this->service->gui();
84 $this->exercise_request = $DIC->exercise()->internal()->gui()->request();
85 $this->exercise_ui = $DIC->exercise()->internal()->gui();
86 $this->requested_ass_id = $this->exercise_request->getAssId();
87
88 if ($this->requested_ass_id > 0 && is_object($this->object) && ilExAssignment::lookupExerciseId(
89 $this->requested_ass_id
90 ) === $this->object->getId()) {
91 $this->ass = $this->exercise_request->getAssignment();
92 } elseif ($this->requested_ass_id > 0) {
93 throw new ilExerciseException("Assignment ID does not match Exercise.");
94 }
95 $this->lp_user_id = ($this->exercise_request->getUserId() > 0 && $this->access->checkAccess("read_learning_progress", "", $this->exercise_request->getRefId()))
96 ? $this->exercise_request->getUserId()
97 : $this->user->getId();
98 $this->requested_sort_order = $this->exercise_request->getSortOrder();
99 $this->requested_sort_by = $this->exercise_request->getSortBy();
100 $this->requested_offset = $this->exercise_request->getOffset();
101 $this->requested_ref_id = $this->exercise_request->getRefId();
102 $this->requested_ass_id_goto = $this->exercise_request->getAssIdGoto();
103 $this->ui = $this->service->gui()->ui();
104 $this->certificateDownloadValidator = new ilCertificateDownloadValidator();
105 $this->notification = $this->service->domain()->notification($this->requested_ref_id);
106
107 if ($this->object) {
108 $this->ass_manager = $this->service->domain()->assignment()->assignments(
109 $this->object->getId(),
110 $this->user->getId()
111 );
112 $this->item_builder = $this->service->gui()->assignment()->itemBuilder(
113 $this->object,
114 $this->service->domain()->assignment()->mandatoryAssignments($this->object)
115 );
116 }
117 }
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...
loadLanguageModule(string $a_module)
Load language module.
ilLanguage $lng
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilObjectGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\locator(), ilExAssignment\lookupExerciseId(), ILIAS\UI\examples\Symbol\Glyph\Notification\notification(), ILIAS\Repository\object(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addContentSubTabs()

ilObjExerciseGUI::addContentSubTabs ( string  $a_activate)

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

565 : void
566 {
567 $ilTabs = $this->tabs;
569 $ilCtrl = $this->ctrl;
570
571 $ilTabs->addSubTab(
572 "content",
573 $lng->txt("view"),
574 $ilCtrl->getLinkTarget($this, "showOverview")
575 );
576 if ($this->checkPermissionBool("write")) {
577 $ilTabs->addSubTab(
578 "list_assignments",
579 $lng->txt("edit"),
580 $ilCtrl->getLinkTargetByClass("ilExAssignmentEditorGUI", "listAssignments")
581 );
582 }
583 $ilTabs->activateSubTab($a_activate);
584 }
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...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, $tabs, ilObjectGUI\checkPermissionBool(), and ilLanguage\txt().

Referenced by showOverviewObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjExerciseGUI::addLocatorItems ( )
protected

Add locator item.

Reimplemented from ilObjectGUI.

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

853 : void
854 {
855 $ilLocator = $this->locator;
856
857 if (is_object($this->object)) {
858 // #17955
859 $ilLocator->addItem(
860 $this->object->getTitle(),
861 $this->ctrl->getLinkTarget($this, "showOverview"),
862 "",
863 $this->requested_ref_id
864 );
865 }
866 }
ilLocatorGUI $locator

References ilObjectGUI\$locator, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ afterSave()

ilObjExerciseGUI::afterSave ( ilObject  $new_object)
protected

Post (successful) object creation hook.

Reimplemented from ilObjectGUI.

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

286 : void
287 {
288 $ilCtrl = $this->ctrl;
289
290 $a_new_object->saveData();
291
292 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_added"), true);
293
294 $ilCtrl->setParameterByClass("ilExAssignmentEditorGUI", "ref_id", $a_new_object->getRefId());
295 $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "addAssignment");
296 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc

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

+ Here is the call graph for this function:

◆ certificateObject()

ilObjExerciseGUI::certificateObject ( )
Exceptions
ilException

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

986 : void
987 {
988 $this->setSettingsSubTabs();
989 $this->tabs_gui->activateTab("settings");
990 $this->tabs_gui->activateSubTab("certificate");
991
992 $guiFactory = new ilCertificateGUIFactory();
993 $output_gui = $guiFactory->create($this->object);
994
995 $output_gui->certificateEditor();
996 }

References setSettingsSubTabs().

+ Here is the call graph for this function:

◆ editObject()

ilObjExerciseGUI::editObject ( )

Reimplemented from ilObjectGUI.

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

821 : void
822 {
823 $this->ctrl->redirectByClass(Settings\SettingsGUI::class, "");
824 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getCurrentMode()

ilObjExerciseGUI::getCurrentMode ( )
protected

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

970 : string
971 {
972 return $this->ass_manager->getValidListMode($this->exercise_request->getMode());
973 }

Referenced by showOverviewObject().

+ Here is the caller graph for this function:

◆ getEditFormCustomValues()

ilObjExerciseGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Reimplemented from ilObjectGUI.

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

476 : void
477 {
478 $ilUser = $this->user;
479
480 $a_values["desc"] = $this->object->getLongDescription();
481 $a_values["show_submissions"] = $this->object->getShowSubmissions();
482 $a_values["pass_mode"] = $this->object->getPassMode();
483 if ($a_values["pass_mode"] == "nr") {
484 $a_values["pass_nr"] = $this->object->getPassNr();
485 }
486
487 $a_values["nr_random_mand"] = $this->object->getNrMandatoryRandom();
488
489 $a_values["notification"] = ilNotification::hasNotification(
491 $ilUser->getId(),
492 $this->object->getId()
493 );
494
495 $a_values['completion_by_submission'] = (int) $this->object->isCompletionBySubmissionEnabled();
496
497 $tfeedback = array();
498 if ($this->object->hasTutorFeedbackMail()) {
500 }
501 if ($this->object->hasTutorFeedbackText()) {
503 }
504 if ($this->object->hasTutorFeedbackFile()) {
506 }
507 $a_values['tfeedback'] = $tfeedback;
508
509 // orgunit position setting enabled
510 $a_values['obj_orgunit_positions'] = ilOrgUnitGlobalSettings::getInstance()
511 ->isPositionAccessActiveForObject(
512 $this->object->getId()
513 );
514
515 $a_values['cont_custom_md'] = ilContainer::_lookupContainerSetting(
516 $this->object->getId(),
518 false
519 );
520 }
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)

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.

+ Here is the call graph for this function:

◆ getModeLink()

ilObjExerciseGUI::getModeLink ( string  $mode)
protected

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

975 : string
976 {
977 $this->ctrl->setParameterByClass(self::class, "mode", $mode);
978 $link = $this->ctrl->getLinkTargetByClass(self::class, "showOverview");
979 $this->ctrl->setParameterByClass(self::class, "mode", null);
980 return $link;
981 }

References ILIAS\Repository\ctrl().

Referenced by showOverviewObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getService()

ilObjExerciseGUI::getService ( )
protected

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

688 {
689 return $this->service;
690 }
InternalService $service

References $service.

◆ infoScreenObject()

ilObjExerciseGUI::infoScreenObject ( )
Exceptions
ilObjectException

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

682 : void
683 {
684 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
685 }

References ILIAS\Repository\ctrl().

Referenced by viewObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listAssignmentsObject()

ilObjExerciseGUI::listAssignmentsObject ( )
protected

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

298 : void
299 {
300 $ilCtrl = $this->ctrl;
301
302 $this->checkPermissionBool("write");
303
304 // #16587
305 $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "listAssignments");
306 }

References ilObjectGUI\$ctrl, and ilObjectGUI\checkPermissionBool().

+ Here is the call graph for this function:

◆ outCertificateObject()

ilObjExerciseGUI::outCertificateObject ( )

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

998 : void
999 {
1000 global $DIC;
1001
1002 $database = $DIC->database();
1003 $logger = $DIC->logger()->root();
1004
1005 $ilUser = $this->user;
1006
1007 $objectId = $this->object->getId();
1008
1009 if (!$this->certificateDownloadValidator->isCertificateDownloadable($ilUser->getId(), $objectId)) {
1010 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
1011 $this->ctrl->redirect($this);
1012 }
1013
1014 $ilUserCertificateRepository = new ilUserCertificateRepository($database, $logger);
1015 $pdfGenerator = new ilPdfGenerator($ilUserCertificateRepository);
1016
1017 $pdfAction = new ilCertificatePdfAction(
1018 $pdfGenerator,
1020 $this->lng->txt('error_creating_certificate_pdf')
1021 );
1022
1023 $pdfAction->downloadPdf($ilUser->getId(), $objectId);
1024 }
Just a wrapper class to create Unit Test for other classes.

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

+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjExerciseGUI::setSettingsSubTabs ( )
protected

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

826 : void
827 {
828 $this->tabs_gui->addSubTab(
829 "edit",
830 $this->lng->txt("general_settings"),
831 $this->ctrl->getLinkTarget($this, "edit")
832 );
833
834 $this->tabs_gui->addSubTab(
835 "crit",
836 $this->lng->txt("exc_criteria_catalogues"),
837 $this->ctrl->getLinkTargetByClass("ilexccriteriacataloguegui", "")
838 );
839
840 $validator = new ilCertificateActiveValidator();
841 if ($validator->validate()) {
842 $this->tabs_gui->addSubTab(
843 "certificate",
844 $this->lng->txt("certificate"),
845 $this->ctrl->getLinkTarget($this, "certificate")
846 );
847 }
848 }

References ILIAS\Repository\lng().

Referenced by certificateObject().

+ 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 881 of file class.ilObjExerciseGUI.php.

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

References $ass, $ass_manager, Vendor\Package\$f, ilObjectGUI\$html, ilObjectGUI\$object, $tabs, 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(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ startAssignmentObject()

ilObjExerciseGUI::startAssignmentObject ( )

Start assignment with relative deadline.

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

1029 : void
1030 {
1033
1034 if ($this->ass !== null) {
1035 $state = ilExcAssMemberState::getInstanceByIds($this->ass->getId(), $user->getId());
1036 if (!$state->getCommonDeadline() && $state->getRelativeDeadline()) {
1037 $idl = $state->getIndividualDeadlineObject();
1038 $idl->setStartingTimestamp(time());
1039 $idl->save();
1040 }
1041 }
1042
1043 $ctrl->setParameterByClass(ilAssignmentPresentationGUI::class, "ass_id", $this->ass->getId());
1044 $ctrl->redirectByClass(ilAssignmentPresentationGUI::class, "");
1045 }
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)

References ilObjectGUI\$ctrl, ilObjectGUI\$user, ilObject\getId(), ilExcAssMemberState\getInstanceByIds(), ilCtrl\redirectByClass(), and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ updateCustom()

ilObjExerciseGUI::updateCustom ( ilPropertyFormGUI  $form)
protected

Insert custom update form values into object.

Reimplemented from ilObjectGUI.

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

522 : void
523 {
524 $obj_service = $this->getObjectService();
525
526 $ilUser = $this->user;
527 $this->object->setShowSubmissions($a_form->getInput("show_submissions"));
528 $this->object->setPassMode($a_form->getInput("pass_mode"));
529 if ($this->object->getPassMode() == "nr") {
530 $this->object->setPassNr($a_form->getInput("pass_nr"));
531 }
532 if ($this->object->getPassMode() == ilObjExercise::PASS_MODE_RANDOM) {
533 $this->object->setNrMandatoryRandom($a_form->getInput("nr_random_mand"));
534 }
535
536 $this->object->setCompletionBySubmission($a_form->getInput('completion_by_submission') == 1);
537
538 $feedback = $a_form->getInput("tfeedback");
539 $this->object->setTutorFeedback(
540 is_array($feedback)
541 ? array_sum($feedback)
542 : null
543 );
544
547 $ilUser->getId(),
548 $this->object->getId(),
549 (bool) $a_form->getInput("notification")
550 );
551
552 // tile image
553 $obj_service->commonSettings()->legacyForm($a_form, $this->object)->saveTileImage();
554
556 $this->object->getId(),
557 $a_form,
558 array(
561 )
562 );
563 }
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)

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().

+ Here is the call graph for this function:

◆ viewObject()

ilObjExerciseGUI::viewObject ( )

viewObject container presentation for "administration -> repository, trash, permissions"

Reimplemented from ilObjectGUI.

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

281 : void
282 {
283 $this->infoScreenObject();
284 }

References infoScreenObject().

+ Here is the call graph for this function:

Field Documentation

◆ $ass

ilExAssignment ilObjExerciseGUI::$ass = null
protected

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

Referenced by showOverviewObject().

◆ $ass_manager

Exercise Assignment AssignmentManager ilObjExerciseGUI::$ass_manager
protected

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

Referenced by showOverviewObject().

◆ $certificateDownloadValidator

ilCertificateDownloadValidator ilObjExerciseGUI::$certificateDownloadValidator
protected

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

◆ $exercise_request

Exercise GUIRequest ilObjExerciseGUI::$exercise_request
protected

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

◆ $exercise_ui

Exercise InternalGUIService ilObjExerciseGUI::$exercise_ui
protected

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

◆ $gui

Exercise InternalGUIService ilObjExerciseGUI::$gui
protected

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

◆ $help

ilHelpGUI ilObjExerciseGUI::$help
protected

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

◆ $item_builder

Exercise Assignment ItemBuilderUI ilObjExerciseGUI::$item_builder
private

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

◆ $lp_user_id

int ilObjExerciseGUI::$lp_user_id
protected

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

◆ $notification

Exercise Notification NotificationManager ilObjExerciseGUI::$notification
protected

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

◆ $requested_ass_id

int ilObjExerciseGUI::$requested_ass_id
protected

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

◆ $requested_ass_id_goto

int ilObjExerciseGUI::$requested_ass_id_goto
protected

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

◆ $requested_offset

int ilObjExerciseGUI::$requested_offset
protected

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

◆ $requested_ref_id

int ilObjExerciseGUI::$requested_ref_id
protected

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

◆ $requested_sort_by

string ilObjExerciseGUI::$requested_sort_by
protected

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

◆ $requested_sort_order

string ilObjExerciseGUI::$requested_sort_order
protected

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

◆ $service

InternalService ilObjExerciseGUI::$service
protected

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

Referenced by getService().

◆ $tabs

ilTabsGUI ilObjExerciseGUI::$tabs
protected

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

Referenced by addContentSubTabs(), and showOverviewObject().

◆ $ui

ILIAS DI UIServices ilObjExerciseGUI::$ui
protected

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


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