ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjAssessmentFolderGUI Class Reference

Class ilObjAssessmentFolderGUI. More...

+ Inheritance diagram for ilObjAssessmentFolderGUI:
+ Collaboration diagram for ilObjAssessmentFolderGUI:

Public Member Functions

 __construct ($a_data, int $a_id=0, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 executeCommand ()
 
 settingsObject (ilPropertyFormGUI $form=null)
 
 saveSettingsObject ()
 Save Assessment settings. More...
 
 showLogObject ()
 Called when the a log should be shown. More...
 
 exportLogObject ()
 Called when the a log should be exported. More...
 
 logsObject (ilPropertyFormGUI $form=null)
 
 deleteLogObject ()
 Deletes the log entries for one or more tests. More...
 
 logAdminObject ()
 Administration output for assessment log files. More...
 
 getAdminTabs ()
 
 getLogdataSubtabs ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 getLogDataOutputForm ()
 
 getTabs ()
 
 showLogSettingsObject (ilPropertyFormGUI $form=null)
 
 saveLogSettingsObject ()
 
 getLogSettingsForm ()
 
- 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 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...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Protected Attributes

ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ILIAS Test InternalRequestService $testrequest
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 getAssessmentFolder ()
 
 buildSettingsForm ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjAssessmentFolderGUI::__construct (   $a_data,
int  $a_id = 0,
bool  $a_call_by_reference = true,
bool  $a_prepare_output = true 
)

Definition at line 31 of file class.ilObjAssessmentFolderGUI.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), and ILIAS\Repository\lng().

32  {
33  global $DIC;
34  $rbacsystem = $DIC['rbacsystem'];
35  $this->testrequest = $DIC->test()->internal()->request();
36  $this->questioninfo = $DIC->testQuestionPool()->questionInfo();
37  $this->type = "assf";
38  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
39 
40  if (!$rbacsystem->checkAccess('read', $this->object->getRefId())) {
41  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read_assf"), $this->ilias->error_obj->WARNING);
42  }
43 
44  $this->lng->loadLanguageModule('assessment');
45  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
header include for all ilias files.
+ Here is the call graph for this function:

Member Function Documentation

◆ buildSettingsForm()

ilObjAssessmentFolderGUI::buildSettingsForm ( )
private

Definition at line 100 of file class.ilObjAssessmentFolderGUI.php.

References ilObjAssessmentFolder\_getForbiddenQuestionTypes(), ilObjAssessmentFolder\_getManualScoring(), ilObjQuestionPool\_getQuestionTypes(), ILIAS\Repository\access(), ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_DB, ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_FILE, ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, ILIAS\Repository\ctrl(), getAssessmentFolder(), ILIAS\Repository\lng(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilColorPickerInputGUI\setValue().

Referenced by saveSettingsObject(), and settingsObject().

101  {
102  $form = new ilPropertyFormGUI();
103  $form->setFormAction($this->ctrl->getFormAction($this));
104  $form->setTableWidth("100%");
105  $form->setId("settings");
106 
107  $header = new ilFormSectionHeaderGUI();
108  $header->setTitle($this->lng->txt('settings'));
109  $form->addItem($header);
110 
111  // question process locking behaviour (e.g. on saving users working data)
112  $chb = new ilCheckboxInputGUI($this->lng->txt('ass_process_lock'), 'ass_process_lock');
113  $chb->setChecked($this->getAssessmentFolder()->getAssessmentProcessLockMode() !== ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
114  $chb->setInfo($this->lng->txt('ass_process_lock_desc'));
115  $form->addItem($chb);
116  $rg = new ilRadioGroupInputGUI($this->lng->txt('ass_process_lock_mode'), 'ass_process_lock_mode');
117  $rg->setRequired(true);
118  $opt = new ilRadioOption(
119  $this->lng->txt('ass_process_lock_mode_file'),
121  );
122  $opt->setInfo($this->lng->txt('ass_process_lock_mode_file_desc'));
123  $rg->addOption($opt);
124  $opt = new ilRadioOption(
125  $this->lng->txt('ass_process_lock_mode_db'),
127  );
128  $opt->setInfo($this->lng->txt('ass_process_lock_mode_db_desc'));
129  $rg->addOption($opt);
130  if ($this->getAssessmentFolder()->getAssessmentProcessLockMode() !== ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE) {
131  $rg->setValue($this->getAssessmentFolder()->getAssessmentProcessLockMode());
132  }
133  $chb->addSubItem($rg);
134 
135  $assessmentSetting = new ilSetting('assessment');
136  $imap_line_color = $assessmentSetting->get('imap_line_color');
137  if ($this->testrequest->isset('imap_line_color')) {
138  $imap_line_color = $this->testrequest->strVal('imap_line_color');
139  }
140  if ($imap_line_color == '') {
141  $imap_line_color = 'FF0000';
142  }
143 
144  $linepicker = new ilColorPickerInputGUI($this->lng->txt('assessment_imap_line_color'), 'imap_line_color');
145  $linepicker->setValue($imap_line_color);
146  $form->addItem($linepicker);
147 
148  $user_criteria = $assessmentSetting->get('user_criteria');
149  if ($this->testrequest->isset('user_criteria')) {
150  $user_criteria = $this->testrequest->strVal('user_criteria');
151  }
152  $userCriteria = new ilSelectInputGUI($this->lng->txt('user_criteria'), 'user_criteria');
153  $userCriteria->setInfo($this->lng->txt('user_criteria_desc'));
154  $userCriteria->setRequired(true);
155 
156  $fields = ['usr_id', 'login', 'email', 'matriculation', 'ext_account'];
157  $usr_fields = [];
158  foreach ($fields as $field) {
159  $usr_fields[$field] = $field;
160  }
161  $userCriteria->setOptions($usr_fields);
162  $userCriteria->setValue($user_criteria);
163  $form->addItem($userCriteria);
164 
165  $numRequiredAnswers = new ilNumberInputGUI(
166  $this->lng->txt('tst_skill_triggerings_num_req_answers'),
167  'num_req_answers'
168  );
169  $numRequiredAnswers->setInfo($this->lng->txt('tst_skill_triggerings_num_req_answers_desc'));
170  $numRequiredAnswers->setSize(4);
171  $numRequiredAnswers->allowDecimals(false);
172  $numRequiredAnswers->setMinValue(1);
173  $numRequiredAnswers->setMinvalueShouldBeGreater(false);
174  $numRequiredAnswers->setValue($this->getAssessmentFolder()->getSkillTriggeringNumAnswersBarrier());
175  $form->addItem($numRequiredAnswers);
176 
177  $ceeqwh = new ilCheckboxInputGUI($this->lng->txt('export_essay_qst_with_html'), 'export_essay_qst_with_html');
178  $ceeqwh->setChecked($this->getAssessmentFolder()->getExportEssayQuestionsWithHtml());
179  $ceeqwh->setInfo($this->lng->txt('export_essay_qst_with_html_desc'));
180  $form->addItem($ceeqwh);
181 
182  // question settings
183  $header = new ilFormSectionHeaderGUI();
184  $header->setTitle($this->lng->txt("assf_questiontypes"));
185  $form->addItem($header);
186 
187  // available question types
188  $allowed = new ilCheckboxGroupInputGUI(
189  $this->lng->txt('assf_allowed_questiontypes'),
190  "chb_allowed_questiontypes"
191  );
192  $questiontypes = ilObjQuestionPool::_getQuestionTypes(true);
194  $allowedtypes = [];
195  foreach ($questiontypes as $qt) {
196  if (!in_array($qt['question_type_id'], $forbidden_types)) {
197  $allowedtypes[] = $qt['question_type_id'];
198  }
199  }
200  $allowed->setValue($allowedtypes);
201  foreach ($questiontypes as $type_name => $qtype) {
202  $allowed->addOption(new ilCheckboxOption($type_name, (string) $qtype["question_type_id"]));
203  }
204  $allowed->setInfo($this->lng->txt('assf_allowed_questiontypes_desc'));
205  $form->addItem($allowed);
206 
207  // manual scoring
208  $manual = new ilCheckboxGroupInputGUI(
209  $this->lng->txt('assessment_log_manual_scoring_activate'),
210  "chb_manual_scoring"
211  );
213  $manual->setValue($manscoring);
214  foreach ($questiontypes as $type_name => $qtype) {
215  $manual->addOption(new ilCheckboxOption($type_name, (string) $qtype["question_type_id"]));
216  }
217  $manual->setInfo($this->lng->txt('assessment_log_manual_scoring_desc'));
218  $form->addItem($manual);
219 
220  // scoring adjustment active
221  $scoring_activation = new ilCheckboxInputGUI(
222  $this->lng->txt('assessment_scoring_adjust'),
223  'chb_scoring_adjust'
224  );
225  $scoring_activation->setChecked($this->getAssessmentFolder()->getScoringAdjustmentEnabled());
226  $scoring_activation->setInfo($this->lng->txt('assessment_scoring_adjust_desc'));
227  $form->addItem($scoring_activation);
228 
229  // scoring adjustment
230  $scoring = new ilCheckboxGroupInputGUI(
231  $this->lng->txt('assessment_log_scoring_adjustment_activate'),
232  "chb_scoring_adjustment"
233  );
234  $scoring_active = $this->getAssessmentFolder()->getScoringAdjustableQuestions();
235  $scoring->setValue($scoring_active);
236 
237  foreach ($this->getAssessmentFolder()->fetchScoringAdjustableTypes($questiontypes) as $type_name => $qtype) {
238  $scoring->addOption(
239  new ilCheckboxOption($type_name, (string) $qtype["question_type_id"])
240  );
241  }
242  $scoring->setInfo($this->lng->txt('assessment_log_scoring_adjustment_desc'));
243  $form->addItem($scoring);
244 
245  if ($this->access->checkAccess("write", "", $this->getAssessmentFolder()->getRefId())) {
246  $form->addCommandButton("saveSettings", $this->lng->txt("save"));
247  }
248 
249  return $form;
250  }
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...
This class represents a selection list property in a property form.
setInfo(string $a_info)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
static _getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRequired(bool $a_required)
static _getManualScoring()
Retrieve the manual scoring settings.
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteLogObject()

ilObjAssessmentFolderGUI::deleteLogObject ( )

Deletes the log entries for one or more tests.

Definition at line 516 of file class.ilObjAssessmentFolderGUI.php.

References getAssessmentFolder(), ILIAS\Repository\lng(), logAdminObject(), and ILIAS\Repository\refinery().

516  : void
517  {
518  $test_ids = $this->post_wrapper->retrieve(
519  'chb_test',
520  $this->refinery->byTrying([
521  $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int()),
522  $this->refinery->always([])
523  ])
524  );
525 
526  if ($test_ids !== []) {
527  $this->getAssessmentFolder()->deleteLogEntries($test_ids);
528  $this->tpl->setOnScreenMessage('success', $this->lng->txt("ass_log_deleted"));
529  } else {
530  $this->tpl->setOnScreenMessage('info', $this->lng->txt("ass_log_delete_no_selection"));
531  }
532 
533  $this->logAdminObject();
534  }
logAdminObject()
Administration output for assessment log files.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjAssessmentFolderGUI::executeCommand ( )

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

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

53  : void
54  {
55  $next_class = $this->ctrl->getNextClass($this);
56  $cmd = $this->ctrl->getCmd();
57  $this->prepareOutput();
58 
59  switch ($next_class) {
60  case 'ilpermissiongui':
61  $this->tabs_gui->activateTab('perm_settings');
62  $perm_gui = new ilPermissionGUI($this);
63  $this->ctrl->forwardCommand($perm_gui);
64  break;
65  case 'ilglobalunitconfigurationgui':
66  if (!$this->rbac_system->checkAccess('visible,read', $this->getAssessmentFolder()->getRefId())) {
67  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->WARNING);
68  }
69 
70  $this->tabs_gui->setTabActive('units');
71 
74  );
75  $this->ctrl->forwardCommand($gui);
76  break;
77 
78  default:
79  if ($cmd === null || $cmd === "" || $cmd === "view") {
80  $cmd = "settings";
81  }
82  $cmd .= "Object";
83  $this->$cmd();
84 
85  break;
86  }
87  }
prepareOutput(bool $show_sub_objects=true)
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...
header include for all ilias files.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ exportLogObject()

