5 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
39 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
43 $this->lng = $DIC->language();
44 $this->
user = $DIC->user();
45 $this->ctrl = $DIC->ctrl();
46 $this->tabs = $DIC->tabs();
47 $this->help = $DIC[
"ilHelp"];
48 $this->locator = $DIC[
"ilLocator"];
49 $this->tpl = $DIC[
"tpl"];
50 $this->toolbar = $DIC->toolbar();
51 $lng = $DIC->language();
54 parent::__construct($a_data, $a_id, $a_call_by_reference,
false);
56 $lng->loadLanguageModule(
"exercise");
57 $lng->loadLanguageModule(
"exc");
58 $this->ctrl->saveParameter($this,
"ass_id");
60 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
63 } elseif ($_REQUEST[
"ass_id"] > 0) {
64 include_once(
"./Modules/Exercise/exceptions/class.ilExerciseException.php");
76 $next_class = $this->ctrl->getNextClass($this);
77 $cmd = $this->ctrl->getCmd();
81 switch ($next_class) {
82 case "ilinfoscreengui":
83 $ilTabs->activateTab(
"info");
87 case 'ilpermissiongui':
88 $ilTabs->activateTab(
"permissions");
89 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
91 $ret =&$this->ctrl->forwardCommand($perm_gui);
94 case "illearningprogressgui":
95 $ilTabs->activateTab(
"learning_progress");
96 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
100 $this->
object->getRefId(),
103 $this->ctrl->forwardCommand($new_gui);
104 $this->tabs_gui->setTabActive(
'learning_progress');
107 case 'ilobjectcopygui':
108 $ilCtrl->saveParameter($this,
'new_type');
109 $ilCtrl->setReturnByClass(get_class($this),
'create');
111 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
114 $this->ctrl->forwardCommand($cp);
118 $ilTabs->activateTab(
"export");
119 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
121 $exp_gui->addFormat(
"xml");
122 $ret = $this->ctrl->forwardCommand($exp_gui);
126 case "ilcommonactiondispatchergui":
127 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
129 $this->ctrl->forwardCommand($gui);
132 case "ilcertificategui":
134 $this->tabs_gui->activateTab(
"settings");
135 $this->tabs_gui->activateSubTab(
"certificate");
136 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
137 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
139 $this->ctrl->forwardCommand($output_gui);
142 case "ilexassignmenteditorgui":
144 $ilTabs->activateTab(
"content");
146 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php");
148 $this->ctrl->forwardCommand($ass_gui);
151 case "ilexsubmissiongui":
153 $ilTabs->activateTab(
"content");
155 $this->ctrl->setReturn($this,
"showOverview");
156 include_once(
"./Modules/Exercise/classes/class.ilExSubmissionGUI.php");
157 $sub_gui =
new ilExSubmissionGUI($this->
object, $this->ass, (
int) $_REQUEST[
"member_id"]);
158 $this->ctrl->forwardCommand($sub_gui);
161 case "ilexercisemanagementgui":
163 if (
$GLOBALS[
'DIC']->access()->checkRbacOrPositionPermissionAccess(
164 'edit_submissions_grades',
165 'edit_submissions_grades',
168 $ilTabs->activateTab(
"grades");
169 include_once(
"./Modules/Exercise/classes/class.ilExerciseManagementGUI.php");
171 $this->ctrl->forwardCommand($mgmt_gui);
177 case "ilexccriteriacataloguegui":
179 $ilTabs->activateTab(
"settings");
181 $ilTabs->activateSubTab(
"crit");
182 include_once(
"./Modules/Exercise/classes/class.ilExcCriteriaCatalogueGUI.php");
184 $this->ctrl->forwardCommand($crit_gui);
213 $a_new_object->saveData();
217 $ilCtrl->setParameterByClass(
"ilExAssignmentEditorGUI",
"ref_id", $a_new_object->
getRefId());
218 $ilCtrl->redirectByClass(
"ilExAssignmentEditorGUI",
"addAssignment");
228 $ilCtrl->redirectByClass(
"ilExAssignmentEditorGUI",
"listAssignments");
236 $a_form->
setTitle($this->lng->txt(
"exc_edit_exercise"));
239 $section->setTitle($this->lng->txt(
'exc_passing_exc'));
246 $this->lng->txt(
"exc_pass_all"),
248 $this->lng->txt(
"exc_pass_all_info")
250 $radg->addOption($op1);
252 $this->lng->txt(
"exc_pass_minimum_nr"),
254 $this->lng->txt(
"exc_pass_minimum_nr_info")
256 $radg->addOption($op2);
261 $ni->setMaxLength(4);
262 $ni->setRequired(
true);
263 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
265 $min = max($mand, 1);
266 $ni->setMinValue($min,
true);
267 $ni->setInfo($this->lng->txt(
"exc_min_nr_info"));
268 $op2->addSubItem($ni);
273 $subcompl =
new ilRadioGroupInputGUI($this->lng->txt(
"exc_passed_status_determination"),
"completion_by_submission");
274 $op1 =
new ilRadioOption($this->lng->txt(
"exc_completion_by_tutor"), 0,
"");
275 $subcompl->addOption($op1);
276 $op2 =
new ilRadioOption($this->lng->txt(
"exc_completion_by_submission"), 1, $this->lng->txt(
"exc_completion_by_submission_info"));
277 $subcompl->addOption($op2);
286 $section->setTitle($this->lng->txt(
'exc_publishing'));
290 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"exc_show_submissions"),
"show_submissions");
291 $cb->
setInfo($this->lng->txt(
"exc_show_submissions_info"));
295 $section->setTitle($this->lng->txt(
'exc_notification'));
299 $cbox =
new ilCheckboxInputGUI($this->lng->txt(
"exc_submission_notification"),
"notification");
300 $cbox->
setInfo($this->lng->txt(
"exc_submission_notification_info"));
307 $section->setTitle($this->lng->txt(
'exc_feedback'));
314 $option->
setInfo($this->lng->txt(
"exc_settings_feedback_mail_info"));
315 $fdb->addOption($option);
317 $option->
setInfo($this->lng->txt(
"exc_settings_feedback_file_info"));
318 $fdb->addOption($option);
320 $option->
setInfo($this->lng->txt(
"exc_settings_feedback_text_info"));
321 $fdb->addOption($option);
324 ->getObjectPositionSettingsByType($this->
object->getType());
326 if ($position_settings->isActive()) {
329 $feat->setTitle($this->lng->txt(
'obj_features'));
350 $a_values[
"desc"] = $this->
object->getLongDescription();
351 $a_values[
"show_submissions"] = $this->
object->getShowSubmissions();
352 $a_values[
"pass_mode"] = $this->
object->getPassMode();
353 if ($a_values[
"pass_mode"] ==
"nr") {
354 $a_values[
"pass_nr"] = $this->
object->getPassNr();
357 include_once
"./Services/Notification/classes/class.ilNotification.php";
361 $this->
object->getId()
364 $a_values[
'completion_by_submission'] = (int) $this->
object->isCompletionBySubmissionEnabled();
366 $tfeedback =
array();
367 if ($this->
object->hasTutorFeedbackMail()) {
370 if ($this->
object->hasTutorFeedbackText()) {
373 if ($this->
object->hasTutorFeedbackFile()) {
376 $a_values[
'tfeedback'] = $tfeedback;
380 ->isPositionAccessActiveForObject($this->
object->getId());
386 $this->
object->setShowSubmissions($a_form->
getInput(
"show_submissions"));
387 $this->
object->setPassMode($a_form->
getInput(
"pass_mode"));
388 if ($this->
object->getPassMode() ==
"nr") {
389 $this->
object->setPassNr($a_form->
getInput(
"pass_nr"));
392 $this->
object->setCompletionBySubmission($a_form->
getInput(
'completion_by_submission') == 1 ? true :
false);
394 $feedback = $a_form->
getInput(
"tfeedback");
395 $this->
object->setTutorFeedback(is_array($feedback)
396 ? array_sum($feedback)
399 include_once
"./Services/Notification/classes/class.ilNotification.php";
403 $this->
object->getId(),
404 (bool) $a_form->
getInput(
"notification")
431 $ilCtrl->getLinkTarget($this,
"showOverview")
437 $ilCtrl->getLinkTargetByClass(
"ilExAssignmentEditorGUI",
"listAssignments")
440 $ilTabs->activateSubTab($a_activate);
453 $ilHelp->setScreenIdComponent(
"exc");
456 $this->tabs_gui->addTab(
458 $lng->txt(
"exc_assignments"),
459 $this->ctrl->getLinkTarget($this,
"showOverview")
463 $next_class = strtolower($this->ctrl->getNextClass());
465 $this->tabs_gui->addTab(
467 $lng->txt(
"info_short"),
468 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
478 $this->tabs_gui->addTab(
480 $lng->txt(
"settings"),
481 $this->ctrl->getLinkTarget($this,
'edit')
484 if ($this->access->checkRbacOrPositionPermissionAccess(
485 'edit_submissions_grades',
486 'edit_submissions_grades',
487 $this->object->getRefId()
489 $this->tabs_gui->addTab(
491 $lng->txt(
"exc_submissions_and_grades"),
492 $this->ctrl->getLinkTargetByClass(
"ilexercisemanagementgui",
"members")
497 $save_sort_order =
$_GET[
"sort_order"];
498 $save_sort_by =
$_GET[
"sort_by"];
499 $save_offset =
$_GET[
"offset"];
502 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
504 $this->tabs_gui->addTab(
506 $lng->txt(
'learning_progress'),
507 $this->ctrl->getLinkTargetByClass(
array(
'ilobjexercisegui',
'illearningprogressgui'),
'')
511 $_GET[
"sort_order"] = $save_sort_order;
512 $_GET[
"sort_by"] = $save_sort_by;
513 $_GET[
"offset"] = $save_offset;
517 $this->tabs_gui->addTab(
520 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
527 $this->tabs_gui->addTab(
529 $lng->txt(
"perm_settings"),
530 $this->ctrl->getLinkTargetByClass(
array(get_class($this),
'ilpermissiongui'),
"perm")
542 $this->ctrl->setCmd(
"showSummary");
543 $this->ctrl->setCmdClass(
"ilinfoscreengui");
556 $ilTabs->activateTab(
"info");
562 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
565 $info->enablePrivateNotes();
569 $info->enableNewsEditing();
570 $info->setBlockProperty(
"news",
"settings",
true);
577 $info->addSection($this->lng->txt(
"exc_overview"));
578 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
582 foreach ($ass as $a) {
584 if ($a[
"mandatory"]) {
588 $info->addProperty(
$lng->txt(
"exc_assignments"), $cnt);
589 $info->addProperty(
$lng->txt(
"exc_mandatory"), $mcnt);
590 if ($this->
object->getPassMode() !=
"nr") {
592 $lng->txt(
"exc_pass_mode"),
593 $lng->txt(
"exc_msg_all_mandatory_ass")
597 $lng->txt(
"exc_pass_mode"),
598 sprintf(
$lng->txt(
"exc_msg_min_number_ass"), $this->
object->getPassNr())
603 include_once(
"Services/Tracking/classes/class.ilLPMarks.php");
608 $st = $this->
object->determinStatusOfUser(
$ilUser->getId());
609 $status = $st[
"overall_status"];
610 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded") {
611 $info->addSection($this->lng->txt(
"exc_feedback_from_tutor"));
612 if ($lpcomment !=
"") {
614 $this->lng->txt(
"exc_comment"),
620 $this->lng->txt(
"exc_mark"),
631 if ($status !=
"notgraded") {
633 ' alt="' .
$lng->txt(
"exc_" . $status) .
'" title="' .
$lng->txt(
"exc_" . $status) .
637 if ($st[
"failed_a_mandatory"]) {
638 $add =
" (" .
$lng->txt(
"exc_msg_failed_mandatory") .
")";
639 } elseif ($status ==
"failed") {
640 $add =
" (" .
$lng->txt(
"exc_msg_missed_minimum_number") .
")";
643 $this->lng->txt(
"status"),
644 $img .
" " . $this->lng->txt(
"exc_" . $status) . $add
651 $this->ctrl->forwardCommand(
$info);
657 $this->tabs_gui->activateSubTab(
"edit");
658 return parent::editObject();
663 $this->tabs_gui->addSubTab(
665 $this->lng->txt(
"general_settings"),
666 $this->ctrl->getLinkTarget($this,
"edit")
669 $this->tabs_gui->addSubTab(
671 $this->lng->txt(
"exc_criteria_catalogues"),
672 $this->ctrl->getLinkTargetByClass(
"ilexccriteriacataloguegui",
"")
675 include_once
"Services/Certificate/classes/class.ilCertificate.php";
677 $this->tabs_gui->addSubTab(
679 $this->lng->txt(
"certificate"),
680 $this->ctrl->getLinkTarget($this,
"certificate")
690 public static function _goto($a_target, $a_raw)
695 $lng = $DIC->language();
696 $ilAccess = $DIC->access();
700 $ilCtrl->setTargetScript(
"ilias.php");
701 $ilCtrl->initBaseClass(
"ilRepositoryGUI");
705 $ass_id =
$_GET[
'ass_id'];
706 $parts = explode(
"_", $a_raw);
711 switch (end($parts)) {
731 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"ref_id", $a_target);
733 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
734 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"target", $a_raw);
737 $ilCtrl->setParameterByClass(
"ilExerciseManagementGUI",
"ass_id", $ass_id);
742 $ilCtrl->redirectByClass(
array(
"ilRepositoryGUI",
"ilExerciseHandlerGUI",
"ilObjExerciseGUI",
"ilExerciseManagementGUI"),
"members");
751 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"member_id", $member);
752 $ilCtrl->redirectByClass(
array(
"ilRepositoryGUI",
"ilExerciseHandlerGUI",
"ilObjExerciseGUI",
"ilExerciseManagementGUI"),
"waitingDownload");
756 if ($parts[1] !=
"") {
757 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"ass_id", $parts[1]);
758 $ilCtrl->setParameterByClass(
"ilExerciseHandlerGUI",
"ass_id_goto", $parts[1]);
760 $ilCtrl->redirectByClass(
array(
"ilRepositoryGUI",
"ilExerciseHandlerGUI",
"ilObjExerciseGUI"),
"showOverview");
764 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
765 $ilCtrl->redirectByClass(
array(
"ilRepositoryGUI",
"ilExerciseHandlerGUI",
"ilObjExerciseGUI"),
"infoScreen");
766 } elseif ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
768 $lng->txt(
"msg_no_perm_read_item"),
782 if (is_object($this->
object)) {
784 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
"showOverview"),
"",
$_GET[
"ref_id"]);
805 $tpl->addJavaScript(
"./Modules/Exercise/js/ilExcPresentation.js");
807 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
810 $this->
object->getId(),
811 $this->
object->getRefId(),
815 $ilTabs->activateTab(
"content");
820 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
821 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
824 $ilToolbar->addButton(
825 $this->lng->txt(
"certificate"),
826 $this->ctrl->getLinkTarget($this,
"outCertificate")
831 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
834 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
835 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
837 $acc->setId(
"exc_ow_" . $this->
object->getId());
840 foreach ($ass_data as $ass) {
843 if (isset(
$_GET[
"ass_id_goto"]) &&
844 (int)
$_GET[
"ass_id_goto"] == $ass->getId()) {
849 $ass_gui->getOverviewHeader($ass),
850 $ass_gui->getOverviewBody($ass),
855 if (count($ass_data) < 2) {
856 $acc->setBehaviour(
"FirstOpen");
858 $acc->setUseSessionStorage(
true);
861 $mtpl =
new ilTemplate(
"tpl.exc_ass_overview.html",
true,
true,
"Modules/Exercise");
862 $mtpl->setVariable(
"CONTENT", $acc->getHTML());
864 $tpl->setContent($mtpl->get());
870 $this->tabs_gui->activateTab(
"settings");
871 $this->tabs_gui->activateSubTab(
"certificate");
873 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
874 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
876 $output_gui->certificateEditor();
888 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
889 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilExAssignmentEditorGUI.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor public.
This class represents an option in a radio group.
Class ilExcCriteriaCatalogueGUI.
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
static countMandatory($a_ex_id)
Order assignments by deadline date.
This class represents an option in a checkbox group.
static _isComplete($adapter)
Checks the status of the certificate.
GUI class for the workflow of copying objects.
updateCustom(ilPropertyFormGUI $a_form)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
static _lookupTitle($a_id)
lookup object title
getEditFormCustomValues(array &$a_values)
Get values for properties form.
setInfo($a_info)
Set Info.
static _goto($a_target, $a_raw)
redirect script
addContentSubTabs($a_activate)
Add subtabs of content view.
showOverviewObject()
Show overview of assignments.
static getInstance()
Get instance.
GUI class for exercise assignments.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
const TUTOR_FEEDBACK_FILE
const TUTOR_FEEDBACK_TEXT
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
prepareOutput($a_show_subobjects=true)
prepare output
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
getTabs()
adds tabs to tab gui object
const TUTOR_FEEDBACK_MAIL
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
static getInstancesByExercise($a_exc_id)
special template class to simplify handling of ITX/PEAR
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
GUI class to create PDF certificates.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
const TYPE_EXERCISE_SUBMISSION
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilExerciseManagementGUI.
afterSave(ilObject $a_new_object)
Create new PHPExcel object
obj_idprivate
const LP_CONTEXT_REPOSITORY
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
getRefId()
get reference id public
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.
static lookupExerciseId($a_ass_id)
Lookup excercise id for assignment id.
static _lookupMark($a_usr_id, $a_obj_id)
static _lookupComment($a_usr_id, $a_obj_id)
const ORGU_POSITION_ACCESS
initEditCustomForm(ilPropertyFormGUI $a_form)
Init properties form.
Accordion user interface class.
addHeaderAction()
Add header action menu.
infoScreen()
show information screen
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Exercise certificate adapter.
addLocatorItems()
Add locator item.
Exercise exceptions class.