ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjExerciseGUI Class Reference

Class ilObjExerciseGUI. More...

+ Inheritance diagram for ilObjExerciseGUI:
+ Collaboration diagram for ilObjExerciseGUI:

Public Member Functions

 ilObjExerciseGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 viewObject ()
 list childs of current object More...
 
 addContentSubTabs ($a_activate)
 Add subtabs of content view. More...
 
 getTabs ($tabs_gui)
 adds tabs to tab gui object More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreen ()
 show information screen More...
 
 editObject ()
 edit object More...
 
 addLocatorItems ()
 Add locator item. More...
 
 showOverviewObject ()
 Show overview of assignments. More...
 
 certificateObject ()
 
 outCertificateObject ()
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target, $a_raw)
 redirect script More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 listAssignmentsObject ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Init properties form. More...
 
 getEditFormCustomValues (array &$a_values)
 Get values for properties form. More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 setSettingsSubTabs ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ _goto()

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

redirect script

Parameters
string$a_target

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

561 {
562 global $ilErr, $lng, $ilAccess;
563
564 $ass_id = null;
565 $parts = explode("_", $a_raw);
566 if(sizeof($parts) == 2)
567 {
568 $ass_id = (int)$parts[1];
569 }
570
571 if ($ilAccess->checkAccess("read", "", $a_target))
572 {
573 if($ass_id)
574 {
575 $_GET["ass_id_goto"] = $ass_id;
576 }
577 $_GET["ref_id"] = $a_target;
578 $_GET["cmd"] = "showOverview";
579 $_GET["baseClass"] = "ilExerciseHandlerGUI";
580 include("ilias.php");
581 exit;
582 }
583 else if ($ilAccess->checkAccess("visible", "", $a_target))
584 {
585 $_GET["ref_id"] = $a_target;
586 $_GET["cmd"] = "infoScreen";
587 $_GET["baseClass"] = "ilExerciseHandlerGUI";
588 include("ilias.php");
589 exit;
590 }
591 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
592 {
593 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
596 }
597
598 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
599 }
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: login.php:54

References $_GET, $ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ addContentSubTabs()

ilObjExerciseGUI::addContentSubTabs (   $a_activate)

Add subtabs of content view.

Parameters
object$tabs_guiilTabsGUI object

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

319 {
320 global $ilTabs, $lng, $ilCtrl, $ilAccess;
321
322 $ilTabs->addSubTab("content", $lng->txt("view"),
323 $ilCtrl->getLinkTarget($this, "showOverview"));
324 if ($ilAccess->checkAccess("write", "", $this->ref_id))
325 {
326 $ilTabs->addSubTab("list_assignments", $lng->txt("edit"),
327 $ilCtrl->getLinkTargetByClass("ilExAssignmentEditorGUI", "listAssignments"));
328 }
329 $ilTabs->activateSubTab($a_activate);
330 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, and ilObjectGUI\$lng.

Referenced by executeCommand(), and showOverviewObject().

+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjExerciseGUI::addLocatorItems ( )

Add locator item.

Reimplemented from ilObjectGUI.

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

605 {
606 global $ilLocator;
607
608 if (is_object($this->object))
609 {
610 // #17955
611 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "showOverview"), "", $_GET["ref_id"]);
612 }
613 }

References $_GET.

◆ afterSave()

ilObjExerciseGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

184 {
185 global $ilCtrl;
186
187 $a_new_object->saveData();
188
189 ilUtil::sendSuccess($this->lng->txt("exc_added"), true);
190
191 $ilCtrl->setParameterByClass("ilExAssignmentEditorGUI", "ref_id", $a_new_object->getRefId());
192 $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "addAssignment");
193 }
getRefId()
get reference id @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $ilCtrl, ilObject\getRefId(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ certificateObject()

ilObjExerciseGUI::certificateObject ( )

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

686 {
687 $this->setSettingsSubTabs();
688 $this->tabs_gui->activateTab("settings");
689 $this->tabs_gui->activateSubTab("certificate");
690
691 include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
692 include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
693 $output_gui = new ilCertificateGUI(new ilExerciseCertificateAdapter($this->object));
694 $output_gui->certificateEditor();
695 }
GUI class to create PDF certificates.

References setSettingsSubTabs().

+ Here is the call graph for this function:

◆ editObject()

ilObjExerciseGUI::editObject ( )

edit object

@access public

Reimplemented from ilObjectGUI.

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

530 {
531 $this->setSettingsSubTabs();
532 $this->tabs_gui->activateSubTab("edit");
533 return parent::editObject();
534 }

References setSettingsSubTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjExerciseGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

48 {
49 global $ilUser,$ilCtrl, $ilTabs, $lng;
50
51 $next_class = $this->ctrl->getNextClass($this);
52 $cmd = $this->ctrl->getCmd();
53 $this->prepareOutput();
54
55//echo "-".$next_class."-".$cmd."-"; exit;
56 switch($next_class)
57 {
58 case "ilinfoscreengui":
59 $ilTabs->activateTab("info");
60 $this->infoScreen(); // forwards command
61 break;
62
63 case 'ilpermissiongui':
64 $ilTabs->activateTab("permissions");
65 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
66 $perm_gui =& new ilPermissionGUI($this);
67 $ret =& $this->ctrl->forwardCommand($perm_gui);
68 break;
69
70 case "illearningprogressgui":
71 $ilTabs->activateTab("learning_progress");
72 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
73
75 $this->object->getRefId(),
76 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
77 $this->ctrl->forwardCommand($new_gui);
78 $this->tabs_gui->setTabActive('learning_progress');
79 break;
80
81 case 'ilobjectcopygui':
82 $ilCtrl->saveParameter($this, 'new_type');
83 $ilCtrl->setReturnByClass(get_class($this),'create');
84
85 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
86 $cp = new ilObjectCopyGUI($this);
87 $cp->setType('exc');
88 $this->ctrl->forwardCommand($cp);
89 break;
90
91 case "ilexportgui":
92 $ilTabs->activateTab("export");
93 include_once("./Services/Export/classes/class.ilExportGUI.php");
94 $exp_gui = new ilExportGUI($this);
95 $exp_gui->addFormat("xml");
96 $ret = $this->ctrl->forwardCommand($exp_gui);
97// $this->tpl->show();
98 break;
99
100 case 'ilshoppurchasegui':
101 include_once './Services/Payment/classes/class.ilShopPurchaseGUI.php';
102 $sp = new ilShopPurchaseGUI($_GET['ref_id']);
103
104 $this->ctrl->forwardCommand($sp);
105 break;
106
107 case "ilcommonactiondispatchergui":
108 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
110 $this->ctrl->forwardCommand($gui);
111 break;
112
113 case "ilcertificategui":
114 $this->setSettingsSubTabs();
115 $this->tabs_gui->activateTab("settings");
116 $this->tabs_gui->activateSubTab("certificate");
117 include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
118 include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
119 $output_gui = new ilCertificateGUI(new ilExerciseCertificateAdapter($this->object));
120 $this->ctrl->forwardCommand($output_gui);
121 break;
122
123 case "ilexassignmenteditorgui":
124 $this->checkPermission("write");
125 $ilTabs->activateTab("content");
126 $this->addContentSubTabs("list_assignments");
127 include_once("./Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php");
128 $ass_gui = new ilExAssignmentEditorGUI($this->object->getId(), $this->object->isCompletionBySubmissionEnabled(), $this->ass);
129 $this->ctrl->forwardCommand($ass_gui);
130 break;
131
132 case "ilexsubmissiongui":
133 $this->checkPermission("read");
134 $ilTabs->activateTab("content");
135 $this->addContentSubTabs("content");
136 $this->ctrl->setReturn($this, "showOverview");
137 include_once("./Modules/Exercise/classes/class.ilExSubmissionGUI.php");
138 $sub_gui = new ilExSubmissionGUI($this->object, $this->ass, (int)$_REQUEST["member_id"]);
139 $this->ctrl->forwardCommand($sub_gui);
140 break;
141
142 case "ilexercisemanagementgui":
143 $this->checkPermission("write");
144 $ilTabs->activateTab("grades");
145 include_once("./Modules/Exercise/classes/class.ilExerciseManagementGUI.php");
146 $mgmt_gui = new ilExerciseManagementGUI($this->object, $this->ass);
147 $this->ctrl->forwardCommand($mgmt_gui);
148 break;
149
150 case "ilexccriteriacataloguegui":
151 $this->checkPermission("write");
152 $ilTabs->activateTab("settings");
153 $this->setSettingsSubTabs();
154 $ilTabs->activateSubTab("crit");
155 include_once("./Modules/Exercise/classes/class.ilExcCriteriaCatalogueGUI.php");
156 $crit_gui = new ilExcCriteriaCatalogueGUI($this->object);
157 $this->ctrl->forwardCommand($crit_gui);
158 break;
159
160 default:
161 if(!$cmd)
162 {
163 $cmd = "infoScreen";
164 }
165
166 $cmd .= "Object";
167
168 $this->$cmd();
169
170 break;
171 }
172
173 $this->addHeaderAction();
174
175 return true;
176 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilExAssignmentEditorGUI.
Class ilExSubmissionGUI.
Class ilExcCriteriaCatalogueGUI.
Class ilExerciseManagementGUI.
Export User Interface Class.
Class ilObjUserTrackingGUI.
infoScreen()
show information screen
addContentSubTabs($a_activate)
Add subtabs of content view.
GUI class for the workflow of copying objects.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
prepareOutput()
prepare output
addHeaderAction()
Add header action menu.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Class ilShopPurchaseGUI.
$cmd
Definition: sahs_server.php:35
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
global $ilUser
Definition: imgupload.php:15

References $_GET, $_REQUEST, $cmd, $ilCtrl, $ilUser, ilObjectGUI\$lng, $ret, addContentSubTabs(), ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilObjectGUI\prepareOutput(), and setSettingsSubTabs().

+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjExerciseGUI::getEditFormCustomValues ( array &  $a_values)
protected

Get values for properties form.

Reimplemented from ilObjectGUI.

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

276 {
277 global $ilUser;
278
279 $a_values["desc"] = $this->object->getLongDescription();
280 $a_values["show_submissions"] = $this->object->getShowSubmissions();
281 $a_values["pass_mode"] = $this->object->getPassMode();
282 if ($a_values["pass_mode"] == "nr")
283 {
284 $a_values["pass_nr"] = $this->object->getPassNr();
285 }
286
287 include_once "./Services/Notification/classes/class.ilNotification.php";
288 $a_values["notification"] = ilNotification::hasNotification(
290 $this->object->getId());
291
292 $a_values['completion_by_submission'] = (int) $this->object->isCompletionBySubmissionEnabled();
293 }
static hasNotification($type, $user_id, $id)
Check notification status for object and user.

References $ilUser, ilNotification\hasNotification(), and ilNotification\TYPE_EXERCISE_SUBMISSION.

+ Here is the call graph for this function:

◆ getTabs()

ilObjExerciseGUI::getTabs (   $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

338 {
339 global $ilAccess, $ilUser, $lng, $ilHelp;
340
341 $ilHelp->setScreenIdComponent("exc");
342
343 if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
344 {
345 $tabs_gui->addTab("content",
346 $lng->txt("exc_assignments"),
347 $this->ctrl->getLinkTarget($this, "showOverview"));
348 }
349
350 $next_class = strtolower($this->ctrl->getNextClass());
351 if ($ilAccess->checkAccess("visible", "", $this->object->getRefId()))
352 {
353 $tabs_gui->addTab("info",
354 $lng->txt("info_short"),
355 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
356 }
357
358 // edit properties
359 if ($ilAccess->checkAccess("write", "", $this->ref_id))
360 {
361 /*$tabs_gui->addTab("assignments",
362 $lng->txt("exc_edit_assignments"),
363 $this->ctrl->getLinkTarget($this, 'listAssignments'));*/
364
365 $tabs_gui->addTab("settings",
366 $lng->txt("settings"),
367 $this->ctrl->getLinkTarget($this, 'edit'));
368
369 $tabs_gui->addTab("grades",
370 $lng->txt("exc_submissions_and_grades"),
371 $this->ctrl->getLinkTargetByClass("ilexercisemanagementgui", "members"));
372 }
373
374 // learning progress
375 $save_sort_order = $_GET["sort_order"]; // hack, because exercise sort parameters
376 $save_sort_by = $_GET["sort_by"]; // must not be forwarded to learning progress
377 $save_offset = $_GET["offset"];
378 $_GET["offset"] = $_GET["sort_by"] = $_GET["sort_order"] = "";
379
380 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
381 if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
382 {
383 $tabs_gui->addTab('learning_progress',
384 $lng->txt('learning_progress'),
385 $this->ctrl->getLinkTargetByClass(array('ilobjexercisegui','illearningprogressgui'),''));
386 }
387
388 $_GET["sort_order"] = $save_sort_order; // hack, part ii
389 $_GET["sort_by"] = $save_sort_by;
390 $_GET["offset"] = $save_offset;
391
392 // export
393 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
394 {
395 $tabs_gui->addTab("export",
396 $lng->txt("export"),
397 $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
398 }
399
400
401 // permissions
402 if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id))
403 {
404 $tabs_gui->addTab('permissions',
405 $lng->txt("perm_settings"),
406 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
407 }
408 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress

References $_GET, $ilUser, ilObjectGUI\$lng, and ilLearningProgressAccess\checkAccess().

+ Here is the call graph for this function:

◆ ilObjExerciseGUI()

ilObjExerciseGUI::ilObjExerciseGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor @access public.

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

30 {
31 global $lng;
32
33 $this->type = "exc";
34 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
35
36 $lng->loadLanguageModule("exercise");
37 $lng->loadLanguageModule("exc");
38 $this->ctrl->saveParameter($this, "ass_id");
39
40 if ($_REQUEST["ass_id"] > 0)
41 {
42 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
43 $this->ass = new ilExAssignment((int) $_REQUEST["ass_id"]);
44 }
45 }
Exercise assignment.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

References $_REQUEST, ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

+ Here is the call graph for this function:

◆ infoScreen()

ilObjExerciseGUI::infoScreen ( )

show information screen

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

426 {
427 global $ilAccess, $ilUser, $ilTabs, $lng;
428
429 $ilTabs->activateTab("info");
430
431 $this->checkPermission("visible");
432
433 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
434 $info = new ilInfoScreenGUI($this);
435
436 $info->enablePrivateNotes();
437
438 $info->enableNews();
439 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
440 {
441 $info->enableNewsEditing();
442 $info->setBlockProperty("news", "settings", true);
443 }
444
445 // standard meta data
446 //$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
447
448 // instructions
449 $info->addSection($this->lng->txt("exc_overview"));
450 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
451 $ass = ilExAssignment::getAssignmentDataOfExercise($this->object->getId());
452 $cnt = 0;
453 $mcnt = 0;
454 foreach ($ass as $a)
455 {
456 $cnt++;
457 if ($a["mandatory"])
458 {
459 $mcnt++;
460 }
461 }
462 $info->addProperty($lng->txt("exc_assignments"), $cnt);
463 $info->addProperty($lng->txt("exc_mandatory"), $mcnt);
464 if ($this->object->getPassMode() != "nr")
465 {
466 $info->addProperty($lng->txt("exc_pass_mode"),
467 $lng->txt("exc_msg_all_mandatory_ass"));
468 }
469 else
470 {
471 $info->addProperty($lng->txt("exc_pass_mode"),
472 sprintf($lng->txt("exc_msg_min_number_ass"), $this->object->getPassNr()));
473 }
474
475 // feedback from tutor
476 include_once("Services/Tracking/classes/class.ilLPMarks.php");
477 if ($ilAccess->checkAccess("read", "", $this->ref_id))
478 {
479 $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
480 $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
481 //$status = ilExerciseMembers::_lookupStatus($this->object->getId(), $ilUser->getId());
482 $st = $this->object->determinStatusOfUser($ilUser->getId());
483 $status = $st["overall_status"];
484 if ($lpcomment != "" || $mark != "" || $status != "notgraded")
485 {
486 $info->addSection($this->lng->txt("exc_feedback_from_tutor"));
487 if ($lpcomment != "")
488 {
489 $info->addProperty($this->lng->txt("exc_comment"),
490 $lpcomment);
491 }
492 if ($mark != "")
493 {
494 $info->addProperty($this->lng->txt("exc_mark"),
495 $mark);
496 }
497
498 //if ($status == "")
499 //{
500 // $info->addProperty($this->lng->txt("status"),
501 // $this->lng->txt("message_no_delivered_files"));
502 //}
503 //else
504 if ($status != "notgraded")
505 {
506 $img = '<img src="'.ilUtil::getImagePath("scorm/".$status.".svg").'" '.
507 ' alt="'.$lng->txt("exc_".$status).'" title="'.$lng->txt("exc_".$status).
508 '" />';
509
510 $add = "";
511 if ($st["failed_a_mandatory"])
512 {
513 $add = " (".$lng->txt("exc_msg_failed_mandatory").")";
514 }
515 else if ($status == "failed")
516 {
517 $add = " (".$lng->txt("exc_msg_missed_minimum_number").")";
518 }
519 $info->addProperty($this->lng->txt("status"),
520 $img." ".$this->lng->txt("exc_".$status).$add);
521 }
522 }
523 }
524
525 // forward the command
526 $this->ctrl->forwardCommand($info);
527 }
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
Class ilInfoScreenGUI.
_lookupComment($a_usr_id, $a_obj_id)
_lookupMark($a_usr_id, $a_obj_id)
$info
Definition: example_052.php:80

References $_GET, $ilUser, $img, $info, ilObjectGUI\$lng, ilLPMarks\_lookupComment(), ilLPMarks\_lookupMark(), ilObjectGUI\checkPermission(), and ilExAssignment\getAssignmentDataOfExercise().

Referenced by executeCommand(), and infoScreenObject().

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

◆ infoScreenObject()

ilObjExerciseGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

416 {
417 $this->ctrl->setCmd("showSummary");
418 $this->ctrl->setCmdClass("ilinfoscreengui");
419 $this->infoScreen();
420 }

References infoScreen().

Referenced by viewObject().

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

◆ initEditCustomForm()

ilObjExerciseGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Init properties form.

Reimplemented from ilObjectGUI.

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

209 {
210 $a_form->setTitle($this->lng->txt("exc_edit_exercise"));
211
213 $section->setTitle($this->lng->txt('exc_passing_exc'));
214 $a_form->addItem($section);
215
216 // pass mode
217 $radg = new ilRadioGroupInputGUI($this->lng->txt("exc_pass_mode"), "pass_mode");
218
219 $op1 = new ilRadioOption($this->lng->txt("exc_pass_all"), "all",
220 $this->lng->txt("exc_pass_all_info"));
221 $radg->addOption($op1);
222 $op2 = new ilRadioOption($this->lng->txt("exc_pass_minimum_nr"), "nr",
223 $this->lng->txt("exc_pass_minimum_nr_info"));
224 $radg->addOption($op2);
225
226 // minimum number of assignments to pass
227 $ni = new ilNumberInputGUI($this->lng->txt("exc_min_nr"), "pass_nr");
228 $ni->setSize(4);
229 $ni->setMaxLength(4);
230 $ni->setRequired(true);
231 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
232 $mand = ilExAssignment::countMandatory($this->object->getId());
233 $min = max($mand, 1);
234 $ni->setMinValue($min, true);
235 $ni->setInfo($this->lng->txt("exc_min_nr_info"));
236 $op2->addSubItem($ni);
237
238 $a_form->addItem($radg);
239
240 // completion by submission
241 $subcompl = new ilRadioGroupInputGUI($this->lng->txt("exc_passed_status_determination"), "completion_by_submission");
242 $op1 = new ilRadioOption($this->lng->txt("exc_completion_by_tutor"), 0, "");
243 $subcompl->addOption($op1);
244 $op2 = new ilRadioOption($this->lng->txt("exc_completion_by_submission"), 1,$this->lng->txt("exc_completion_by_submission_info"));
245 $subcompl->addOption($op2);
246 $a_form->addItem($subcompl);
247
248 /*$subcompl = new ilCheckboxInputGUI($this->lng->txt('exc_completion_by_submission'), 'completion_by_submission');
249 $subcompl->setInfo($this->lng->txt('exc_completion_by_submission_info'));
250 $subcompl->setValue(1);
251 $a_form->addItem($subcompl);*/
252
254 $section->setTitle($this->lng->txt('exc_publishing'));
255 $a_form->addItem($section);
256
257 // show submissions
258 $cb = new ilCheckboxInputGUI($this->lng->txt("exc_show_submissions"), "show_submissions");
259 $cb->setInfo($this->lng->txt("exc_show_submissions_info"));
260 $a_form->addItem($cb);
261
263 $section->setTitle($this->lng->txt('exc_notification'));
264 $a_form->addItem($section);
265
266 // submission notifications
267 $cbox = new ilCheckboxInputGUI($this->lng->txt("exc_submission_notification"), "notification");
268 $cbox->setInfo($this->lng->txt("exc_submission_notification_info"));
269 $a_form->addItem($cbox);
270 }
$section
Definition: Utf8Test.php:84
This class represents a checkbox property in a property form.
countMandatory($a_ex_id)
Order assignments by deadline date.
This class represents a section header in a property form.
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setTitle($a_title)
Set Title.
This class represents a property in a property form.
This class represents an option in a radio group.

References $section, ilPropertyFormGUI\addItem(), ilExAssignment\countMandatory(), and ilPropertyFormGUI\setTitle().

+ Here is the call graph for this function:

◆ listAssignmentsObject()

ilObjExerciseGUI::listAssignmentsObject ( )
protected

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

196 {
197 global $ilCtrl;
198
199 $this->checkPermissionBool("write");
200
201 // #16587
202 $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "listAssignments");
203 }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.

References $ilCtrl, and ilObjectGUI\checkPermissionBool().

+ Here is the call graph for this function:

◆ outCertificateObject()

ilObjExerciseGUI::outCertificateObject ( )

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

698 {
699 global $ilUser;
700
701 if($this->object->hasUserCertificate($ilUser->getId()))
702 {
703 ilUtil::sendFailure($this->lng->txt("msg_failed"));
704 $this->showOverviewObject();
705 }
706
707 include_once "./Services/Certificate/classes/class.ilCertificate.php";
708 include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
710 $certificate->outCertificate(array("user_id" => $ilUser->getId()));
711 }
Create PDF certificates.
showOverviewObject()
Show overview of assignments.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77

References $certificate, $ilUser, ilUtil\sendFailure(), and showOverviewObject().

+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjExerciseGUI::setSettingsSubTabs ( )
protected

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

537 {
538 $this->tabs_gui->addSubTab("edit",
539 $this->lng->txt("general_settings"),
540 $this->ctrl->getLinkTarget($this, "edit"));
541
542 $this->tabs_gui->addSubTab("crit",
543 $this->lng->txt("exc_criteria_catalogues"),
544 $this->ctrl->getLinkTargetByClass("ilexccriteriacataloguegui", ""));
545
546 include_once "Services/Certificate/classes/class.ilCertificate.php";
548 {
549 $this->tabs_gui->addSubTab("certificate",
550 $this->lng->txt("certificate"),
551 $this->ctrl->getLinkTarget($this, "certificate"));
552 }
553 }

References ilCertificate\isActive().

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

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

◆ showOverviewObject()

ilObjExerciseGUI::showOverviewObject ( )

Show overview of assignments.

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

624 {
625 global $tpl, $ilTabs, $ilUser, $ilToolbar;
626
627 $this->checkPermission("read");
628
629 include_once("./Services/Tracking/classes/class.ilLearningProgress.php");
630 ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),
631 $this->object->getRefId(), 'exc');
632
633 $ilTabs->activateTab("content");
634 $this->addContentSubTabs("content");
635
636 // show certificate?
637 if($this->object->hasUserCertificate($ilUser->getId()))
638 {
639 include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
640 include_once "./Services/Certificate/classes/class.ilCertificate.php";
641 $adapter = new ilExerciseCertificateAdapter($this->object);
642 if(ilCertificate::_isComplete($adapter))
643 {
644 $ilToolbar->addButton($this->lng->txt("certificate"),
645 $this->ctrl->getLinkTarget($this, "outCertificate"));
646 }
647 }
648
649 include_once("./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
650 $ass_gui = new ilExAssignmentGUI($this->object);
651
652 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
653 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
654 $acc = new ilAccordionGUI();
655 $acc->setId("exc_ow_".$this->object->getId());
656
657 $ass_data = ilExAssignment::getInstancesByExercise($this->object->getId());
658 foreach ($ass_data as $ass)
659 {
660 // incoming assignment deeplink
661 $force_open = false;
662 if(isset($_GET["ass_id_goto"]) &&
663 (int)$_GET["ass_id_goto"] == $ass->getId())
664 {
665 $force_open = true;
666 }
667
668 $acc->addItem($ass_gui->getOverviewHeader($ass),
669 $ass_gui->getOverviewBody($ass),
670 $force_open);
671 }
672
673 if (count($ass_data) < 2)
674 {
675 $acc->setBehaviour("FirstOpen");
676 }
677 else
678 {
679 $acc->setUseSessionStorage(true);
680 }
681
682 $tpl->setContent($acc->getHTML());
683 }
Accordion user interface class.
_isComplete($adapter)
Checks the status of the certificate.
GUI class for exercise assignments.
static getInstancesByExercise($a_exc_id)
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')

References $_GET, $ilUser, ilObjectGUI\$tpl, ilCertificate\_isComplete(), ilLearningProgress\_tracProgress(), addContentSubTabs(), ilObjectGUI\checkPermission(), and ilExAssignment\getInstancesByExercise().

Referenced by outCertificateObject().

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

◆ updateCustom()

ilObjExerciseGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

296 {
297 global $ilUser;
298 $this->object->setShowSubmissions($a_form->getInput("show_submissions"));
299 $this->object->setPassMode($a_form->getInput("pass_mode"));
300 if ($this->object->getPassMode() == "nr")
301 {
302 $this->object->setPassNr($a_form->getInput("pass_nr"));
303 }
304
305 $this->object->setCompletionBySubmission($a_form->getInput('completion_by_submission') == 1 ? true : false);
306
307 include_once "./Services/Notification/classes/class.ilNotification.php";
309 $ilUser->getId(), $this->object->getId(),
310 (bool)$a_form->getInput("notification"));
311 }
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

References $ilUser, ilPropertyFormGUI\getInput(), ilNotification\setNotification(), and ilNotification\TYPE_EXERCISE_SUBMISSION.

+ Here is the call graph for this function:

◆ viewObject()

ilObjExerciseGUI::viewObject ( )

list childs of current object

@access public

Reimplemented from ilObjectGUI.

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

179 {
180 $this->infoScreenObject();
181 }
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...

References infoScreenObject().

+ Here is the call graph for this function:

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