ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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
 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)
 
 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...
 
 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 ()
 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
 
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
 
ilObjectCustomIconFactory $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.

References $ass, ilObjectGUI\$ctrl, $DIC, $GLOBALS, ilObjectGUI\$lng, $lp_user_id, ilObjectGUI\$object, $tabs, ILIAS\GlobalScreen\Provider\__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().

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");
79  $lng->loadLanguageModule("exc");
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  }
loadLanguageModule(string $a_module)
Load language module.
notification()
description: > Example for rendring a notification glyph.
ilLanguage $lng
Validates if an active certificate is stored in the database and can be downloaded by the user...
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
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

◆ addContentSubTabs()

ilObjExerciseGUI::addContentSubTabs ( string  $a_activate)

Definition at line 565 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().

565  : void
566  {
567  $ilTabs = $this->tabs;
568  $lng = $this->lng;
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...
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 853 of file class.ilObjExerciseGUI.php.

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

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  "",
864  );
865  }
866  }
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ afterSave()

ilObjExerciseGUI::afterSave ( ilObject  $a_new_object)
protected

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

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

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  }
+ Here is the call graph for this function:

◆ certificateObject()

ilObjExerciseGUI::certificateObject ( )
Exceptions
ilException

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

References setSettingsSubTabs().

987  : void
988  {
989  $this->setSettingsSubTabs();
990  $this->tabs_gui->activateTab("settings");
991  $this->tabs_gui->activateSubTab("certificate");
992 
993  $guiFactory = new ilCertificateGUIFactory();
994  $output_gui = $guiFactory->create($this->object);
995 
996  $output_gui->certificateEditor();
997  }
+ Here is the call graph for this function:

◆ editObject()

ilObjExerciseGUI::editObject ( )

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

References ILIAS\Repository\ctrl().

821  : void
822  {
823  $this->ctrl->redirectByClass(Settings\SettingsGUI::class, "");
824  }
+ Here is the call graph for this function:

◆ getCurrentMode()

ilObjExerciseGUI::getCurrentMode ( )
protected

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

Referenced by showOverviewObject().

971  : string
972  {
973  return $this->ass_manager->getValidListMode($this->exercise_request->getMode());
974  }
+ Here is the caller graph for this function:

◆ getEditFormCustomValues()

ilObjExerciseGUI::getEditFormCustomValues ( array &  $a_values)
protected

Definition at line 476 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.

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()) {
499  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_MAIL;
500  }
501  if ($this->object->hasTutorFeedbackText()) {
502  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_TEXT;
503  }
504  if ($this->object->hasTutorFeedbackFile()) {
505  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_FILE;
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 hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
getLongDescription()
get object long description (stored in object_description)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
+ Here is the call graph for this function:

◆ getModeLink()

ilObjExerciseGUI::getModeLink ( string  $mode)
protected

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

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

Referenced by showOverviewObject().

976  : string
977  {
978  $this->ctrl->setParameterByClass(self::class, "mode", $mode);
979  $link = $this->ctrl->getLinkTargetByClass(self::class, "showOverview");
980  $this->ctrl->setParameterByClass(self::class, "mode", null);
981  return $link;
982  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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 682 of file class.ilObjExerciseGUI.php.

References ILIAS\Repository\ctrl().

Referenced by viewObject().

682  : void
683  {
684  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
685  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listAssignmentsObject()

◆ outCertificateObject()

ilObjExerciseGUI::outCertificateObject ( )

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

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

999  : void
1000  {
1001  global $DIC;
1002 
1003  $database = $DIC->database();
1004  $logger = $DIC->logger()->root();
1005 
1006  $ilUser = $this->user;
1007 
1008  $objectId = $this->object->getId();
1009 
1010  if (!$this->certificateDownloadValidator->isCertificateDownloadable($ilUser->getId(), $objectId)) {
1011  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
1012  $this->ctrl->redirect($this);
1013  }
1014 
1015  $ilUserCertificateRepository = new ilUserCertificateRepository($database, $logger);
1016  $pdfGenerator = new ilPdfGenerator($ilUserCertificateRepository);
1017 
1018  $pdfAction = new ilCertificatePdfAction(
1019  $pdfGenerator,
1021  $this->lng->txt('error_creating_certificate_pdf')
1022  );
1023 
1024  $pdfAction->downloadPdf($ilUser->getId(), $objectId);
1025  }
global $DIC
Definition: shib_login.php:22
downloadPdf(int $userId, int $objectId)
+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjExerciseGUI::setSettingsSubTabs ( )
protected

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

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

Referenced by __construct(), and certificateObject().

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  }
+ 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.

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(), ILIAS\Repository\lng(), null, ILIAS\Repository\ui(), and ILIAS\Repository\user().

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("list");
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  $l = $f->legacy()->content("<br><br>");
963  $html .= $r->render([$mode, $l, $panel]);
964 
965  $this->tpl->setContent(
966  $html
967  );
968  $this->ctrl->setParameterByClass(self::class, "from_overview", null);
969  }
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
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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:31
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 1030 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(), null, ilCtrl\redirectByClass(), and ilCtrl\setParameterByClass().

1030  : void
1031  {
1032  $ctrl = $this->ctrl;
1033  $user = $this->user;
1034 
1035  if ($this->ass !== null) {
1036  $state = ilExcAssMemberState::getInstanceByIds($this->ass->getId(), $user->getId());
1037  if (!$state->getCommonDeadline() && $state->getRelativeDeadline()) {
1038  $idl = $state->getIndividualDeadlineObject();
1039  $idl->setStartingTimestamp(time());
1040  $idl->save();
1041  }
1042  }
1043 
1044  $ctrl->setParameterByClass(ilAssignmentPresentationGUI::class, "ass_id", $this->ass->getId());
1045  $ctrl->redirectByClass(ilAssignmentPresentationGUI::class, "");
1046  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 522 of file class.ilObjExerciseGUI.php.

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

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 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-...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 281 of file class.ilObjExerciseGUI.php.

References infoScreenObject().

281  : void
282  {
283  $this->infoScreenObject();
284  }
+ 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 __construct(), and 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.

Referenced by addContentSubTabs().

◆ $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.

Referenced by __construct().

◆ $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.

Referenced by addLocatorItems().

◆ $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 __construct(), addContentSubTabs(), and getService().

◆ $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: