5 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
29 function __construct($a_data,$a_id,$a_call_by_reference,$a_prepare_output =
true)
34 parent::__construct($a_data,$a_id,$a_call_by_reference,
false);
36 $lng->loadLanguageModule(
"exercise");
37 $lng->loadLanguageModule(
"exc");
38 $this->ctrl->saveParameter($this,
"ass_id");
40 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
45 else if ($_REQUEST[
"ass_id"] > 0)
47 include_once(
"./Modules/Exercise/exceptions/class.ilExerciseException.php");
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
63 case "ilinfoscreengui":
64 $ilTabs->activateTab(
"info");
68 case 'ilpermissiongui':
69 $ilTabs->activateTab(
"permissions");
70 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
72 $ret =& $this->ctrl->forwardCommand($perm_gui);
75 case "illearningprogressgui":
76 $ilTabs->activateTab(
"learning_progress");
77 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
81 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId());
82 $this->ctrl->forwardCommand($new_gui);
83 $this->tabs_gui->setTabActive(
'learning_progress');
86 case 'ilobjectcopygui':
87 $ilCtrl->saveParameter($this,
'new_type');
88 $ilCtrl->setReturnByClass(get_class($this),
'create');
90 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
93 $this->ctrl->forwardCommand($cp);
97 $ilTabs->activateTab(
"export");
98 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
100 $exp_gui->addFormat(
"xml");
101 $ret = $this->ctrl->forwardCommand($exp_gui);
105 case "ilcommonactiondispatchergui":
106 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
108 $this->ctrl->forwardCommand($gui);
111 case "ilcertificategui":
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";
118 $this->ctrl->forwardCommand($output_gui);
121 case "ilexassignmenteditorgui":
123 $ilTabs->activateTab(
"content");
125 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php");
127 $this->ctrl->forwardCommand($ass_gui);
130 case "ilexsubmissiongui":
132 $ilTabs->activateTab(
"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);
140 case "ilexercisemanagementgui":
142 $ilTabs->activateTab(
"grades");
143 include_once(
"./Modules/Exercise/classes/class.ilExerciseManagementGUI.php");
145 $this->ctrl->forwardCommand($mgmt_gui);
148 case "ilexccriteriacataloguegui":
150 $ilTabs->activateTab(
"settings");
152 $ilTabs->activateSubTab(
"crit");
153 include_once(
"./Modules/Exercise/classes/class.ilExcCriteriaCatalogueGUI.php");
155 $this->ctrl->forwardCommand($crit_gui);
185 $a_new_object->saveData();
189 $ilCtrl->setParameterByClass(
"ilExAssignmentEditorGUI",
"ref_id", $a_new_object->
getRefId());
190 $ilCtrl->redirectByClass(
"ilExAssignmentEditorGUI",
"addAssignment");
200 $ilCtrl->redirectByClass(
"ilExAssignmentEditorGUI",
"listAssignments");
208 $a_form->
setTitle($this->lng->txt(
"exc_edit_exercise"));
211 $section->setTitle($this->lng->txt(
'exc_passing_exc'));
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);
227 $ni->setMaxLength(4);
228 $ni->setRequired(
true);
229 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
231 $min = max($mand, 1);
232 $ni->setMinValue($min,
true);
233 $ni->setInfo($this->lng->txt(
"exc_min_nr_info"));
234 $op2->addSubItem($ni);
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);
252 $section->setTitle($this->lng->txt(
'exc_publishing'));
256 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"exc_show_submissions"),
"show_submissions");
257 $cb->
setInfo($this->lng->txt(
"exc_show_submissions_info"));
261 $section->setTitle($this->lng->txt(
'exc_notification'));
265 $cbox =
new ilCheckboxInputGUI($this->lng->txt(
"exc_submission_notification"),
"notification");
266 $cbox->
setInfo($this->lng->txt(
"exc_submission_notification_info"));
273 $section->setTitle($this->lng->txt(
'exc_feedback'));
280 $option->
setInfo($this->lng->txt(
"exc_settings_feedback_mail_info"));
281 $fdb->addOption($option);
283 $option->
setInfo($this->lng->txt(
"exc_settings_feedback_file_info"));
284 $fdb->addOption($option);
286 $option->
setInfo($this->lng->txt(
"exc_settings_feedback_text_info"));
287 $fdb->addOption($option);
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")
302 $a_values[
"pass_nr"] = $this->
object->getPassNr();
305 include_once
"./Services/Notification/classes/class.ilNotification.php";
308 $this->
object->getId());
310 $a_values[
'completion_by_submission'] = (int) $this->
object->isCompletionBySubmissionEnabled();
312 $tfeedback =
array();
313 if($this->
object->hasTutorFeedbackMail())
317 if($this->
object->hasTutorFeedbackText())
321 if($this->
object->hasTutorFeedbackFile())
325 $a_values[
'tfeedback'] = $tfeedback;
331 $this->
object->setShowSubmissions($a_form->
getInput(
"show_submissions"));
332 $this->
object->setPassMode($a_form->
getInput(
"pass_mode"));
333 if ($this->
object->getPassMode() ==
"nr")
335 $this->
object->setPassNr($a_form->
getInput(
"pass_nr"));
338 $this->
object->setCompletionBySubmission($a_form->
getInput(
'completion_by_submission') == 1 ? true :
false);
340 $feedback = $a_form->
getInput(
"tfeedback");
341 $this->
object->setTutorFeedback(is_array($feedback)
342 ? array_sum($feedback)
345 include_once
"./Services/Notification/classes/class.ilNotification.php";
347 $ilUser->getId(), $this->
object->getId(),
348 (bool)$a_form->
getInput(
"notification"));
360 $ilTabs->addSubTab(
"content", $lng->txt(
"view"),
361 $ilCtrl->getLinkTarget($this,
"showOverview"));
364 $ilTabs->addSubTab(
"list_assignments", $lng->txt(
"edit"),
365 $ilCtrl->getLinkTargetByClass(
"ilExAssignmentEditorGUI",
"listAssignments"));
367 $ilTabs->activateSubTab($a_activate);
377 global
$lng, $ilHelp;
379 $ilHelp->setScreenIdComponent(
"exc");
383 $this->tabs_gui->addTab(
"content",
384 $lng->txt(
"exc_assignments"),
385 $this->ctrl->getLinkTarget($this,
"showOverview"));
388 $next_class = strtolower($this->ctrl->getNextClass());
391 $this->tabs_gui->addTab(
"info",
392 $lng->txt(
"info_short"),
393 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
403 $this->tabs_gui->addTab(
"settings",
404 $lng->txt(
"settings"),
405 $this->ctrl->getLinkTarget($this,
'edit'));
407 $this->tabs_gui->addTab(
"grades",
408 $lng->txt(
"exc_submissions_and_grades"),
409 $this->ctrl->getLinkTargetByClass(
"ilexercisemanagementgui",
"members"));
413 $save_sort_order =
$_GET[
"sort_order"];
414 $save_sort_by =
$_GET[
"sort_by"];
415 $save_offset =
$_GET[
"offset"];
418 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
421 $this->tabs_gui->addTab(
'learning_progress',
422 $lng->txt(
'learning_progress'),
423 $this->ctrl->getLinkTargetByClass(
array(
'ilobjexercisegui',
'illearningprogressgui'),
''));
426 $_GET[
"sort_order"] = $save_sort_order;
427 $_GET[
"sort_by"] = $save_sort_by;
428 $_GET[
"offset"] = $save_offset;
433 $this->tabs_gui->addTab(
"export",
435 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
442 $this->tabs_gui->addTab(
'permissions',
443 $lng->txt(
"perm_settings"),
444 $this->ctrl->getLinkTargetByClass(
array(get_class($this),
'ilpermissiongui'),
"perm"));
455 $this->ctrl->setCmd(
"showSummary");
456 $this->ctrl->setCmdClass(
"ilinfoscreengui");
467 $ilTabs->activateTab(
"info");
471 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
474 $info->enablePrivateNotes();
479 $info->enableNewsEditing();
480 $info->setBlockProperty(
"news",
"settings",
true);
487 $info->addSection($this->lng->txt(
"exc_overview"));
488 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
500 $info->addProperty($lng->txt(
"exc_assignments"), $cnt);
501 $info->addProperty($lng->txt(
"exc_mandatory"), $mcnt);
502 if ($this->
object->getPassMode() !=
"nr")
504 $info->addProperty($lng->txt(
"exc_pass_mode"),
505 $lng->txt(
"exc_msg_all_mandatory_ass"));
509 $info->addProperty($lng->txt(
"exc_pass_mode"),
510 sprintf($lng->txt(
"exc_msg_min_number_ass"), $this->
object->getPassNr()));
514 include_once(
"Services/Tracking/classes/class.ilLPMarks.php");
520 $st = $this->
object->determinStatusOfUser($ilUser->getId());
521 $status = $st[
"overall_status"];
522 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded")
524 $info->addSection($this->lng->txt(
"exc_feedback_from_tutor"));
525 if ($lpcomment !=
"")
527 $info->addProperty($this->lng->txt(
"exc_comment"),
532 $info->addProperty($this->lng->txt(
"exc_mark"),
542 if ($status !=
"notgraded")
544 $img =
'<img src="'.ilUtil::getImagePath(
"scorm/".$status.
".svg").
'" '.
545 ' alt="'.$lng->txt(
"exc_".$status).
'" title="'.$lng->txt(
"exc_".$status).
549 if ($st[
"failed_a_mandatory"])
551 $add =
" (".$lng->txt(
"exc_msg_failed_mandatory").
")";
553 else if ($status ==
"failed")
555 $add =
" (".$lng->txt(
"exc_msg_missed_minimum_number").
")";
557 $info->addProperty($this->lng->txt(
"status"),
558 $img.
" ".$this->lng->txt(
"exc_".$status).$add);
564 $this->ctrl->forwardCommand(
$info);
570 $this->tabs_gui->activateSubTab(
"edit");
571 return parent::editObject();
576 $this->tabs_gui->addSubTab(
"edit",
577 $this->lng->txt(
"general_settings"),
578 $this->ctrl->getLinkTarget($this,
"edit"));
580 $this->tabs_gui->addSubTab(
"crit",
581 $this->lng->txt(
"exc_criteria_catalogues"),
582 $this->ctrl->getLinkTargetByClass(
"ilexccriteriacataloguegui",
""));
584 include_once
"Services/Certificate/classes/class.ilCertificate.php";
587 $this->tabs_gui->addSubTab(
"certificate",
588 $this->lng->txt(
"certificate"),
589 $this->ctrl->getLinkTarget($this,
"certificate"));
598 public static function _goto($a_target, $a_raw)
600 global
$lng, $ilAccess;
603 $parts = explode(
"_", $a_raw);
604 if(
sizeof($parts) == 2)
606 $ass_id = (int)$parts[1];
609 if ($ilAccess->checkAccess(
"read",
"", $a_target))
613 $_GET[
"ass_id_goto"] = $ass_id;
615 $_GET[
"ref_id"] = $a_target;
616 $_GET[
"cmd"] =
"showOverview";
617 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
618 include(
"ilias.php");
621 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
623 $_GET[
"ref_id"] = $a_target;
624 $_GET[
"cmd"] =
"infoScreen";
625 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
626 include(
"ilias.php");
629 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
644 if (is_object($this->
object))
647 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
"showOverview"),
"",
$_GET[
"ref_id"]);
665 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
667 $this->
object->getRefId(),
'exc');
669 $ilTabs->activateTab(
"content");
673 if($this->
object->hasUserCertificate($ilUser->getId()))
675 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
676 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
680 $ilToolbar->addButton($this->lng->txt(
"certificate"),
681 $this->ctrl->getLinkTarget($this,
"outCertificate"));
685 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
688 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
689 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
691 $acc->setId(
"exc_ow_".$this->
object->getId());
694 foreach ($ass_data as $ass)
698 if(isset(
$_GET[
"ass_id_goto"]) &&
699 (int)
$_GET[
"ass_id_goto"] == $ass->getId())
704 $acc->addItem($ass_gui->getOverviewHeader($ass),
705 $ass_gui->getOverviewBody($ass),
709 if (count($ass_data) < 2)
711 $acc->setBehaviour(
"FirstOpen");
715 $acc->setUseSessionStorage(
true);
718 $tpl->setContent($acc->getHTML());
724 $this->tabs_gui->activateTab(
"settings");
725 $this->tabs_gui->activateSubTab(
"certificate");
727 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
728 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
730 $output_gui->certificateEditor();
737 if($this->
object->hasUserCertificate($ilUser->getId()))
743 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
744 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.
Class ilObject Basic functions for all objects.
updateCustom(ilPropertyFormGUI $a_form)
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.
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
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
static getInstancesByExercise($a_exc_id)
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
GUI class to create PDF certificates.
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
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)
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.
Class to report exception.