ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjExerciseGUI Class Reference

Class ilObjExerciseGUI. More...

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

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor public. More...
 
 executeCommand ()
 
 viewObject ()
 
 addContentSubTabs ($a_activate)
 Add subtabs of content view. More...
 
 getTabs ()
 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 ()
 
 addLocatorItems ()
 Add locator item. More...
 
 showOverviewObject ()
 Show overview of assignments. More...
 
 certificateObject ()
 
 outCertificateObject ()
 
- Public Member Functions inherited from ilObjectGUI
 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...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page 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)
 
 listAssignmentsObject ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Init properties form. More...
 
 getEditFormCustomValues (array &$a_values)
 Get values for properties form. More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 setSettingsSubTabs ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 getTabs ()
 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 (ilColumnGUI $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
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

References ilObjectGUI\$lng, ilExAssignment\lookupExerciseId(), and object.

30  {
31  global $lng;
32 
33  $this->type = "exc";
34  parent::__construct($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  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
41  if ($_REQUEST["ass_id"] > 0 && is_object($this->object) && ilExAssignment::lookupExerciseId($_REQUEST["ass_id"]) == $this->object->getId())
42  {
43  $this->ass = new ilExAssignment((int) $_REQUEST["ass_id"]);
44  }
45  else if ($_REQUEST["ass_id"] > 0)
46  {
47  include_once("./Modules/Exercise/exceptions/class.ilExerciseException.php");
48  throw new ilExerciseException("Assignment ID does not match Exercise.");
49  }
50  }
Exercise assignment.
Create new PHPExcel object
obj_idprivate
static lookupExerciseId($a_ass_id)
Lookup excercise id for assignment id.
Class to report exception.
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

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

redirect script

Parameters
string$a_target

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

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

599  {
600  global $lng, $ilAccess;
601 
602  $ass_id = null;
603  $parts = explode("_", $a_raw);
604  if(sizeof($parts) == 2)
605  {
606  $ass_id = (int)$parts[1];
607  }
608 
609  if ($ilAccess->checkAccess("read", "", $a_target))
610  {
611  if($ass_id)
612  {
613  $_GET["ass_id_goto"] = $ass_id;
614  }
615  $_GET["ref_id"] = $a_target;
616  $_GET["cmd"] = "showOverview";
617  $_GET["baseClass"] = "ilExerciseHandlerGUI";
618  include("ilias.php");
619  exit;
620  }
621  else if ($ilAccess->checkAccess("visible", "", $a_target))
622  {
623  $_GET["ref_id"] = $a_target;
624  $_GET["cmd"] = "infoScreen";
625  $_GET["baseClass"] = "ilExerciseHandlerGUI";
626  include("ilias.php");
627  exit;
628  }
629  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
630  {
631  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
634  }
635  }
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ 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 356 of file class.ilObjExerciseGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\checkPermissionBool().

Referenced by executeCommand(), and showOverviewObject().

357  {
358  global $ilTabs, $lng, $ilCtrl;
359 
360  $ilTabs->addSubTab("content", $lng->txt("view"),
361  $ilCtrl->getLinkTarget($this, "showOverview"));
362  if ($this->checkPermissionBool("write"))
363  {
364  $ilTabs->addSubTab("list_assignments", $lng->txt("edit"),
365  $ilCtrl->getLinkTargetByClass("ilExAssignmentEditorGUI", "listAssignments"));
366  }
367  $ilTabs->activateSubTab($a_activate);
368  }
global $ilCtrl
Definition: ilias.php:18
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjExerciseGUI::addLocatorItems ( )

Add locator item.

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

References $_GET, and object.

641  {
642  global $ilLocator;
643 
644  if (is_object($this->object))
645  {
646  // #17955
647  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "showOverview"), "", $_GET["ref_id"]);
648  }
649  }
$_GET["client_id"]
Create new PHPExcel object
obj_idprivate

◆ afterSave()

ilObjExerciseGUI::afterSave ( ilObject  $a_new_object)
protected

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

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

