ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjExerciseVerificationGUI Class Reference

GUI class for exercise verification. More...

+ Inheritance diagram for ilObjExerciseVerificationGUI:
+ Collaboration diagram for ilObjExerciseVerificationGUI:

Public Member Functions

 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 deliver ()
 
 render ( $a_return=false, $a_url=false)
 
 downloadFromPortfolioPage (ilPortfolioPage $a_page)
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. 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)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. 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

 getRequestValue (string $key, $default=null)
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $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...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) 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...
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
- 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)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- 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 ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- 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]
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- 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 = ""
 

Detailed Description

GUI class for exercise verification.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilObjExerciseVerificationGUI: ilWorkspaceAccessGUI

Definition at line 27 of file class.ilObjExerciseVerificationGUI.php.

Member Function Documentation

◆ create()

ilObjExerciseVerificationGUI::create ( )

CRUD.

Reimplemented from ilObject2GUI.

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

34 : void
35 {
36 $ilTabs = $this->tabs_gui;
37
38 $this->lng->loadLanguageModule("excv");
39
40 $ilTabs->setBackTarget(
41 $this->lng->txt("back"),
42 $this->ctrl->getLinkTarget($this, "cancel")
43 );
44
45 $table = new ilExerciseVerificationTableGUI($this, "create");
46 $this->tpl->setContent($table->getHTML());
47 }
List all completed exercises for current user.

References ilObject2GUI\$tabs_gui, and ILIAS\Repository\lng().

Referenced by save().

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

◆ deliver()

ilObjExerciseVerificationGUI::deliver ( )

Definition at line 98 of file class.ilObjExerciseVerificationGUI.php.

98 : void
99 {
100 $file = $this->object->getFilePath();
101 if ($file) {
102 ilFileDelivery::deliverFileLegacy($file, $this->object->getTitle() . ".pdf");
103 }
104 }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)

References ilFileDelivery\deliverFileLegacy(), and ILIAS\Repository\object().

Referenced by render().

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

◆ downloadFromPortfolioPage()

ilObjExerciseVerificationGUI::downloadFromPortfolioPage ( ilPortfolioPage  $a_page)
Exceptions
ilExerciseException

Definition at line 150 of file class.ilObjExerciseVerificationGUI.php.

150 : void
151 {
152 if (ilPCVerification::isInPortfolioPage($a_page, $this->object->getType(), $this->object->getId())) {
153 $this->deliver();
154 }
155
156 throw new ilExerciseException($this->lng->txt('permission_denied'));
157 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isInPortfolioPage(ilPortfolioPage $a_page, string $a_type, int $a_id)

References ilPCVerification\isInPortfolioPage(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getRequestValue()

ilObjExerciseVerificationGUI::getRequestValue ( string  $key,
  $default = null 
)
protected
Parameters
mixed$default
Returns
mixed|null

Definition at line 179 of file class.ilObjExerciseVerificationGUI.php.

180 {
181 if (isset($this->request->getQueryParams()[$key])) {
182 return $this->request->getQueryParams()[$key];
183 }
184
185 if (isset($this->request->getParsedBody()[$key])) {
186 return $this->request->getParsedBody()[$key];
187 }
188
189 return $default ?? null;
190 }

Referenced by save().

+ Here is the caller graph for this function:

◆ getType()

ilObjExerciseVerificationGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 29 of file class.ilObjExerciseVerificationGUI.php.

29 : string
30 {
31 return "excv";
32 }

◆ render()

ilObjExerciseVerificationGUI::render (   $a_return = false,
  $a_url = false 
)

Definition at line 106 of file class.ilObjExerciseVerificationGUI.php.

109 : string {
110 $ilUser = $this->user;
112
113 if (!$a_return) {
114 $this->deliver();
115 } else {
116 $tree = new ilWorkspaceTree($ilUser->getId());
117 $wsp_id = $tree->lookupNodeId($this->object->getId());
118
119 $caption = $lng->txt("wsp_type_excv") . ' "' . $this->object->getTitle() . '"';
120
121 $valid = true;
122 $message = '';
123 if (!file_exists($this->object->getFilePath())) {
124 $valid = false;
125 $message = $lng->txt("url_not_found");
126 } elseif (!$a_url) {
128 if (!$access_handler->checkAccess("read", "", $wsp_id)) {
129 $valid = false;
130 $message = $lng->txt("permission_denied");
131 }
132 }
133
134 if ($valid) {
135 if (!$a_url) {
136 $a_url = $this->getAccessHandler()->getGotoLink($wsp_id, $this->object->getId());
137 }
138 return '<div><a href="' . $a_url . '">' . $caption . '</a></div>';
139 }
140
141 return '<div>' . $caption . ' (' . $message . ')</div>';
142 }
143 return "";
144 }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$valid
$message
Definition: xapiexit.php:31

References deliver().

+ Here is the call graph for this function:

◆ save()

ilObjExerciseVerificationGUI::save ( )
Exceptions
ilException

Reimplemented from ilObject2GUI.

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

52 : void
53 {
54 global $DIC;
55
56 $ilUser = $this->user;
57
58 $objectId = $this->getRequestValue("exc_id");
59 if ($objectId) {
60 $certificateVerificationFileService = new ilCertificateVerificationFileService(
61 $DIC->language(),
62 $DIC->database(),
63 $DIC->logger()->root(),
65 );
66
67 $userCertificateRepository = new ilUserCertificateRepository();
68
69 $userCertificatePresentation = $userCertificateRepository->fetchActiveCertificateForPresentation(
70 $ilUser->getId(),
71 (int) $objectId
72 );
73
74 $newObj = null;
75 try {
76 $newObj = $certificateVerificationFileService->createFile($userCertificatePresentation);
77 } catch (Exception $exception) {
78 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('error_creating_certificate_pdf'));
79 $this->create();
80 return;
81 }
82
83 if ($newObj !== null) {
85 $this->node_id = null;
86 $this->putObjectInTree($newObj, $parent_id);
87
88 $this->afterSave($newObj);
89 } else {
90 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_failed"));
91 }
92 } else {
93 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"));
94 }
95 $this->create();
96 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
afterSave(ilObject $new_object)
Post (successful) object creation hook.
global $DIC
Definition: shib_login.php:26

References $DIC, ilObject2GUI\$node_id, ilObject2GUI\$parent_id, ilObject2GUI\$user, ilObjectGUI\afterSave(), create(), getRequestValue(), ILIAS\Repository\lng(), and ilObject2GUI\putObjectInTree().

+ Here is the call graph for this function:

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