5require_once
"./Services/Object/classes/class.ilObjectGUI.php";
49 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
53 $this->lng =
$DIC->language();
54 $this->
user = $DIC->user();
55 $this->ctrl =
$DIC->ctrl();
56 $this->tabs =
$DIC->tabs();
57 $this->help =
$DIC[
"ilHelp"];
58 $this->locator =
$DIC[
"ilLocator"];
59 $this->tpl =
$DIC[
"tpl"];
60 $this->toolbar =
$DIC->toolbar();
63 $this->lng->loadLanguageModule(
'cert');
66 parent::__construct($a_data, $a_id, $a_call_by_reference,
false);
68 $lng->loadLanguageModule(
"exercise");
69 $lng->loadLanguageModule(
"exc");
70 $this->ctrl->saveParameter($this,
"ass_id");
72 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
75 } elseif ($_REQUEST[
"ass_id"] > 0) {
90 $next_class = $this->ctrl->getNextClass($this);
91 $cmd = $this->ctrl->getCmd();
95 switch ($next_class) {
96 case "ilinfoscreengui":
97 $ilTabs->activateTab(
"info");
101 case 'ilpermissiongui':
102 $ilTabs->activateTab(
"permissions");
103 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
105 $ret = &$this->ctrl->forwardCommand($perm_gui);
108 case "illearningprogressgui":
109 $ilTabs->activateTab(
"learning_progress");
110 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
114 $this->object->getRefId(),
117 $this->ctrl->forwardCommand($new_gui);
118 $this->tabs_gui->setTabActive(
'learning_progress');
121 case 'ilobjectcopygui':
122 $ilCtrl->saveParameter($this,
'new_type');
123 $ilCtrl->setReturnByClass(get_class($this),
'create');
125 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
128 $this->ctrl->forwardCommand($cp);
132 $ilTabs->activateTab(
"export");
133 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
135 $exp_gui->addFormat(
"xml");
136 $ret = $this->ctrl->forwardCommand($exp_gui);
140 case "ilcommonactiondispatchergui":
141 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
143 $this->ctrl->forwardCommand($gui);
146 case "ilcertificategui":
148 $this->tabs_gui->activateTab(
"settings");
149 $this->tabs_gui->activateSubTab(
"certificate");
152 $output_gui = $guiFactory->create($this->
object);
154 $this->ctrl->forwardCommand($output_gui);
157 case "ilexassignmenteditorgui":
159 $ilTabs->activateTab(
"content");
161 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php");
162 $ass_gui =
new ilExAssignmentEditorGUI($this->object->getId(), $this->object->isCompletionBySubmissionEnabled(), $this->ass);
163 $this->ctrl->forwardCommand($ass_gui);
166 case "ilexsubmissiongui":
168 $ilTabs->activateTab(
"content");
170 $this->ctrl->setReturn($this,
"showOverview");
171 include_once(
"./Modules/Exercise/classes/class.ilExSubmissionGUI.php");
172 $sub_gui =
new ilExSubmissionGUI($this->
object, $this->ass, (
int) $_REQUEST[
"member_id"]);
173 $this->ctrl->forwardCommand($sub_gui);
176 case "ilexercisemanagementgui":
178 if (
$GLOBALS[
'DIC']->access()->checkRbacOrPositionPermissionAccess(
179 'edit_submissions_grades',
180 'edit_submissions_grades',
181 $this->object->getRefId()
183 $ilTabs->activateTab(
"grades");
184 include_once(
"./Modules/Exercise/classes/class.ilExerciseManagementGUI.php");
186 $this->ctrl->forwardCommand($mgmt_gui);
192 case "ilexccriteriacataloguegui":
194 $ilTabs->activateTab(
"settings");
196 $ilTabs->activateSubTab(
"crit");
197 include_once(
"./Modules/Exercise/classes/class.ilExcCriteriaCatalogueGUI.php");
199 $this->ctrl->forwardCommand($crit_gui);
228 $a_new_object->saveData();
230 ilUtil::sendSuccess($this->lng->txt(
"exc_added"),
true);
232 $ilCtrl->setParameterByClass(
"ilExAssignmentEditorGUI",
"ref_id", $a_new_object->
getRefId());
233 $ilCtrl->redirectByClass(
"ilExAssignmentEditorGUI",
"addAssignment");
243 $ilCtrl->redirectByClass(
"ilExAssignmentEditorGUI",
"listAssignments");
253 $a_form->
setTitle($this->lng->txt(
"exc_edit_exercise"));
256 $pres->setTitle($this->lng->txt(
'obj_presentation'));
260 $a_form = $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
263 $section->setTitle($this->lng->txt(
'exc_passing_exc'));
270 $this->lng->txt(
"exc_pass_all"),
272 $this->lng->txt(
"exc_pass_all_info")
274 $radg->addOption($op1);
276 $this->lng->txt(
"exc_pass_minimum_nr"),
278 $this->lng->txt(
"exc_pass_minimum_nr_info")
280 $radg->addOption($op2);
285 $ni->setMaxLength(4);
286 $ni->setRequired(
true);
287 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
289 $min = max($mand, 1);
290 $ni->setMinValue($min,
true);
291 $ni->setInfo($this->lng->txt(
"exc_min_nr_info"));
292 $op2->addSubItem($ni);
297 $subcompl =
new ilRadioGroupInputGUI($this->lng->txt(
"exc_passed_status_determination"),
"completion_by_submission");
298 $op1 =
new ilRadioOption($this->lng->txt(
"exc_completion_by_tutor"), 0,
"");
299 $subcompl->addOption($op1);
300 $op2 =
new ilRadioOption($this->lng->txt(
"exc_completion_by_submission"), 1, $this->lng->txt(
"exc_completion_by_submission_info"));
301 $subcompl->addOption($op2);
310 $section->setTitle($this->lng->txt(
'exc_publishing'));
314 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"exc_show_submissions"),
"show_submissions");
315 $cb->setInfo($this->lng->txt(
"exc_show_submissions_info"));
319 $section->setTitle($this->lng->txt(
'exc_notification'));
323 $cbox =
new ilCheckboxInputGUI($this->lng->txt(
"exc_submission_notification"),
"notification");
324 $cbox->setInfo($this->lng->txt(
"exc_submission_notification_info"));
331 $section->setTitle($this->lng->txt(
'exc_feedback'));
338 $option->setInfo($this->lng->txt(
"exc_settings_feedback_mail_info"));
339 $fdb->addOption($option);
341 $option->setInfo($this->lng->txt(
"exc_settings_feedback_file_info"));
342 $fdb->addOption($option);
344 $option->setInfo($this->lng->txt(
"exc_settings_feedback_text_info"));
345 $fdb->addOption($option);
348 ->getObjectPositionSettingsByType($this->object->getType());
350 if ($position_settings->isActive()) {
353 $feat->setTitle($this->lng->txt(
'obj_features'));
358 $this->object->getId(),
374 $a_values[
"desc"] = $this->
object->getLongDescription();
375 $a_values[
"show_submissions"] = $this->
object->getShowSubmissions();
376 $a_values[
"pass_mode"] = $this->
object->getPassMode();
377 if ($a_values[
"pass_mode"] ==
"nr") {
378 $a_values[
"pass_nr"] = $this->
object->getPassNr();
381 include_once
"./Services/Notification/classes/class.ilNotification.php";
385 $this->object->getId()
388 $a_values[
'completion_by_submission'] = (int) $this->object->isCompletionBySubmissionEnabled();
390 $tfeedback = array();
391 if ($this->object->hasTutorFeedbackMail()) {
394 if ($this->object->hasTutorFeedbackText()) {
397 if ($this->object->hasTutorFeedbackFile()) {
400 $a_values[
'tfeedback'] = $tfeedback;
404 ->isPositionAccessActiveForObject($this->object->getId());
412 $this->
object->setShowSubmissions($a_form->
getInput(
"show_submissions"));
413 $this->
object->setPassMode($a_form->
getInput(
"pass_mode"));
414 if ($this->object->getPassMode() ==
"nr") {
415 $this->
object->setPassNr($a_form->
getInput(
"pass_nr"));
418 $this->
object->setCompletionBySubmission($a_form->
getInput(
'completion_by_submission') == 1 ?
true :
false);
420 $feedback = $a_form->
getInput(
"tfeedback");
421 $this->
object->setTutorFeedback(is_array($feedback)
422 ? array_sum($feedback)
425 include_once
"./Services/Notification/classes/class.ilNotification.php";
429 $this->object->getId(),
430 (
bool) $a_form->
getInput(
"notification")
434 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->saveTileImage();
437 $this->object->getId(),
459 $ilCtrl->getLinkTarget($this,
"showOverview")
465 $ilCtrl->getLinkTargetByClass(
"ilExAssignmentEditorGUI",
"listAssignments")
468 $ilTabs->activateSubTab($a_activate);
481 $ilHelp->setScreenIdComponent(
"exc");
484 $this->tabs_gui->addTab(
486 $lng->txt(
"exc_assignments"),
487 $this->ctrl->getLinkTarget($this,
"showOverview")
491 $next_class = strtolower($this->ctrl->getNextClass());
493 $this->tabs_gui->addTab(
495 $lng->txt(
"info_short"),
496 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
506 $this->tabs_gui->addTab(
508 $lng->txt(
"settings"),
509 $this->ctrl->getLinkTarget($this,
'edit')
512 if ($this->access->checkRbacOrPositionPermissionAccess(
513 'edit_submissions_grades',
514 'edit_submissions_grades',
515 $this->object->getRefId()
517 $this->tabs_gui->addTab(
519 $lng->txt(
"exc_submissions_and_grades"),
520 $this->ctrl->getLinkTargetByClass(
"ilexercisemanagementgui",
"members")
525 $save_sort_order =
$_GET[
"sort_order"];
526 $save_sort_by =
$_GET[
"sort_by"];
527 $save_offset =
$_GET[
"offset"];
530 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
532 $this->tabs_gui->addTab(
534 $lng->txt(
'learning_progress'),
535 $this->ctrl->getLinkTargetByClass(array(
'ilobjexercisegui',
'illearningprogressgui'),
'')
539 $_GET[
"sort_order"] = $save_sort_order;
540 $_GET[
"sort_by"] = $save_sort_by;
541 $_GET[
"offset"] = $save_offset;
545 $this->tabs_gui->addTab(
548 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
555 $this->tabs_gui->addTab(
557 $lng->txt(
"perm_settings"),
558 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
570 $this->ctrl->setCmd(
"showSummary");
571 $this->ctrl->setCmdClass(
"ilinfoscreengui");
584 $ilTabs->activateTab(
"info");
590 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
593 $info->enablePrivateNotes();
597 $info->enableNewsEditing();
598 $info->setBlockProperty(
"news",
"settings",
true);
605 $info->addSection($this->lng->txt(
"exc_overview"));
606 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
610 foreach (
$ass as $a) {
612 if ($a[
"mandatory"]) {
616 $info->addProperty(
$lng->txt(
"exc_assignments"), $cnt);
617 $info->addProperty(
$lng->txt(
"exc_mandatory"), $mcnt);
618 if ($this->object->getPassMode() !=
"nr") {
620 $lng->txt(
"exc_pass_mode"),
621 $lng->txt(
"exc_msg_all_mandatory_ass")
625 $lng->txt(
"exc_pass_mode"),
626 sprintf(
$lng->txt(
"exc_msg_min_number_ass"), $this->object->getPassNr())
631 include_once(
"Services/Tracking/classes/class.ilLPMarks.php");
636 $st = $this->
object->determinStatusOfUser(
$ilUser->getId());
637 $status = $st[
"overall_status"];
638 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded") {
639 $info->addSection($this->lng->txt(
"exc_feedback_from_tutor"));
640 if ($lpcomment !=
"") {
642 $this->lng->txt(
"exc_comment"),
648 $this->lng->txt(
"exc_mark"),
659 if ($status !=
"notgraded") {
661 ' alt="' .
$lng->txt(
"exc_" . $status) .
'" title="' .
$lng->txt(
"exc_" . $status) .
665 if ($st[
"failed_a_mandatory"]) {
666 $add =
" (" .
$lng->txt(
"exc_msg_failed_mandatory") .
")";
667 } elseif ($status ==
"failed") {
668 $add =
" (" .
$lng->txt(
"exc_msg_missed_minimum_number") .
")";
671 $this->lng->txt(
"status"),
672 $img .
" " . $this->lng->txt(
"exc_" . $status) . $add
679 $this->ctrl->forwardCommand(
$info);
685 $this->tabs_gui->activateSubTab(
"edit");
686 return parent::editObject();
691 $this->tabs_gui->addSubTab(
693 $this->lng->txt(
"general_settings"),
694 $this->ctrl->getLinkTarget($this,
"edit")
697 $this->tabs_gui->addSubTab(
699 $this->lng->txt(
"exc_criteria_catalogues"),
700 $this->ctrl->getLinkTargetByClass(
"ilexccriteriacataloguegui",
"")
703 include_once
"Services/Certificate/classes/class.ilCertificate.php";
705 $this->tabs_gui->addSubTab(
707 $this->lng->txt(
"certificate"),
708 $this->ctrl->getLinkTarget($this,
"certificate")
718 public static function _goto($a_target, $a_raw)
724 $ilAccess =
$DIC->access();
728 $ilCtrl->setTargetScript(
"ilias.php");
729 $ilCtrl->initBaseClass(
"ilRepositoryGUI");
733 $ass_id =
$_GET[
'ass_id'];
734 $parts = explode(
"_", $a_raw);
739 switch (end($parts)) {
759 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"ref_id", $a_target);
761 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
762 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"target", $a_raw);
765 $ilCtrl->setParameterByClass(
"ilExerciseManagementGUI",
"ass_id", $ass_id);
770 $ilCtrl->redirectByClass(array(
"ilRepositoryGUI",
"ilExerciseHandlerGUI",
"ilObjExerciseGUI",
"ilExerciseManagementGUI"),
"members");
779 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"member_id", $member);
780 $ilCtrl->redirectByClass(array(
"ilRepositoryGUI",
"ilExerciseHandlerGUI",
"ilObjExerciseGUI",
"ilExerciseManagementGUI"),
"waitingDownload");
784 if ($parts[1] !=
"") {
785 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"ass_id", $parts[1]);
786 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"ass_id_goto", $parts[1]);
788 $ilCtrl->redirectByClass(array(
"ilRepositoryGUI",
"ilExerciseHandlerGUI",
"ilObjExerciseGUI"),
"showOverview");
792 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
793 $ilCtrl->redirectByClass(array(
"ilRepositoryGUI",
"ilExerciseHandlerGUI",
"ilObjExerciseGUI"),
"infoScreen");
794 } elseif ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
796 $lng->txt(
"msg_no_perm_read_item"),
810 if (is_object($this->
object)) {
812 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"showOverview"),
"",
$_GET[
"ref_id"]);
833 $tpl->addJavaScript(
"./Modules/Exercise/js/ilExcPresentation.js");
835 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
838 $this->object->getId(),
839 $this->object->getRefId(),
843 $ilTabs->activateTab(
"content");
846 if ($this->certificateDownloadValidator->isCertificateDownloadable((
int)
$ilUser->getId(), (
int) $this->object->getId())) {
847 $ilToolbar->addButton(
848 $this->lng->txt(
"certificate"),
849 $this->ctrl->getLinkTarget($this,
"outCertificate")
853 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
856 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
857 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
859 $acc->setId(
"exc_ow_" . $this->object->getId());
862 foreach ($ass_data as
$ass) {
865 if (isset(
$_GET[
"ass_id_goto"]) &&
866 (
int)
$_GET[
"ass_id_goto"] ==
$ass->getId()) {
871 $ass_gui->getOverviewHeader(
$ass),
872 $ass_gui->getOverviewBody(
$ass),
877 if (count($ass_data) < 2) {
878 $acc->setBehaviour(
"FirstOpen");
880 $acc->setUseSessionStorage(
true);
883 $mtpl =
new ilTemplate(
"tpl.exc_ass_overview.html",
true,
true,
"Modules/Exercise");
884 $mtpl->setVariable(
"CONTENT", $acc->getHTML());
886 $tpl->setContent($mtpl->get());
892 $this->tabs_gui->activateTab(
"settings");
893 $this->tabs_gui->activateSubTab(
"certificate");
896 $output_gui = $guiFactory->create($this->
object);
898 $output_gui->certificateEditor();
905 $database =
$DIC->database();
906 $logger =
$DIC->logger()->root();
910 $objectId = (int) $this->object->getId();
912 if (
false === $this->certificateDownloadValidator->isCertificateDownloadable(
$ilUser->getId(), $objectId)) {
914 $this->ctrl->redirect($this);
918 $pdfGenerator =
new ilPdfGenerator($ilUserCertificateRepository, $logger);
924 $this->lng->txt(
'error_creating_certificate_pdf')
927 $pdfAction->downloadPdf((
int)
$ilUser->getId(), (
int) $objectId);
941 include_once(
"./Modules/Exercise/classes/class.ilExcAssMemberState.php");
943 if (!
$state->getCommonDeadline() &&
$state->getRelativeDeadline()) {
944 $idl =
$state->getIndividualDeadlineObject();
945 $idl->setStartingTimestamp(time());
950 $ilCtrl->redirect($this,
"showOverview");
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
An exception for terminatinating execution or to throw for unit testing.
Accordion user interface class.
Validates if an active certificate is stored in the database and can be downloaded by the user.
Just a wrapper class to create Unit Test for other classes.
This class represents an option in a checkbox group.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilExAssignmentEditorGUI.
GUI class for exercise assignments.
static countMandatory($a_ex_id)
Order assignments by deadline date.
static getInstancesByExercise($a_exc_id)
static lookupExerciseId($a_ass_id)
Lookup excercise id for assignment id.
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
Class ilExcCriteriaCatalogueGUI.
Exercise exceptions class.
Class ilExerciseManagementGUI.
Export User Interface Class.
static _lookupMark($a_usr_id, $a_obj_id)
static _lookupComment($a_usr_id, $a_obj_id)
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
const TYPE_EXERCISE_SUBMISSION
addLocatorItems()
Add locator item.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
viewObject()
list childs of current object
getEditFormCustomValues(array &$a_values)
Get values for properties form.
infoScreen()
show information screen
updateCustom(ilPropertyFormGUI $a_form)
Insert custom update form values into object.
executeCommand()
execute command
static _goto($a_target, $a_raw)
redirect script
getTabs()
adds tabs to tab gui object
startAssignmentObject()
Start assignment with relative deadline.
initEditCustomForm(ilPropertyFormGUI $a_form)
Init properties form.
showOverviewObject()
Show overview of assignments.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor @access public.
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
addContentSubTabs($a_activate)
Add subtabs of content view.
$certificateDownloadValidator
const TUTOR_FEEDBACK_TEXT
const TUTOR_FEEDBACK_MAIL
const TUTOR_FEEDBACK_FILE
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
prepareOutput($a_show_subobjects=true)
prepare output
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
addHeaderAction()
Add header action menu.
getObjectService()
Get object service.
const ORGU_POSITION_ACCESS
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
static getInstance()
Get instance.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Class ilPdfGeneratorConstantsTest.