182  {
183  global $ilCtrl;
184 
185  $a_new_object->saveData();
186 
187  ilUtil::sendSuccess($this->lng->txt("exc_added"), true);
188 
189  $ilCtrl->setParameterByClass("ilExAssignmentEditorGUI", "ref_id", $a_new_object->getRefId());
190  $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "addAssignment");
191  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ certificateObject()

ilObjExerciseGUI::certificateObject ( )

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

References setSettingsSubTabs().

722  {
723  $this->setSettingsSubTabs();
724  $this->tabs_gui->activateTab("settings");
725  $this->tabs_gui->activateSubTab("certificate");
726 
727  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
728  include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
729  $output_gui = new ilCertificateGUI(new ilExerciseCertificateAdapter($this->object));
730  $output_gui->certificateEditor();
731  }
GUI class to create PDF certificates.
+ Here is the call graph for this function:

◆ editObject()

ilObjExerciseGUI::editObject ( )

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

References setSettingsSubTabs().

568  {
569  $this->setSettingsSubTabs();
570  $this->tabs_gui->activateSubTab("edit");
571  return parent::editObject();
572  }
+ Here is the call graph for this function:

◆ executeCommand()

ilObjExerciseGUI::executeCommand ( )

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

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

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

◆ getEditFormCustomValues()

ilObjExerciseGUI::getEditFormCustomValues ( array $a_values)
protected

Get values for properties form.

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

References $ilUser, array, ilNotification\hasNotification(), object, ilObjExercise\TUTOR_FEEDBACK_FILE, ilObjExercise\TUTOR_FEEDBACK_MAIL, ilObjExercise\TUTOR_FEEDBACK_TEXT, and ilNotification\TYPE_EXERCISE_SUBMISSION.

294  {
295  global $ilUser;
296 
297  $a_values["desc"] = $this->object->getLongDescription();
298  $a_values["show_submissions"] = $this->object->getShowSubmissions();
299  $a_values["pass_mode"] = $this->object->getPassMode();
300  if ($a_values["pass_mode"] == "nr")
301  {
302  $a_values["pass_nr"] = $this->object->getPassNr();
303  }
304 
305  include_once "./Services/Notification/classes/class.ilNotification.php";
306  $a_values["notification"] = ilNotification::hasNotification(
308  $this->object->getId());
309 
310  $a_values['completion_by_submission'] = (int) $this->object->isCompletionBySubmissionEnabled();
311 
312  $tfeedback = array();
313  if($this->object->hasTutorFeedbackMail())
314  {
315  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_MAIL;
316  }
317  if($this->object->hasTutorFeedbackText())
318  {
319  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_TEXT;
320  }
321  if($this->object->hasTutorFeedbackFile())
322  {
323  $tfeedback[] = ilObjExercise::TUTOR_FEEDBACK_FILE;
324  }
325  $a_values['tfeedback'] = $tfeedback;
326  }
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ getTabs()

ilObjExerciseGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $_GET, ilObjectGUI\$lng, array, ilLearningProgressAccess\checkAccess(), ilObjectGUI\checkPermissionBool(), and object.