ilObjAssessmentFolderGUI::exportLogObject ( )

Called when the a log should be exported.

Definition at line 330 of file class.ilObjAssessmentFolderGUI.php.

References ILIAS\LTI\ToolProvider\$key, $log, ilObjTest\_getAvailableTests(), ilObjUser\_lookupName(), ilUtil\deliverData(), ilObjAssessmentFolder\getLog(), getLogDataOutputForm(), IL_CAL_FKT_DATE, IL_CAL_UNIX, ILIAS\Repository\int(), ILIAS\Repository\lng(), logsObject(), and ilCSVUtil\processCSVRow().

330  : void
331  {
332  $form = $this->getLogDataOutputForm();
333  if (!$form->checkInput()) {
334  $form->setValuesByPost();
335  $this->logsObject($form);
336  return;
337  }
338 
339  $test = (int) $form->getInput('sel_test');
340  $from = $form->getItemByPostVar('log_from')->getDate()->get(IL_CAL_UNIX);
341  $until = $form->getItemByPostVar('log_until')->getDate()->get(IL_CAL_UNIX);
342 
343  $csv = [];
344  $separator = ";";
345  $row = [
346  $this->lng->txt("assessment_log_datetime"),
347  $this->lng->txt("user"),
348  $this->lng->txt("assessment_log_text"),
349  $this->lng->txt("question")
350  ];
351 
352  $available_tests = ilObjTest::_getAvailableTests(1);
353  $csv[] = ilCSVUtil::processCSVRow($row, true, $separator);
354  $log_output = ilObjAssessmentFolder::getLog($from, $until, $test);
355  $users = [];
356  foreach ($log_output as $key => $log) {
357  if (!array_key_exists($log["user_fi"], $users)) {
358  $users[$log["user_fi"]] = ilObjUser::_lookupName((int) $log["user_fi"]);
359  }
360  $title = "";
361  if ($log["question_fi"] || $log["original_fi"]) {
362  $title = $this->questioninfo->getQuestionTitle((int) $log["question_fi"]);
363  if ($title === '') {
364  $title = $this->questioninfo->getQuestionTitle((int) $log["original_fi"]);
365  }
366  $title = $this->lng->txt("assessment_log_question") . ": " . $title;
367  }
368  $csvrow = [];
369  $date = new ilDateTime((int) $log['tstamp'], IL_CAL_UNIX);
370  $csvrow[] = $date->get(IL_CAL_FKT_DATE, 'Y-m-d H:i');
371  $csvrow[] = trim($users[$log["user_fi"]]["title"] . " " . $users[$log["user_fi"]]["firstname"] . " " . $users[$log["user_fi"]]["lastname"]);
372  $csvrow[] = trim($log["logtext"]);
373  $csvrow[] = $title;
374  $csv[] = ilCSVUtil::processCSVRow($csvrow, true, $separator);
375  }
376  $csvoutput = "";
377  foreach ($csv as $row) {
378  $csvoutput .= implode($separator, $row) . "\n";
379  }
381  $csvoutput,
382  str_replace(" ", "_", "log_" . $from . "_" . $until . "_" . $available_tests[$test]) . ".csv"
383  );
384  }
static & processCSVRow(array &$row, bool $quoteAll=false, string $separator=';', bool $outUTF8=false, bool $compatibleWithMSExcel=true)
Convertes an array for CSV usage.
static getLog(int $ts_from, int $ts_to, int $test_id, bool $test_only=false)
Retrieve assessment log datasets from the database.
static _lookupName(int $a_user_id)
lookup user name
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
const IL_CAL_UNIX
$log
Definition: result.php:33
const IL_CAL_FKT_DATE
string $key
Consumer key/client ID value.
Definition: System.php:193
logsObject(ilPropertyFormGUI $form=null)
static _getAvailableTests($use_object_id=false)
Returns the available tests for the active user.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjAssessmentFolderGUI::getAdminTabs ( )