376  {
377  global $lng, $ilHelp;
378 
379  $ilHelp->setScreenIdComponent("exc");
380 
381  if ($this->checkPermissionBool("read"))
382  {
383  $this->tabs_gui->addTab("content",
384  $lng->txt("exc_assignments"),
385  $this->ctrl->getLinkTarget($this, "showOverview"));
386  }
387 
388  $next_class = strtolower($this->ctrl->getNextClass());
389  if ($this->checkPermissionBool("visible"))
390  {
391  $this->tabs_gui->addTab("info",
392  $lng->txt("info_short"),
393  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
394  }
395 
396  // edit properties
397  if ($this->checkPermissionBool("write"))
398  {
399  /*$tabs_gui->addTab("assignments",
400  $lng->txt("exc_edit_assignments"),
401  $this->ctrl->getLinkTarget($this, 'listAssignments'));*/
402 
403  $this->tabs_gui->addTab("settings",
404  $lng->txt("settings"),
405  $this->ctrl->getLinkTarget($this, 'edit'));
406 
407  $this->tabs_gui->addTab("grades",
408  $lng->txt("exc_submissions_and_grades"),
409  $this->ctrl->getLinkTargetByClass("ilexercisemanagementgui", "members"));
410  }
411 
412  // learning progress
413  $save_sort_order = $_GET["sort_order"]; // hack, because exercise sort parameters
414  $save_sort_by = $_GET["sort_by"]; // must not be forwarded to learning progress
415  $save_offset = $_GET["offset"];
416  $_GET["offset"] = $_GET["sort_by"] = $_GET["sort_order"] = "";
417 
418  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
419  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
420  {
421  $this->tabs_gui->addTab('learning_progress',
422  $lng->txt('learning_progress'),
423  $this->ctrl->getLinkTargetByClass(array('ilobjexercisegui','illearningprogressgui'),''));
424  }
425 
426  $_GET["sort_order"] = $save_sort_order; // hack, part ii
427  $_GET["sort_by"] = $save_sort_by;
428  $_GET["offset"] = $save_offset;
429 
430  // export
431  if ($this->checkPermissionBool("write"))
432  {
433  $this->tabs_gui->addTab("export",
434  $lng->txt("export"),
435  $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
436  }
437 
438 
439  // permissions
440  if ($this->checkPermissionBool("edit_permission"))
441  {
442  $this->tabs_gui->addTab('permissions',
443  $lng->txt("perm_settings"),
444  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
445  }
446  }
$_GET["client_id"]
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ infoScreen()

ilObjExerciseGUI::infoScreen ( )

show information screen

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

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

Referenced by executeCommand(), and infoScreenObject().

464  {
465  global $ilUser, $ilTabs, $lng;
466 
467  $ilTabs->activateTab("info");
468 
469  $this->checkPermission("visible");
470 
471  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
472  $info = new ilInfoScreenGUI($this);
473 
474  $info->enablePrivateNotes();
475 
476  $info->enableNews();
477  if ($this->checkPermissionBool("write"))
478  {
479  $info->enableNewsEditing();
480  $info->setBlockProperty("news", "settings", true);
481  }
482 
483  // standard meta data
484  //$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
485 
486  // instructions
487  $info->addSection($this->lng->txt("exc_overview"));
488  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
489  $ass = ilExAssignment::getAssignmentDataOfExercise($this->object->getId());
490  $cnt = 0;
491  $mcnt = 0;
492  foreach ($ass as $a)
493  {
494  $cnt++;
495  if ($a["mandatory"])
496  {
497  $mcnt++;
498  }
499  }
500  $info->addProperty($lng->txt("exc_assignments"), $cnt);
501  $info->addProperty($lng->txt("exc_mandatory"), $mcnt);
502  if ($this->object->getPassMode() != "nr")
503  {
504  $info->addProperty($lng->txt("exc_pass_mode"),
505  $lng->txt("exc_msg_all_mandatory_ass"));
506  }
507  else
508  {
509  $info->addProperty($lng->txt("exc_pass_mode"),
510  sprintf($lng->txt("exc_msg_min_number_ass"), $this->object->getPassNr()));
511  }
512 
513  // feedback from tutor
514  include_once("Services/Tracking/classes/class.ilLPMarks.php");
515  if ($this->checkPermissionBool("read"))
516  {
517  $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
518  $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
519  //$status = ilExerciseMembers::_lookupStatus($this->object->getId(), $ilUser->getId());
520  $st = $this->object->determinStatusOfUser($ilUser->getId());
521  $status = $st["overall_status"];
522  if ($lpcomment != "" || $mark != "" || $status != "notgraded")
523  {
524  $info->addSection($this->lng->txt("exc_feedback_from_tutor"));
525  if ($lpcomment != "")
526  {
527  $info->addProperty($this->lng->txt("exc_comment"),
528  $lpcomment);
529  }
530  if ($mark != "")
531  {
532  $info->addProperty($this->lng->txt("exc_mark"),
533  $mark);
534  }
535 
536  //if ($status == "")
537  //{
538  // $info->addProperty($this->lng->txt("status"),
539  // $this->lng->txt("message_no_delivered_files"));
540  //}
541  //else
542  if ($status != "notgraded")
543  {
544  $img = '<img src="'.ilUtil::getImagePath("scorm/".$status.".svg").'" '.
545  ' alt="'.$lng->txt("exc_".$status).'" title="'.$lng->txt("exc_".$status).
546  '" />';
547 
548  $add = "";
549  if ($st["failed_a_mandatory"])
550  {
551  $add = " (".$lng->txt("exc_msg_failed_mandatory").")";
552  }
553  else if ($status == "failed")
554  {
555  $add = " (".$lng->txt("exc_msg_missed_minimum_number").")";
556  }
557  $info->addProperty($this->lng->txt("status"),
558  $img." ".$this->lng->txt("exc_".$status).$add);
559  }
560  }
561  }
562 
563  // forward the command
564  $this->ctrl->forwardCommand($info);
565  }
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
Class ilInfoScreenGUI.
$info
Definition: example_052.php:80
$ilUser
Definition: imgupload.php:18
Create new PHPExcel object
obj_idprivate
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _lookupMark($a_usr_id, $a_obj_id)
static _lookupComment($a_usr_id, $a_obj_id)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ 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 453 of file class.ilObjExerciseGUI.php.

References infoScreen().

Referenced by viewObject().

454  {
455  $this->ctrl->setCmd("showSummary");
456  $this->ctrl->setCmdClass("ilinfoscreengui");
457  $this->infoScreen();
458  }
infoScreen()
show information screen
+ 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.

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

References $section, ilPropertyFormGUI\addItem(), ilExAssignment\countMandatory(), object, ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilNumberInputGUI\setSize(), ilPropertyFormGUI\setTitle(), ilObjExercise\TUTOR_FEEDBACK_FILE, ilObjExercise\TUTOR_FEEDBACK_MAIL, and ilObjExercise\TUTOR_FEEDBACK_TEXT.

207  {
208  $a_form->setTitle($this->lng->txt("exc_edit_exercise"));
209 
211  $section->setTitle($this->lng->txt('exc_passing_exc'));
212  $a_form->addItem($section);
213 
214  // pass mode
215  $radg = new ilRadioGroupInputGUI($this->lng->txt("exc_pass_mode"), "pass_mode");
216 
217  $op1 = new ilRadioOption($this->lng->txt("exc_pass_all"), "all",
218  $this->lng->txt("exc_pass_all_info"));
219  $radg->addOption($op1);
220  $op2 = new ilRadioOption($this->lng->txt("exc_pass_minimum_nr"), "nr",
221  $this->lng->txt("exc_pass_minimum_nr_info"));
222  $radg->addOption($op2);
223 
224  // minimum number of assignments to pass
225  $ni = new ilNumberInputGUI($this->lng->txt("exc_min_nr"), "pass_nr");
226  $ni->setSize(4);
227  $ni->setMaxLength(4);
228  $ni->setRequired(true);
229  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
230  $mand = ilExAssignment::countMandatory($this->object->getId());
231  $min = max($mand, 1);
232  $ni->setMinValue($min, true);
233  $ni->setInfo($this->lng->txt("exc_min_nr_info"));
234  $op2->addSubItem($ni);
235 
236  $a_form->addItem($radg);
237 
238  // completion by submission
239  $subcompl = new ilRadioGroupInputGUI($this->lng->txt("exc_passed_status_determination"), "completion_by_submission");
240  $op1 = new ilRadioOption($this->lng->txt("exc_completion_by_tutor"), 0, "");
241  $subcompl->addOption($op1);
242  $op2 = new ilRadioOption($this->lng->txt("exc_completion_by_submission"), 1,$this->lng->txt("exc_completion_by_submission_info"));
243  $subcompl->addOption($op2);
244  $a_form->addItem($subcompl);
245 
246  /*$subcompl = new ilCheckboxInputGUI($this->lng->txt('exc_completion_by_submission'), 'completion_by_submission');
247  $subcompl->setInfo($this->lng->txt('exc_completion_by_submission_info'));
248  $subcompl->setValue(1);
249  $a_form->addItem($subcompl);*/
250 
252  $section->setTitle($this->lng->txt('exc_publishing'));
253  $a_form->addItem($section);
254 
255  // show submissions
256  $cb = new ilCheckboxInputGUI($this->lng->txt("exc_show_submissions"), "show_submissions");
257  $cb->setInfo($this->lng->txt("exc_show_submissions_info"));
258  $a_form->addItem($cb);
259 
261  $section->setTitle($this->lng->txt('exc_notification'));
262  $a_form->addItem($section);
263 
264  // submission notifications
265  $cbox = new ilCheckboxInputGUI($this->lng->txt("exc_submission_notification"), "notification");
266  $cbox->setInfo($this->lng->txt("exc_submission_notification_info"));
267  $a_form->addItem($cbox);
268 
269 
270  // feedback settings
271 
273  $section->setTitle($this->lng->txt('exc_feedback'));
274  $a_form->addItem($section);
275 
276  $fdb = new ilCheckboxGroupInputGUI($this->lng->txt("exc_settings_feedback"), "tfeedback");
277  $a_form->addItem($fdb);
278 
279  $option = new ilCheckboxOption($this->lng->txt("exc_settings_feedback_mail"), ilObjExercise::TUTOR_FEEDBACK_MAIL);
280  $option->setInfo($this->lng->txt("exc_settings_feedback_mail_info"));
281  $fdb->addOption($option);
282  $option = new ilCheckboxOption($this->lng->txt("exc_settings_feedback_file"), ilObjExercise::TUTOR_FEEDBACK_FILE);
283  $option->setInfo($this->lng->txt("exc_settings_feedback_file_info"));
284  $fdb->addOption($option);
285  $option = new ilCheckboxOption($this->lng->txt("exc_settings_feedback_text"), ilObjExercise::TUTOR_FEEDBACK_TEXT);
286  $option->setInfo($this->lng->txt("exc_settings_feedback_text_info"));
287  $fdb->addOption($option);
288  }
This class represents an option in a radio group.
static countMandatory($a_ex_id)
Order assignments by deadline date.
This class represents an option in a checkbox group.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Info.
setInfo($a_info)
Set Information Text.
$section
Definition: Utf8Test.php:83
This class represents a property in a property form.
setTitle($a_title)
Set Title.
This class represents a number property in a property form.
This class represents a property in a property form.
setSize($a_size)
Set Size.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ listAssignmentsObject()

ilObjExerciseGUI::listAssignmentsObject ( )
protected

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

References $ilCtrl, and ilObjectGUI\checkPermissionBool().

194  {
195  global $ilCtrl;
196 
197  $this->checkPermissionBool("write");
198 
199  // #16587
200  $ilCtrl->redirectByClass("ilExAssignmentEditorGUI", "listAssignments");
201  }
global $ilCtrl
Definition: ilias.php:18
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ outCertificateObject()

ilObjExerciseGUI::outCertificateObject ( )

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

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

734  {
735  global $ilUser;
736 
737  if($this->object->hasUserCertificate($ilUser->getId()))
738  {
739  ilUtil::sendFailure($this->lng->txt("msg_failed"));
740  $this->showOverviewObject();
741  }
742 
743  include_once "./Services/Certificate/classes/class.ilCertificate.php";
744  include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
745  $certificate = new ilCertificate(new ilExerciseCertificateAdapter($this->object));
746  $certificate->outCertificate(array("user_id" => $ilUser->getId()));
747  }
showOverviewObject()
Show overview of assignments.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
Create PDF certificates.
+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjExerciseGUI::setSettingsSubTabs ( )
protected

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

References ilCertificate\isActive().

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

575  {
576  $this->tabs_gui->addSubTab("edit",
577  $this->lng->txt("general_settings"),
578  $this->ctrl->getLinkTarget($this, "edit"));
579 
580  $this->tabs_gui->addSubTab("crit",
581  $this->lng->txt("exc_criteria_catalogues"),
582  $this->ctrl->getLinkTargetByClass("ilexccriteriacataloguegui", ""));
583 
584  include_once "Services/Certificate/classes/class.ilCertificate.php";
586  {
587  $this->tabs_gui->addSubTab("certificate",
588  $this->lng->txt("certificate"),
589  $this->ctrl->getLinkTarget($this, "certificate"));
590  }
591  }
+ 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 659 of file class.ilObjExerciseGUI.php.

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

Referenced by outCertificateObject().

660  {
661  global $tpl, $ilTabs, $ilUser, $ilToolbar;
662 
663  $this->checkPermission("read");
664 
665  include_once("./Services/Tracking/classes/class.ilLearningProgress.php");
666  ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),
667  $this->object->getRefId(), 'exc');
668 
669  $ilTabs->activateTab("content");
670  $this->addContentSubTabs("content");
671 
672  // show certificate?
673  if($this->object->hasUserCertificate($ilUser->getId()))
674  {
675  include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
676  include_once "./Services/Certificate/classes/class.ilCertificate.php";
677  $adapter = new ilExerciseCertificateAdapter($this->object);
679  {
680  $ilToolbar->addButton($this->lng->txt("certificate"),
681  $this->ctrl->getLinkTarget($this, "outCertificate"));
682  }
683  }
684 
685  include_once("./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
686  $ass_gui = new ilExAssignmentGUI($this->object);
687 
688  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
689  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
690  $acc = new ilAccordionGUI();
691  $acc->setId("exc_ow_".$this->object->getId());
692 
693  $ass_data = ilExAssignment::getInstancesByExercise($this->object->getId());
694  foreach ($ass_data as $ass)
695  {
696  // incoming assignment deeplink
697  $force_open = false;
698  if(isset($_GET["ass_id_goto"]) &&
699  (int)$_GET["ass_id_goto"] == $ass->getId())
700  {
701  $force_open = true;
702  }
703 
704  $acc->addItem($ass_gui->getOverviewHeader($ass),
705  $ass_gui->getOverviewBody($ass),
706  $force_open);
707  }
708 
709  if (count($ass_data) < 2)
710  {
711  $acc->setBehaviour("FirstOpen");
712  }
713  else
714  {
715  $acc->setUseSessionStorage(true);
716  }
717 
718  $tpl->setContent($acc->getHTML());
719  }
static _isComplete($adapter)
Checks the status of the certificate.
$_GET["client_id"]
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
addContentSubTabs($a_activate)
Add subtabs of content view.
GUI class for exercise assignments.
static getInstancesByExercise($a_exc_id)
$ilUser
Definition: imgupload.php:18
Create new PHPExcel object
obj_idprivate
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Accordion user interface class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjExerciseGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

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

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

329  {
330  global $ilUser;
331  $this->object->setShowSubmissions($a_form->getInput("show_submissions"));
332  $this->object->setPassMode($a_form->getInput("pass_mode"));
333  if ($this->object->getPassMode() == "nr")
334  {
335  $this->object->setPassNr($a_form->getInput("pass_nr"));
336  }
337 
338  $this->object->setCompletionBySubmission($a_form->getInput('completion_by_submission') == 1 ? true : false);
339 
340  $feedback = $a_form->getInput("tfeedback");
341  $this->object->setTutorFeedback(is_array($feedback)
342  ? array_sum($feedback)
343  : null);
344 
345  include_once "./Services/Notification/classes/class.ilNotification.php";
347  $ilUser->getId(), $this->object->getId(),
348  (bool)$a_form->getInput("notification"));
349  }
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
$ilUser
Definition: imgupload.php:18
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ viewObject()

ilObjExerciseGUI::viewObject ( )

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

References infoScreenObject().

177  {
178  $this->infoScreenObject();
179  }
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
+ Here is the call graph for this function:

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