Definition at line 563 of file class.ilObjAssessmentFolderGUI.php.

References getTabs().

563  : void
564  {
565  $this->getTabs();
566  }
+ Here is the call graph for this function:

◆ getAssessmentFolder()

ilObjAssessmentFolderGUI::getAssessmentFolder ( )
private

PhpIncompatibleReturnTypeInspection

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

References ilObjectGUI\$object.

Referenced by buildSettingsForm(), deleteLogObject(), getLogDataOutputForm(), logAdminObject(), saveLogSettingsObject(), and saveSettingsObject().

48  {
50  return $this->object;
51  }
Class ilObjAssessmentFolder.
+ Here is the caller graph for this function:

◆ getLogDataOutputForm()

ilObjAssessmentFolderGUI::getLogDataOutputForm ( )
protected
Returns
ilPropertyFormGUI

Definition at line 389 of file class.ilObjAssessmentFolderGUI.php.

References ILIAS\LTI\ToolProvider\$key, ilObjTest\_getAvailableTests(), ILIAS\Repository\ctrl(), getAssessmentFolder(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\prepareFormOutput(), ilFormPropertyGUI\setRequired(), ilDateTimeInputGUI\setShowTime(), and ilArrayUtil\sortArray().

Referenced by exportLogObject(), logsObject(), and showLogObject().

390  {
391  $form = new ilPropertyFormGUI();
392  $form->setPreventDoubleSubmission(false);
393  $form->setFormAction($this->ctrl->getFormAction($this));
394  $form->setTableWidth("100%");
395  $form->setId("logs");
396 
397  $header = new ilFormSectionHeaderGUI();
398  $header->setTitle($this->lng->txt("assessment_log"));
399  $form->addItem($header);
400 
401  // from
402  $from = new ilDateTimeInputGUI($this->lng->txt('cal_from'), "log_from");
403  $from->setShowTime(true);
404  $from->setRequired(true);
405  $form->addItem($from);
406 
407  // until
408  $until = new ilDateTimeInputGUI($this->lng->txt('cal_until'), "log_until");
409  $until->setShowTime(true);
410  $until->setRequired(true);
411  $form->addItem($until);
412 
413  $available_tests = ilObjTest::_getAvailableTests(1);
414 
415  // tests
416  $fortest = new ilSelectInputGUI($this->lng->txt('assessment_log_for_test'), "sel_test");
417  $fortest->setRequired(true);
418  $sorted_options = [];
419  foreach ($available_tests as $key => $value) {
420  $sorted_options[] = [
421  'title' => ilLegacyFormElementsUtil::prepareFormOutput($value) . " [" . $this->getAssessmentFolder()->getNrOfLogEntries((int) $key) . " " . $this->lng->txt("assessment_log_log_entries") . "]",
422  'key' => $key
423  ];
424  }
425  $sorted_options = ilArrayUtil::sortArray($sorted_options, 'title', 'asc');
426  $options = ['' => $this->lng->txt('please_choose')];
427  foreach ($sorted_options as $option) {
428  $options[$option['key']] = $option['title'];
429  }
430  $fortest->setOptions($options);
431  $form->addItem($fortest);
432 
433  $form->addCommandButton('showLog', $this->lng->txt('show'));
434  $form->addCommandButton('exportLog', $this->lng->txt('export'));
435 
436  return $form;
437  }
This class represents a selection list property in a property form.
setShowTime(bool $a_showtime)
static prepareFormOutput($a_str, bool $a_strip=false)
This class represents a date/time property in a property form.
string $key
Consumer key/client ID value.
Definition: System.php:193
setRequired(bool $a_required)
static _getAvailableTests($use_object_id=false)
Returns the available tests for the active user.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogdataSubtabs()

ilObjAssessmentFolderGUI::getLogdataSubtabs ( )

Definition at line 568 of file class.ilObjAssessmentFolderGUI.php.

References ILIAS\Repository\ctrl().

Referenced by getTabs().

568  : void
569  {
570  $this->tabs_gui->addSubTabTarget(
571  "settings",
572  $this->ctrl->getLinkTarget($this, "showLogSettings"),
573  ["saveLogSettings", "showLogSettings"],
574  ""
575  );
576 
577  // log output
578  $this->tabs_gui->addSubTabTarget(
579  "ass_log_output",
580  $this->ctrl->getLinkTarget($this, "logs"),
581  ["logs", "showLog", "exportLog"],
582  ""
583  );
584 
585  // log administration
586  $this->tabs_gui->addSubTabTarget(
587  "ass_log_admin",
588  $this->ctrl->getLinkTarget($this, "logAdmin"),
589  ["logAdmin", "deleteLog"],
590  "",
591  ""
592  );
593  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogSettingsForm()

ilObjAssessmentFolderGUI::getLogSettingsForm ( )
protected
Returns
ilPropertyFormGUI

Definition at line 686 of file class.ilObjAssessmentFolderGUI.php.

References $lang, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by saveLogSettingsObject(), and showLogSettingsObject().

687  {
688  $form = new ilPropertyFormGUI();
689  $form->setFormAction($this->ctrl->getFormAction($this, 'saveLogSettings'));
690  $form->setTitle($this->lng->txt('assessment_log_logging'));
691 
692  $logging = new ilCheckboxInputGUI('', 'chb_assessment_logging');
693  $logging->setValue('1');
694  $logging->setOptionTitle($this->lng->txt('activate_assessment_logging'));
695  $form->addItem($logging);
696 
697  $reporting = new ilSelectInputGUI(
698  $this->lng->txt('assessment_settings_reporting_language'),
699  'reporting_language'
700  );
701  $languages = $this->lng->getInstalledLanguages();
702  $this->lng->loadLanguageModule('meta');
703  $options = [];
704  foreach ($languages as $lang) {
705  $options[$lang] = $this->lng->txt('meta_l_' . $lang);
706  }
707  $reporting->setOptions($options);
708  $form->addItem($reporting);
709 
710  if ($this->access->checkAccess('write', '', $this->getAssessmentFolder()->getRefId())) {
711  $form->addCommandButton('saveLogSettings', $this->lng->txt('save'));
712  }
713 
714  return $form;
715  }
This class represents a selection list property in a property form.
$lang
Definition: xapiexit.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjAssessmentFolderGUI::getTabs ( )
protected

Definition at line 595 of file class.ilObjAssessmentFolderGUI.php.

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

Referenced by getAdminTabs().

595  : void
596  {
597  switch ($this->ctrl->getCmd()) {
598  case "saveLogSettings":
599  case "showLogSettings":
600  case "logs":
601  case "showLog":
602  case "exportLog":
603  case "logAdmin":
604  case "deleteLog":
605  $this->getLogdataSubtabs();
606  break;
607  }
608 
609  if ($this->rbac_system->checkAccess("visible,read", $this->getAssessmentFolder()->getRefId())) {
610  $this->tabs_gui->addTarget(
611  "settings",
612  $this->ctrl->getLinkTarget($this, "settings"),
613  ["settings", "", "view"],
614  "",
615  ""
616  );
617 
618  $this->tabs_gui->addTarget(
619  "logs",
620  $this->ctrl->getLinkTarget($this, "showLogSettings"),
621  ['saveLogSettings', 'showLogSettings', "logs", "showLog", "exportLog", "logAdmin", "deleteLog"],
622  "",
623  ""
624  );
625 
626  $this->tabs_gui->addTarget(
627  'units',
628  $this->ctrl->getLinkTargetByClass('ilGlobalUnitConfigurationGUI', ''),
629  '',
630  'ilglobalunitconfigurationgui'
631  );
632  }
633 
634  if ($this->rbac_system->checkAccess('edit_permission', $this->getAssessmentFolder()->getRefId())) {
635  $this->tabs_gui->addTarget(
636  "perm_settings",
637  $this->ctrl->getLinkTargetByClass([get_class($this), 'ilpermissiongui'], "perm"),
638  ["perm", "info", "owner"],
639  'ilpermissiongui'
640  );
641  }
642  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logAdminObject()

ilObjAssessmentFolderGUI::logAdminObject ( )

Administration output for assessment log files.

Definition at line 539 of file class.ilObjAssessmentFolderGUI.php.

References ilObjectGUI\$data, ilObjectGUI\$obj_id, ilObjectGUI\$ref_id, ilObjTest\_getAvailableTests(), ilObject\_lookupObjectId(), ILIAS\Repository\access(), getAssessmentFolder(), ilObjectGUI\getRefId(), and ILIAS\Repository\lng().

Referenced by deleteLogObject().

539  : void
540  {
541  $this->tabs_gui->activateTab('logs');
542 
543  $a_write_access = ($this->access->checkAccess("write", "", $this->getAssessmentFolder()->getRefId())) ? true : false;
544 
545  $table_gui = new ilAssessmentFolderLogAdministrationTableGUI($this, 'logAdmin', $a_write_access);
546 
547  $available_tests = ilObjTest::_getAvailableTests(false);
548  $data = [];
549  foreach ($available_tests as $ref_id => $title) {
551  $data[] = [
552  "title" => $title,
553  "nr" => $this->getAssessmentFolder()->getNrOfLogEntries((int) $obj_id),
554  "id" => $obj_id,
555  "location_href" => ilLink::_getLink($ref_id, 'tst'),
556  "location_txt" => $this->lng->txt("perma_link")
557  ];
558  }
559  $table_gui->setData($data);
560  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
561  }
static _lookupObjectId(int $ref_id)
static _getAvailableTests($use_object_id=false)
Returns the available tests for the active user.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logsObject()

ilObjAssessmentFolderGUI::logsObject ( ilPropertyFormGUI  $form = null)
Parameters
ilPropertyFormGUI | null$form

Definition at line 442 of file class.ilObjAssessmentFolderGUI.php.

References ILIAS\Repository\ctrl(), ilObjAssessmentFolder\getLog(), getLogDataOutputForm(), IL_CAL_DATETIME, IL_CAL_UNIX, and ILIAS\Repository\int().

Referenced by exportLogObject(), and showLogObject().

442  : void
443  {
444  $this->tabs_gui->activateTab('logs');
445 
446  $template = new ilTemplate("tpl.assessment_logs.html", true, true, "Modules/Test");
447 
448  $p_test = 0;
449  $fromdate = 0;
450  $untildate = 0;
451 
452  if (!($form instanceof ilPropertyFormGUI)) {
453  $form = $this->getLogDataOutputForm();
454 
455  $values = [];
456  if ($this->testrequest->isset('sel_test')) {
457  $p_test = $values['sel_test'] = $this->testrequest->int('sel_test');
458  }
459 
460  if ($this->testrequest->isset('log_from')) {
461  $fromdate = $this->testrequest->int('log_from');
462  } else {
463  $fromdate = mktime(0, 0, 0, 1, 1, (int) date('Y'));
464  }
465 
466  if ($this->testrequest->isset('log_until')) {
467  $untildate = $this->testrequest->int('log_until');
468  } else {
469  $untildate = time();
470  }
471 
472  $values['log_from'] = (new ilDateTime($fromdate, IL_CAL_UNIX))->get(IL_CAL_DATETIME);
473  $values['log_until'] = (new ilDateTime($untildate, IL_CAL_UNIX))->get(IL_CAL_DATETIME);
474 
475  $form->setValuesByArray($values);
476  } else {
477  $fromdate_input = $form->getItemByPostVar('log_from')->getDate();
478  $untildate_input = $form->getItemByPostVar('log_until')->getDate();
479  if ($fromdate_input instanceof ilDateTime && $untildate_input instanceof ilDateTime) {
480  $p_test = (int) $form->getInput('sel_test');
481 
482  $fromdate = $fromdate_input->get(IL_CAL_UNIX);
483  $untildate = $untildate_input->get(IL_CAL_UNIX);
484  }
485  }
486 
487  $this->ctrl->setParameter($this, 'sel_test', (int) $p_test);
488  $this->ctrl->setParameter($this, 'log_until', (int) $untildate);
489  $this->ctrl->setParameter($this, 'log_from', (int) $fromdate);
490 
491  $template->setVariable("FORM", $form->getHTML());
492 
493  if ($p_test) {
494  $table_gui = new ilAssessmentFolderLogTableGUI($this, 'logs');
495  $log_output = ilObjAssessmentFolder::getLog($fromdate, $untildate, $p_test);
496 
497  $self = $this;
498  array_walk($log_output, static function (&$row) use ($self) {
499  $row['location_href'] = '';
500  $row['location_txt'] = '';
501  if (is_numeric($row['ref_id']) && $row['ref_id'] > 0) {
502  $row['location_href'] = ilLink::_getLink((int) $row['ref_id'], 'tst');
503  $row['location_txt'] = $self->lng->txt("perma_link");
504  }
505  });
506 
507  $table_gui->setData($log_output);
508  $template->setVariable('LOG', $table_gui->getHTML());
509  }
510  $this->tpl->setVariable("ADM_CONTENT", $template->get());
511  }
const IL_CAL_DATETIME
getItemByPostVar(string $a_post_var)
static getLog(int $ts_from, int $ts_to, int $test_id, bool $test_only=false)
Retrieve assessment log datasets from the database.
const IL_CAL_UNIX
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveLogSettingsObject()

ilObjAssessmentFolderGUI::saveLogSettingsObject ( )
protected

Definition at line 665 of file class.ilObjAssessmentFolderGUI.php.

References ILIAS\Repository\access(), getAssessmentFolder(), getLogSettingsForm(), ILIAS\Repository\lng(), and showLogSettingsObject().

665  : void
666  {
667  if (!$this->access->checkAccess('write', '', $this->getAssessmentFolder()->getRefId())) {
668  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->WARNING);
669  }
670 
671  $form = $this->getLogSettingsForm();
672  if ($form->checkInput()) {
673  $this->getAssessmentFolder()->_enableAssessmentLogging((bool) $form->getInput('chb_assessment_logging'));
674  $this->getAssessmentFolder()->_setLogLanguage((string) $form->getInput('reporting_language'));
675  $this->getAssessmentFolder()->update();
676  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'));
677  }
678 
679  $form->setValuesByPost();
680  $this->showLogSettingsObject($form);
681  }
header include for all ilias files.
showLogSettingsObject(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjAssessmentFolderGUI::saveSettingsObject ( )

Save Assessment settings.

Definition at line 255 of file class.ilObjAssessmentFolderGUI.php.

References ilObjQuestionPool\_getQuestionTypes(), ILIAS\Repository\access(), ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, buildSettingsForm(), ILIAS\Repository\ctrl(), getAssessmentFolder(), ilObjAssessmentFolder\getValidAssessmentProcessLockModes(), ILIAS\Repository\int(), ILIAS\Repository\lng(), settingsObject(), and ilUtil\stripSlashes().

255  : void
256  {
257  if (!$this->access->checkAccess("write", "", $this->getAssessmentFolder()->getRefId())) {
258  $this->ctrl->redirect($this, 'settings');
259  }
260 
261  $form = $this->buildSettingsForm();
262  if (!$form->checkInput()) {
263  $form->setValuesByPost();
264  $this->settingsObject($form);
265  return;
266  }
267 
268  $this->getAssessmentFolder()->setSkillTriggeringNumAnswersBarrier((int) $form->getInput('num_req_answers'));
269  $this->getAssessmentFolder()->setExportEssayQuestionsWithHtml(
270  (bool) ($form->getInput('export_essay_qst_with_html') ?? '0')
271  );
272  $this->getAssessmentFolder()->_setManualScoring($form->getInput('chb_manual_scoring') ?? []);
273  $question_types = ilObjQuestionPool::_getQuestionTypes(true);
274  $forbidden_types = [];
275  foreach ($question_types as $name => $row) {
276  if (!$form->getItemByPostVar('chb_allowed_questiontypes') ||
277  !in_array($row["question_type_id"], $form->getInput('chb_allowed_questiontypes'))) {
278  $forbidden_types[] = (int) $row["question_type_id"];
279  }
280  }
281  $this->getAssessmentFolder()->_setForbiddenQuestionTypes($forbidden_types);
282  $this->getAssessmentFolder()->setScoringAdjustmentEnabled(
283  (bool) ($form->getInput('chb_scoring_adjust') ?? '0')
284  );
285  $scoring_types = [];
286  foreach ($question_types as $name => $row) {
287  if ($form->getItemByPostVar('chb_scoring_adjustment') &&
288  in_array($row["question_type_id"], $form->getInput('chb_scoring_adjustment'))) {
289  $scoring_types[] = $row["question_type_id"];
290  }
291  }
292  $this->getAssessmentFolder()->setScoringAdjustableQuestions($scoring_types);
293  if (!$form->getInput('ass_process_lock')) {
294  $this->getAssessmentFolder()->setAssessmentProcessLockMode(ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
295  } elseif (in_array(
296  $form->getInput('ass_process_lock_mode'),
298  true
299  )) {
300  $this->getAssessmentFolder()->setAssessmentProcessLockMode($form->getInput('ass_process_lock_mode'));
301  }
302 
303  $assessmentSetting = new ilSetting('assessment');
304  $assessmentSetting->set('use_javascript', '1');
305  if (strlen($form->getInput('imap_line_color') ?? '') === 6) {
306  $assessmentSetting->set('imap_line_color', ilUtil::stripSlashes($form->getInput('imap_line_color')));
307  }
308  $assessmentSetting->set('user_criteria', ilUtil::stripSlashes($form->getInput('user_criteria')));
309 
310  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
311 
312  $this->ctrl->redirect($this, 'settings');
313  }
settingsObject(ilPropertyFormGUI $form=null)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
+ Here is the call graph for this function:

◆ settingsObject()

ilObjAssessmentFolderGUI::settingsObject ( ilPropertyFormGUI  $form = null)

Definition at line 89 of file class.ilObjAssessmentFolderGUI.php.

References buildSettingsForm().

Referenced by saveSettingsObject().

89  : void
90  {
91  $this->tabs_gui->setTabActive('settings');
92 
93  if ($form === null) {
94  $form = $this->buildSettingsForm();
95  }
96 
97  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
98  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLogObject()

ilObjAssessmentFolderGUI::showLogObject ( )

Called when the a log should be shown.

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

References getLogDataOutputForm(), and logsObject().

318  : void
319  {
320  $form = $this->getLogDataOutputForm();
321  $form->checkInput();
322 
323  $form->setValuesByPost();
324  $this->logsObject($form);
325  }
logsObject(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

◆ showLogSettingsObject()

ilObjAssessmentFolderGUI::showLogSettingsObject ( ilPropertyFormGUI  $form = null)
protected
Parameters
ilPropertyFormGUI$form

Definition at line 647 of file class.ilObjAssessmentFolderGUI.php.

References ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), and getLogSettingsForm().

Referenced by saveLogSettingsObject().

647  : void
648  {
649  $this->tabs_gui->activateTab('logs');
650 
651  if (!($form instanceof ilPropertyFormGUI)) {
652  $form = $this->getLogSettingsForm();
653  $form->setValuesByArray([
654  'chb_assessment_logging' => ilObjAssessmentFolder::_enabledAssessmentLogging(),
655  'reporting_language' => ilObjAssessmentFolder::_getLogLanguage()
656  ]);
657  }
658 
659  $this->tpl->setContent($form->getHTML());
660  }
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $questioninfo

ILIAS TestQuestionPool QuestionInfoService ilObjAssessmentFolderGUI::$questioninfo
protected

Definition at line 28 of file class.ilObjAssessmentFolderGUI.php.

◆ $testrequest

ILIAS Test InternalRequestService ilObjAssessmentFolderGUI::$testrequest
protected

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


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