ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjExerciseGUI Class Reference

Class ilObjExerciseGUI. More...

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

Public Member Functions

 ilObjExerciseGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor public.
 getFiles ()
 setFiles ($a_files)
executeCommand ()
 execute command
 createObject ($a_reload=false)
 initImportForm ($a_new_type="")
 Init object import form.
 importFileObject ()
 Import.
 viewObject ()
 list childs of current object
 downloadObject ()
 User downloads (own) submitted files.
 confirmDeleteDeliveredObject ()
 Confirm deletion of delivered files.
 deleteDeliveredObject ()
 Delete file(s) submitted by user.
 submissionScreenObject ()
 Displays a form which allows members to deliver their solutions.
 initUploadForm ()
 Init upload form form.
 initZipUploadForm ()
 Init upload form form.
 deliverFileObject ()
 Upload files.
 deliverUnzipObject ()
 Upload zip file.
 downloadFeedbackFileObject ()
 Download feedback file.
 downloadFileObject ()
 Download assignment file.
 saveObject ()
 save object public
 editObject ()
 Edit object.
 initPropertiesForm ($a_mode="create")
 Init properties form.
 getPropertiesValues ()
 Get values for properties form.
 updateObject ()
 Update exercise from values from form.
 cancelEditObject ()
 uploadZipObject ()
 uploadFileObject ()
 updateMembersObject ()
 update data of members table
 downloadReturnedObject ()
 Download submitted files of user.
 downloadNewReturnedObject ()
 Download newly submitted files of user.
 addMembersObject ()
 Add new partipant.
 membersObject ()
 All participants and submission of one assignment.
 selectAssignmentObject ()
 Select assignment.
 showParticipantObject ()
 Show Participant.
 selectParticipantObject ()
 Select participant.
 showGradesOverviewObject ()
 Show grades overview.
 redirectFeedbackMailObject ()
 set feedback status for member and redirect to mail screen
 downloadAllObject ()
 Download all submitted files (of all members).
 __getMembersOfObject ($a_result, $a_type)
 __showObjectSelect ($a_result, $a_type)
 sendMembersObject ()
 Send assignment per mail to participants.
 confirmDeassignMembersObject ()
 Confirm deassigning members.
 deassignMembersObject ()
 Deassign members from exercise.
 saveCommentsObject ()
 saveStatusParticipantObject ()
 Save assignment status (participant view)
 saveStatusObject ($a_part_view=false)
 Save status of selecte members.
 __getDateSelect ($a_type, $a_selected)
 __filterAssignedUsers ($a_result)
 addSubmissionSubTabs ($a_activate)
 adds tabs to tab gui object
 addContentSubTabs ($a_activate)
 Add subtabs of content view.
 getTabs ($tabs_gui)
 adds tabs to tab gui object
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed
 infoScreen ()
 show information screen
 _goto ($a_target)
 redirect script
 addLocatorItems ()
 Add locator item.
 listAssignmentsObject ()
 List assignments.
 addAssignmentObject ()
 Create assignment.
 initAssignmentForm ($a_mode="create")
 Init assignment form.
 saveAssignmentObject ()
 Save assignment.
 editAssignmentObject ()
 Edit assignment.
 getAssignmentValues ()
 Get current values for assignment from.
 updateAssignmentObject ()
 Update assignment.
 confirmAssignmentsDeletionObject ()
 Confirm assignments deletion.
 deleteAssignmentsObject ()
 Delete assignments.
 saveAssignmentOrderObject ()
 Save assignments order.
 orderAssignmentsByDeadlineObject ()
 Order by deadline.
 setAssignmentHeader ()
 Set assignment header.
 showOverviewObject ()
 Show overview of assignments.
 listPublicSubmissionsObject ()
 List all submissions.
 exportExcelObject ()
 Export as excel.
 saveGradesObject ()
 Save grades.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Protected Member Functions

 sendNotifications ($assignment_id)
 Send submission notifications.
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false

Detailed Description

Member Function Documentation

ilObjExerciseGUI::__filterAssignedUsers (   $a_result)

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

{
foreach($a_result as $user)
{
if(!$this->object->members_obj->isAssigned($user["id"]))
{
$filtered[] = $user;
}
}
return $filtered ? $filtered : array();
}
ilObjExerciseGUI::__getDateSelect (   $a_type,
  $a_selected 
)

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

References formSelect().

{
switch($a_type)
{
case "hour":
for($i=0; $i<24; $i++)
{
$hours[$i] = $i < 10 ? "0".$i : $i;
}
return ilUtil::formSelect($a_selected,"d_hour",$hours,false,true);
case "minutes":
for($i=0;$i<60;$i++)
{
$minutes[$i] = $i < 10 ? "0".$i : $i;
}
return ilUtil::formSelect($a_selected,"d_minutes",$minutes,false,true);
case "day":
for($i=1; $i<32; $i++)
{
$days[$i] = $i < 10 ? "0".$i : $i;
}
return ilUtil::formSelect($a_selected,"d_day",$days,false,true);
case "month":
for($i=1; $i<13; $i++)
{
$month[$i] = $i < 10 ? "0".$i : $i;
}
return ilUtil::formSelect($a_selected,"d_month",$month,false,true);
case "year":
for($i = date("Y",time());$i < date("Y",time()) + 3;++$i)
{
$year[$i] = $i;
}
return ilUtil::formSelect($a_selected,"d_year",$year,false,true);
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::__getMembersOfObject (   $a_result,
  $a_type 
)

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

References ilObjectFactory\getInstanceByRefId().

{
switch($a_type)
{
case "usr":
return $a_result;
case "grp":
include_once "./Modules/Group/classes/class.ilObjGroup.php";
$all_members = array();
foreach($a_result as $group)
{
$tmp_grp_obj = ilObjectFactory::getInstanceByRefId($group["id"]);
$members = $tmp_grp_obj->getGroupMemberIds();
$all_members = array_merge($all_members,$members);
}
// FORMAT ARRAY
$all_members = array_unique($all_members);
foreach($all_members as $member)
{
$result[] = array("id" => $member);
}
return $result;
}
return true;
}

+ Here is the call graph for this function:

ilObjExerciseGUI::__showObjectSelect (   $a_result,
  $a_type 
)

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

References ilObjectFactory\getInstanceByRefId().

{
include_once "./classes/class.ilObjectFactory.php";
foreach($a_result as $obj)
{
$tmp_obj =& ilObjectFactory::getInstanceByRefId($obj["id"]);
$this->tpl->setCurrentBlock("OBJ_SELECT_ROW");
$this->tpl->setVariable("OBJ_ROW_TITLE",$tmp_obj->getTitle());
$this->tpl->setVariable("OBJ_ROW_ID",$tmp_obj->getRefId());
$this->tpl->setVariable("OBJ_ROW_DESCRIPTION",$tmp_obj->getDescription());
$this->tpl->parseCurrentBlock();
unset($tmp_obj);
}
$this->tpl->setCurrentBlock("OBJ_SELECT");
$this->tpl->setVariable("OBJ_SELECT_TITLE",$this->lng->txt("title"));
$this->tpl->setVariable("OBJ_SELECT_DESCRIPTION",$this->lng->txt("description"));
$this->tpl->setVariable("OBJ_BTN1_VALUE",$this->lng->txt("select"));
$this->tpl->setVariable("OBJ_BTN2_VALUE",$this->lng->txt("cancel"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilObjExerciseGUI::_goto (   $a_target)

redirect script

Parameters
string$a_target

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

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

{
global $rbacsystem, $ilErr, $lng, $ilAccess;
if ($ilAccess->checkAccess("read", "", $a_target))
{
$_GET["ref_id"] = $a_target;
$_GET["cmd"] = "showOverview";
$_GET["baseClass"] = "ilExerciseHandlerGUI";
include("ilias.php");
}
else if ($ilAccess->checkAccess("visible", "", $a_target))
{
$_GET["ref_id"] = $a_target;
$_GET["cmd"] = "infoScreen";
$_GET["baseClass"] = "ilExerciseHandlerGUI";
include("ilias.php");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
include("repository.php");
}
$ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjExerciseGUI::addAssignmentObject ( )

Create assignment.

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

References ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), and initAssignmentForm().

{
global $tpl, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("content");
$this->addContentSubTabs("list_assignments");
$this->initAssignmentForm("create");
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjExerciseGUI::addContentSubTabs (   $a_activate)

Add subtabs of content view.

Parameters
object$tabs_guiilTabsGUI object

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

References $ilCtrl, and ilObjectGUI\$lng.

Referenced by addAssignmentObject(), confirmAssignmentsDeletionObject(), confirmDeleteDeliveredObject(), listAssignmentsObject(), listPublicSubmissionsObject(), saveAssignmentObject(), showOverviewObject(), submissionScreenObject(), and updateAssignmentObject().

{
global $ilTabs, $lng, $ilCtrl, $ilAccess;
$ilTabs->addSubTab("content", $lng->txt("view"),
$ilCtrl->getLinkTarget($this, "showOverview"));
if ($ilAccess->checkAccess("write", "", $this->ref_id))
{
$ilTabs->addSubTab("list_assignments", $lng->txt("edit"),
$ilCtrl->getLinkTarget($this, "listAssignments"));
}
$ilTabs->activateSubTab($a_activate);
}

+ Here is the caller graph for this function:

ilObjExerciseGUI::addLocatorItems ( )

Add locator item.

Reimplemented from ilObjectGUI.

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

References $_GET.

{
global $ilLocator;
if (is_object($this->object))
{
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
}
}
ilObjExerciseGUI::addMembersObject ( )

Add new partipant.

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

References $_POST, $ilErr, ilObjectGUI\checkPermission(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilAccess,$ilErr;
$this->checkPermission("write");
if(!count($_POST['user']))
{
ilUtil::sendFailure($this->lng->txt("no_checkbox"));
return false;
}
if(!$this->object->members_obj->assignMembers($_POST["user"]))
{
ilUtil::sendFailure($this->lng->txt("exc_members_already_assigned"));
return false;
}
else
{
ilUtil::sendSuccess($this->lng->txt("exc_members_assigned"),true);
}
//exit;
$this->ctrl->redirect($this, "members");
return false;
}

+ Here is the call graph for this function:

ilObjExerciseGUI::addSubmissionSubTabs (   $a_activate)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $ilCtrl, and ilObjectGUI\$lng.

Referenced by membersObject(), showGradesOverviewObject(), and showParticipantObject().

{
global $ilTabs, $lng, $ilCtrl;
$ilTabs->addSubTab("assignment", $lng->txt("exc_assignment_view"),
$ilCtrl->getLinkTarget($this, "members"));
$ilTabs->addSubTab("participant", $lng->txt("exc_participant_view"),
$ilCtrl->getLinkTarget($this, "showParticipant"));
$ilTabs->addSubTab("grades", $lng->txt("exc_grades_overview"),
$ilCtrl->getLinkTarget($this, "showGradesOverview"));
$ilTabs->activateSubTab($a_activate);
}

+ Here is the caller graph for this function:

ilObjExerciseGUI::cancelEditObject ( )

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

{
$this->ctrl->redirect($this, "view");
}
ilObjExerciseGUI::confirmAssignmentsDeletionObject ( )

Confirm assignments deletion.

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

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), ilExAssignment\lookupTitle(), and ilUtil\sendInfo().

{
global $ilCtrl, $tpl, $lng, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("content");
$this->addContentSubTabs("list_assignments");
if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "listAssignments");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("exc_conf_del_assignments"));
$cgui->setCancel($lng->txt("cancel"), "listAssignments");
$cgui->setConfirm($lng->txt("delete"), "deleteAssignments");
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
foreach ($_POST["id"] as $i)
{
$cgui->addItem("id[]", $i, ilExAssignment::lookupTitle($i));
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::confirmDeassignMembersObject ( )

Confirm deassigning members.

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

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilUserUtil\getNamePresentation(), and ilUtil\sendFailure().

{
global $ilCtrl, $tpl, $lng, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("grades");
if (!is_array($_POST["member"]) || count($_POST["member"]) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "members");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("exc_msg_sure_to_deassign_participant"));
$cgui->setCancel($lng->txt("cancel"), "members");
$cgui->setConfirm($lng->txt("remove"), "deassignMembers");
include_once("./Services/User/classes/class.ilUserUtil.php");
foreach ($_POST["member"] as $k => $m)
{
$cgui->addItem("member[$k]", $m,
ilUserUtil::getNamePresentation((int) $k, false, false, "", true));
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::confirmDeleteDeliveredObject ( )

Confirm deletion of delivered files.

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

References $_GET, $_POST, $f, $files, $ilCtrl, ilObjectGUI\$lng, $title, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), ilExAssignment\getDeliveredFiles(), and ilUtil\sendFailure().

{
global $ilCtrl, $tpl, $lng, $ilUser;
$this->checkPermission("read");
$this->tabs_gui->setTabActive("content");
$this->addContentSubTabs("content");
if (mktime() > $this->ass->getDeadline())
{
ilUtil::sendFailure($this->lng->txt("exercise_time_over"), true);
$ilCtrl->redirect($this, "submissionScreen");
}
if (!is_array($_POST["delivered"]) || count($_POST["delivered"]) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "submissionScreen");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("info_delete_sure"));
$cgui->setCancel($lng->txt("cancel"), "submissionScreen");
$cgui->setConfirm($lng->txt("delete"), "deleteDelivered");
$files = ilExAssignment::getDeliveredFiles($this->object->getId(), (int) $_GET["ass_id"],
$ilUser->getId());
//var_dump($files);
foreach ($_POST["delivered"] as $i)
{
reset ($files);
$title = "";
foreach ($files as $f)
{
if ($f["returned_id"] == $i)
{
$title = $f["filetitle"];
}
}
$cgui->addItem("delivered[]", $i, $title);
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::createObject (   $a_reload = false)

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

References ilObjectGUI\$tpl, ilObjectGUI\fillCloneTemplate(), ilObjectGUI\getTemplateFile(), initImportForm(), and initPropertiesForm().

{
global $tpl;
$this->getTemplateFile("edit", "exc");
if (!$a_reload)
{
$this->initPropertiesForm("create");
}
$this->tpl->setVariable("EDIT_FORM", $this->form_gui->getHtml());
$this->fillCloneTemplate('DUPLICATE','exc');
$this->initImportForm("exc");
$this->tpl->setVariable("IMPORT", $this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjExerciseGUI::deassignMembersObject ( )

Deassign members from exercise.

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

References $_POST, $ilCtrl, ilObjectGUI\$lng, $usr_id, ilObjectGUI\checkPermission(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

Referenced by updateMembersObject().

{
global $ilCtrl, $lng;
$this->checkPermission("write");
if(is_array($_POST["member"]))
{
foreach($_POST["member"] as $usr_id => $member)
{
$this->object->members_obj->deassignMember($usr_id);
}
ilUtil::sendSuccess($lng->txt("exc_msg_participants_removed"), true);
$ilCtrl->redirect($this, "members");
}
else
{
ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
$ilCtrl->redirect($this, "members");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::deleteAssignmentsObject ( )

Delete assignments.

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

References $_POST, $ilCtrl, $ilDB, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
global $ilDB, $ilCtrl, $lng;
$this->checkPermission("write");
$delete = false;
if (is_array($_POST["id"]))
{
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
foreach($_POST["id"] as $id)
{
$ass->delete();
$delete = true;
}
}
if ($delete)
{
ilUtil::sendSuccess($lng->txt("exc_assignments_deleted"), true);
}
$ilCtrl->redirect($this, "listAssignments");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::deleteDeliveredObject ( )

Delete file(s) submitted by user.

Parameters
@return

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

References $_GET, $_POST, $ilCtrl, ilObjectGUI\checkPermission(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilUser, $ilCtrl;
$this->checkPermission("read");
if (mktime() > $this->ass->getDeadline())
{
ilUtil::sendFailure($this->lng->txt("exercise_time_over"), true);
$ilCtrl->redirect($this, "submissionScreen");
}
if (count($_POST["delivered"]) && mktime() < $this->ass->getDeadline())
{
$this->object->deleteDeliveredFiles($this->object->getId(), (int) $_GET["ass_id"],
$_POST["delivered"], $ilUser->id);
ilUtil::sendSuccess($this->lng->txt("exc_submitted_files_deleted"), true);
}
else
{
ilUtil::sendFailure($this->lng->txt("please_select_a_delivered_file_to_delete"), true);
}
$ilCtrl->redirect($this, "submissionScreen");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::deliverFileObject ( )

Upload files.

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

References $_GET, $file, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), ilUtil\sendFailure(), and sendNotifications().

{
global $ilUser, $lng, $ilCtrl;
$this->checkPermission("read");
$success = false;
foreach ($_FILES["deliver"]["name"] as $k => $v)
{
$file = array(
"name" => $_FILES["deliver"]["name"][$k],
"type" => $_FILES["deliver"]["type"][$k],
"tmp_name" => $_FILES["deliver"]["tmp_name"][$k],
"error" => $_FILES["deliver"]["error"][$k],
"size" => $_FILES["deliver"]["size"][$k],
);
if(!$this->object->deliverFile($file, (int) $_GET["ass_id"], $ilUser->id))
{
ilUtil::sendFailure($this->lng->txt("exc_upload_error"), true);
}
else
{
$success = true;
}
}
if($success)
{
$this->sendNotifications((int)$_GET["ass_id"]);
}
$ilCtrl->redirect($this, "submissionScreen");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::deliverUnzipObject ( )

Upload zip file.

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

References $_GET, $ilCtrl, ilObjectGUI\checkPermission(), and sendNotifications().

{
global $ilCtrl;
$this->checkPermission("read");
if (preg_match("/zip/",$_FILES["deliver"]["type"]) == 1)
{
if($this->object->processUploadedFile($_FILES["deliver"]["tmp_name"], "deliverFile", false,
(int) $_GET["ass_id"]))
{
$this->sendNotifications((int)$_GET["ass_id"]);
}
}
$ilCtrl->redirect($this, "submissionScreen");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadAllObject ( )

Download all submitted files (of all members).

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

References $_GET, ilObject\_exists(), ilObjectGUI\checkPermission(), ilExAssignment\downloadAllDeliveredFiles(), exit, ilObjectFactory\getInstanceByObjId(), and ilExAssignment\updateTutorDownloadTime().

{
$this->checkPermission("write");
$members = array();
foreach($this->object->members_obj->getMembers() as $member_id)
{
// update download time
(int) $_GET["ass_id"], $member_id);
// get member object (ilObjUser)
if (ilObject::_exists($member_id))
{
$tmp_obj =& ilObjectFactory::getInstanceByObjId($member_id);
$members[$member_id] = $tmp_obj->getFirstname() . " " . $tmp_obj->getLastname();
unset($tmp_obj);
}
}
(int) $_GET["ass_id"], $members);
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadFeedbackFileObject ( )

Download feedback file.

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

References $_GET, $_POST, $file, $files, ilObjectGUI\checkPermission(), ilUtil\deliverFile(), exit, and ilUtil\sendFailure().

{
global $rbacsystem, $ilUser;
$file = ($_POST["file"])
? $_POST["file"]
: $_GET["file"];
// check read permission
$this->checkPermission("read");
if (!isset($file))
{
ilUtil::sendFailure($this->lng->txt("exc_select_one_file"),true);
$this->ctrl->redirect($this, "view");
}
// check, whether file belongs to assignment
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->object->getId(), (int) $_GET["ass_id"]);
$files = $storage->getFeedbackFiles($ilUser->getId());
$file_exist = false;
foreach($files as $fb_file)
{
if($fb_file == urldecode($file))
{
$file_exist = true;
break;
}
}
if(!$file_exist)
{
echo "FILE DOES NOT EXIST";
}
// check whether assignment as already started
$ass = new ilExAssignment((int) $_GET["ass_id"]);
$not_started_yet = false;
if ($ass->getStartTime() > 0 && time() - $ass->getStartTime() <= 0)
{
$not_started_yet = true;
}
// deliver file
if (!$not_started_yet)
{
$p = $storage->getFeedbackFilePath($ilUser->getId(), urldecode($file));
ilUtil::deliverFile($p, urldecode($file));
}
return true;
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadFileObject ( )

Download assignment file.

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

References $_GET, $_POST, $file, $files, ilObjectGUI\checkPermission(), ilUtil\deliverFile(), exit, getFiles(), and ilUtil\sendFailure().

{
global $rbacsystem;
$file = ($_POST["file"])
? $_POST["file"]
: $_GET["file"];
// check read permission
$this->checkPermission("read");
if (!isset($file))
{
ilUtil::sendFailure($this->lng->txt("exc_select_one_file"),true);
$this->ctrl->redirect($this, "view");
}
// check, whether file belongs to assignment
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$files = ilExAssignment::getFiles($this->object->getId(), (int) $_GET["ass_id"]);
$file_exist = false;
foreach($files as $lfile)
{
if($lfile["name"] == urldecode($file))
{
$file_exist = true;
break;
}
}
if(!$file_exist)
{
echo "FILE DOES NOT EXIST";
}
// check whether assignment as already started
$ass = new ilExAssignment((int) $_GET["ass_id"]);
$not_started_yet = false;
if ($ass->getStartTime() > 0 && time() - $ass->getStartTime() <= 0)
{
$not_started_yet = true;
}
// deliver file
if (!$not_started_yet)
{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->object->getId(), (int) $_GET["ass_id"]);
$p = $storage->getAssignmentFilePath(urldecode($file));
ilUtil::deliverFile($p, urldecode($file));
}
return true;
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadNewReturnedObject ( )

Download newly submitted files of user.

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

References $_GET, ilObjectGUI\checkPermission(), ilExAssignment\deliverReturnedFiles(), and exit.

{
$this->checkPermission("write");
$this->object->getId(), (int) $_GET["ass_id"], (int) $_GET["member_id"], true))
{
$this->ctrl->redirect($this, "members");
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadObject ( )

User downloads (own) submitted files.

Parameters
@return

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

References $_GET, $_POST, $ilCtrl, ilObjectGUI\checkPermission(), ilExAssignment\downloadSelectedFiles(), exit, and ilUtil\sendFailure().

{
global $ilUser, $ilCtrl;
$this->checkPermission("read");
if (count($_POST["delivered"]))
{
ilExAssignment::downloadSelectedFiles($this->object->getId(), (int) $_GET["ass_id"],
$ilUser->getId(), $_POST["delivered"]);
}
else
{
ilUtil::sendFailure($this->lng->txt("please_select_a_delivered_file_to_download"), true);
$ilCtrl->redirect($this, "deliver");
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadReturnedObject ( )

Download submitted files of user.

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

References $_GET, ilObjectGUI\checkPermission(), ilExAssignment\deliverReturnedFiles(), and exit.

{
global $ilAccess;
if ($ilAccess->checkAccess("read", "", $this->object->getRefId()) &&
$this->object->getShowSubmissions() &&
$this->object->getTimestamp() - time() <= 0)
{
// ok: read access + public submissions
}
else
{
$this->checkPermission("write");
}
$this->object->getId(), (int) $_GET["ass_id"], (int) $_GET["member_id"]))
{
$this->ctrl->redirect($this, "members");
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::editAssignmentObject ( )

Edit assignment.

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

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), getAssignmentValues(), initAssignmentForm(), and setAssignmentHeader().

{
global $tpl, $ilTabs, $tpl;
$this->checkPermission("write");
$ilTabs->activateTab("ass_settings");
$this->initAssignmentForm("edit");
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjExerciseGUI::editObject ( )

Edit object.

Reimplemented from ilObjectGUI.

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

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), getPropertiesValues(), ilObjectGUI\getTemplateFile(), and initPropertiesForm().

{
global $rbacsystem, $tpl, $ilTabs;
$ilTabs->activateTab("settings");
$this->checkPermission("write");
$this->getTemplateFile("edit", "exc");
$this->initPropertiesForm("edit");
$this->tpl->setVariable("EDIT_FORM", $this->form_gui->getHtml());
/* $this->tpl->setCurrentBlock("FILES");
$this->tpl->setVariable("TXT_HEADER_FILE",$this->lng->txt("file_add"));
$this->tpl->setVariable("TXT_FILE",$this->lng->txt("file"));
$this->tpl->setVariable("TXT_UPLOAD",$this->lng->txt("upload"));
$this->tpl->setVariable("FORMACTION_FILE", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_HEADER_ZIP", $this->lng->txt("header_zip"));
$this->tpl->setVariable("CMD_FILE_SUBMIT","uploadFile");
$this->tpl->parseCurrentBlock();*/
}

+ Here is the call graph for this function:

& ilObjExerciseGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

References $_GET, $cmd, $ilCtrl, ilObjectGUI\$lng, $ret, ilObjectGUI\checkPermission(), ilUserUtil\getNamePresentation(), infoScreen(), ilExAssignment\lookupTitle(), LP_MODE_REPOSITORY, ilObjectGUI\prepareOutput(), setAssignmentHeader(), and ilFileSystemGUI\setTableId().

{
global $ilUser,$ilCtrl, $ilTabs, $lng;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
//echo "-".$next_class."-".$cmd."-"; exit;
switch($next_class)
{
case "ilfilesystemgui":
$this->checkPermission("write");
if ($_GET["fsmode"] == "feedback" ||
$_GET["fsmode"] == "feedbackpart") // feedback files
{
$ilCtrl->saveParameter($this, array("member_id"));
//$this->setAssignmentHeader();
//$ilTabs->activateTab("ass_files");
$ilTabs->clearTargets();
if ($_GET["fsmode"] != "feedbackpart")
{
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "members"));
}
else
{
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "showParticipant"));
}
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$fstorage = new ilFSStorageExercise($this->object->getId(), (int) $_GET["ass_id"]);
$fstorage->create();
include_once("./classes/class.ilFileSystemGUI.php");
$fs_gui = new ilFileSystemGUI($fstorage->getFeedbackPath((int) $_GET["member_id"]));
$fs_gui->setTableId("excfbfil".(int)$_GET["ass_id"]."_".(int)$_GET["member_id"]);
$fs_gui->setAllowDirectories(false);
include_once("./Services/User/classes/class.ilUserUtil.php");
$fs_gui->setTitle($lng->txt("exc_fb_files")." - ".
ilExAssignment::lookupTitle((int) $_GET["ass_id"])." - ".
ilUserUtil::getNamePresentation((int) $_GET["member_id"], false, false, "", true));
$pcommand = $fs_gui->getLastPerformedCommand();
if ($pcommand["cmd"] == "create_file")
{
$this->object->sendFeedbackFileNotification($pcommand["name"], (int) $_GET["member_id"],
(int) $_GET["ass_id"]);
}
$ret = $this->ctrl->forwardCommand($fs_gui);
}
else // assignment files
{
$ilTabs->activateTab("ass_files");
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$fstorage = new ilFSStorageExercise($this->object->getId(), (int) $_GET["ass_id"]);
$fstorage->create();
include_once("./classes/class.ilFileSystemGUI.php");
$fs_gui = new ilFileSystemGUI($fstorage->getPath());
$fs_gui->setTableId("excassfil".$_GET["ass_id"]);
$fs_gui->setAllowDirectories(false);
$ret = $this->ctrl->forwardCommand($fs_gui);
}
break;
case "ilinfoscreengui":
$ilTabs->activateTab("info");
$this->infoScreen(); // forwards command
break;
case 'ilpermissiongui':
$ilTabs->activateTab("permissions");
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case "illearningprogressgui":
$ilTabs->activateTab("learning_progress");
include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
$this->object->getRefId(),
$_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
$this->ctrl->forwardCommand($new_gui);
$this->tabs_gui->setTabActive('learning_progress');
break;
case 'ilrepositorysearchgui':
$ilTabs->activateTab("grades");
include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
$rep_search =& new ilRepositorySearchGUI();
$rep_search->setCallback($this,'addMembersObject');
// Set tabs
$this->tabs_gui->setTabActive('members');
$this->ctrl->setReturn($this,'members');
$ret =& $this->ctrl->forwardCommand($rep_search);
#$this->__setSubTabs('members');
#$this->tabs_gui->setSubTabActive('members');
break;
case 'ilobjectcopygui':
$ilCtrl->saveParameter($this, 'new_type');
$ilCtrl->setReturnByClass(get_class($this),'create');
include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
$cp = new ilObjectCopyGUI($this);
$cp->setType('exc');
$this->ctrl->forwardCommand($cp);
break;
case "ilexportgui":
// $this->prepareOutput();
$ilTabs->activateTab("export");
include_once("./Services/Export/classes/class.ilExportGUI.php");
$exp_gui = new ilExportGUI($this);
$exp_gui->addFormat("xml");
$ret = $this->ctrl->forwardCommand($exp_gui);
// $this->tpl->show();
break;
default:
if(!$cmd)
{
$cmd = "infoScreen";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjExerciseGUI::exportExcelObject ( )

Export as excel.

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

References ilObjectGUI\checkPermission(), and exit.

{
$this->checkPermission("write");
$this->object->exportGradesExcel();
}

+ Here is the call graph for this function:

ilObjExerciseGUI::getAssignmentValues ( )

Get current values for assignment from.

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

References $_GET, IL_CAL_UNIX, and ilDateTime\setDate().

Referenced by editAssignmentObject().

{
$values = array();
$ass = new ilExAssignment($_GET["ass_id"]);
$values["title"] = $ass->getTitle();
if ($ass->getStartTime() > 0)
{
$values["start_time_cb"] = true;
}
$values["mandatory"] = $ass->getMandatory();
$values["instruction"] = $ass->getInstruction();
$this->form->setValuesByArray($values);
$edit_date = new ilDateTime($ass->getDeadline(), IL_CAL_UNIX);
$ed_item = $this->form->getItemByPostVar("deadline");
$ed_item->setDate($edit_date);
if ($ass->getStartTime() > 0)
{
$edit_date = new ilDateTime($ass->getStartTime(), IL_CAL_UNIX);
$ed_item = $this->form->getItemByPostVar("start_time");
$ed_item->setDate($edit_date);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::getFiles ( )

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

Referenced by downloadFileObject().

{
return $this->files ? $this->files : array();
}

+ Here is the caller graph for this function:

ilObjExerciseGUI::getPropertiesValues ( )

Get values for properties form.

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

References ilNotification\hasNotification(), and ilNotification\TYPE_EXERCISE_SUBMISSION.

Referenced by editObject().

{
global $ilUser;
$values["title"] = $this->object->getTitle();
$values["desc"] = $this->object->getLongDescription();
$values["pass_mode"] = $this->object->getPassMode();
$values["show_submissions"] = $this->object->getShowSubmissions();
if ($this->object->getPassMode() == "nr")
{
$values["pass_nr"] = $this->object->getPassNr();
}
// $values["instruction"] = $this->object->getInstruction();
include_once "./Services/Notification/classes/class.ilNotification.php";
$values["notification"] = ilNotification::hasNotification(ilNotification::TYPE_EXERCISE_SUBMISSION, $ilUser->getId(), $this->object->getId());
$this->form_gui->setValuesByArray($values);
//echo "-".$this->object->getTimestamp()."-";
/* $edit_date = new ilDateTime($this->object->getTimestamp(), IL_CAL_UNIX);
$ed_item = $this->form_gui->getItemByPostVar("edit_date");
$ed_item->setDate($edit_date);*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::getTabs (   $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

{
global $ilAccess, $ilUser, $lng;
if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
{
$tabs_gui->addTab("content",
$lng->txt("exc_assignments"),
$this->ctrl->getLinkTarget($this, "showOverview"));
}
$next_class = strtolower($this->ctrl->getNextClass());
if ($ilAccess->checkAccess("visible", "", $this->object->getRefId()))
{
$tabs_gui->addTab("info",
$lng->txt("info_short"),
$this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
}
// edit properties
if ($ilAccess->checkAccess("write", "", $this->ref_id))
{
/*$tabs_gui->addTab("assignments",
$lng->txt("exc_edit_assignments"),
$this->ctrl->getLinkTarget($this, 'listAssignments'));*/
$tabs_gui->addTab("settings",
$lng->txt("settings"),
$this->ctrl->getLinkTarget($this, 'edit'));
$tabs_gui->addTab("grades",
$lng->txt("exc_submissions_and_grades"),
$this->ctrl->getLinkTarget($this, 'members'));
}
// learning progress
$save_sort_order = $_GET["sort_order"]; // hack, because exercise sort parameters
$save_sort_by = $_GET["sort_by"]; // must not be forwarded to learning progress
$save_offset = $_GET["offset"];
$_GET["offset"] = $_GET["sort_by"] = $_GET["sort_order"] = "";
include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
{
$tabs_gui->addTab('learning_progress',
$lng->txt('learning_progress'),
$this->ctrl->getLinkTargetByClass(array('ilobjexercisegui','illearningprogressgui'),''));
}
$_GET["sort_order"] = $save_sort_order; // hack, part ii
$_GET["sort_by"] = $save_sort_by;
$_GET["offset"] = $save_offset;
// export
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$tabs_gui->addTab("export",
$lng->txt("export"),
$this->ctrl->getLinkTargetByClass("ilexportgui", ""));
}
// permissions
if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id))
{
$tabs_gui->addTab('permissions',
$lng->txt("perm_settings"),
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
}
}

+ Here is the call graph for this function:

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

Constructor public.

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

References $_GET, ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

{
global $lng;
$this->type = "exc";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
$lng->loadLanguageModule("exercise");
$lng->loadLanguageModule("exc");
$this->ctrl->saveParameter($this,
array("ass_id", "part_id", "fsmode"));
if ($_GET["ass_id"] > 0)
{
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$this->ass = new ilExAssignment((int) $_GET["ass_id"]);
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::importFileObject ( )

Import.

public

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

References $_GET, $_POST, ilObjectGUI\$lng, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, ilObjectFactory\getInstanceByObjId(), initImportForm(), and ilUtil\sendSuccess().

{
global $rbacsystem, $objDefinition, $tpl, $lng;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
// create permission is already checked in createObject. This check here is done to prevent hacking attempts
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
{
$this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
}
$this->ctrl->setParameter($this, "new_type", $new_type);
$this->initImportForm($new_type);
if ($this->form->checkInput())
{
// todo: make some check on manifest file
include_once("./Services/Export/classes/class.ilImport.php");
$imp = new ilImport((int) $_GET['ref_id']);
$new_id = $imp->importObject($newObj, $_FILES["importfile"]["tmp_name"],
$_FILES["importfile"]["name"], $new_type);
// put new object id into tree
if ($new_id > 0)
{
$newObj->createReference();
$newObj->putInTree($_GET["ref_id"]);
$newObj->setPermissions($_GET["ref_id"]);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
//$this->afterSave($newObj);
$this->ctrl->returnToParent($this);
}
return;
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObjExerciseGUI::infoScreen ( )

show information screen

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

References $_GET, $img, ilObjectGUI\$lng, ilLPMarks\_lookupComment(), ilLPMarks\_lookupMark(), ilObjectGUI\checkPermission(), and ilExAssignment\getAssignmentDataOfExercise().

Referenced by executeCommand(), and infoScreenObject().

{
global $ilAccess, $ilUser, $ilTabs, $lng;
$ilTabs->activateTab("info");
$this->checkPermission("visible");
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
$info->enableNews();
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
$info->enableNewsEditing();
$info->setBlockProperty("news", "settings", true);
}
// standard meta data
//$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
// instructions
$info->addSection($this->lng->txt("exc_overview"));
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$ass = ilExAssignment::getAssignmentDataOfExercise($this->object->getId());
$cnt = 0;
$mcnt = 0;
foreach ($ass as $a)
{
$cnt++;
if ($a["mandatory"])
{
$mcnt++;
}
}
$info->addProperty($lng->txt("exc_assignments"), $cnt);
$info->addProperty($lng->txt("exc_mandatory"), $mcnt);
if ($this->object->getPassMode() != "nr")
{
$info->addProperty($lng->txt("exc_pass_mode"),
$lng->txt("exc_msg_all_mandatory_ass"));
}
else
{
$info->addProperty($lng->txt("exc_pass_mode"),
sprintf($lng->txt("exc_msg_min_number_ass"), $this->object->getPassNr()));
}
// feedback from tutor
include_once("Services/Tracking/classes/class.ilLPMarks.php");
if ($ilAccess->checkAccess("read", "", $this->ref_id))
{
$lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
$mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
//$status = ilExerciseMembers::_lookupStatus($this->object->getId(), $ilUser->getId());
$st = $this->object->determinStatusOfUser($ilUser->getId());
$status = $st["overall_status"];
if ($lpcomment != "" || $mark != "" || $status != "notgraded")
{
$info->addSection($this->lng->txt("exc_feedback_from_tutor"));
if ($lpcomment != "")
{
$info->addProperty($this->lng->txt("exc_comment"),
$lpcomment);
}
if ($mark != "")
{
$info->addProperty($this->lng->txt("exc_mark"),
$mark);
}
//if ($status == "")
//{
// $info->addProperty($this->lng->txt("status"),
// $this->lng->txt("message_no_delivered_files"));
//}
//else
if ($status != "notgraded")
{
$img = '<img border="0" src="'.ilUtil::getImagePath("scorm/".$status.".gif").'" '.
' alt="'.$lng->txt("exc_".$status).'" title="'.$lng->txt("exc_".$status).
'" style="vertical-align:middle;"/>';
$add = "";
if ($st["failed_a_mandatory"])
{
$add = " (".$lng->txt("exc_msg_failed_mandatory").")";
}
else if ($status == "failed")
{
$add = " (".$lng->txt("exc_msg_missed_minimum_number").")";
}
$info->addProperty($this->lng->txt("status"),
$img." ".$this->lng->txt("exc_".$status).$add);
}
}
}
// forward the command
$this->ctrl->forwardCommand($info);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

References infoScreen().

Referenced by viewObject().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
$this->infoScreen();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::initAssignmentForm (   $a_mode = "create")

Init assignment form.

Parameters
int$a_mode"create"/"edit"

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

References $files, $ilCtrl, ilObjectGUI\$lng, ilFormPropertyGUI\setInfo(), ilTextInputGUI\setMaxLength(), ilTextAreaInputGUI\setRows(), and ilDateTimeInputGUI\setShowTime().

Referenced by addAssignmentObject(), editAssignmentObject(), saveAssignmentObject(), and updateAssignmentObject().

{
global $lng, $ilCtrl;
// init form
$lng->loadLanguageModule("form");
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setTableWidth("600px");
if ($a_mode == "edit")
{
$this->form->setTitle($lng->txt("exc_edit_assignment"));
}
else
{
$this->form->setTitle($lng->txt("exc_new_assignment"));
}
$this->form->setFormAction($ilCtrl->getFormAction($this));
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setMaxLength(200);
$ti->setRequired(true);
$this->form->addItem($ti);
// start time y/n
$cb = new ilCheckboxInputGUI($this->lng->txt("exc_start_time"), "start_time_cb");
$this->form->addItem($cb);
// start time
$edit_date = new ilDateTimeInputGUI("", "start_time");
$edit_date->setShowTime(true);
$cb->addSubItem($edit_date);
// Deadline
$edit_date = new ilDateTimeInputGUI($lng->txt("exc_deadline"), "deadline");
$edit_date->setShowTime(true);
$edit_date->setRequired(true);
$this->form->addItem($edit_date);
// mandatory
$cb = new ilCheckboxInputGUI($this->lng->txt("exc_mandatory"), "mandatory");
$cb->setInfo($this->lng->txt("exc_mandatory_info"));
$cb->setChecked(true);
$this->form->addItem($cb);
// Work Instructions
$desc_input = new ilTextAreaInputGUI($lng->txt("exc_instruction"), "instruction");
$desc_input->setRows(5);
$this->form->addItem($desc_input);
// files
if ($a_mode == "create")
{
$files = new ilFileWizardInputGUI($this->lng->txt('objs_file'),'files');
$files->setFilenames(array(0 => ''));
$this->form->addItem($files);
}
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("saveAssignment", $lng->txt("save"));
$this->form->addCommandButton("listAssignments", $lng->txt("cancel"));
}
else
{
$this->form->addCommandButton("updateAssignment", $lng->txt("save"));
$this->form->addCommandButton("listAssignments", $lng->txt("cancel"));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::initImportForm (   $a_new_type = "")

Init object import form.

Parameters
stringnew type

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

References $ilCtrl, ilObjectGUI\$lng, and ilFileInputGUI\setSuffixes().

Referenced by createObject(), and importFileObject().

{
global $lng, $ilCtrl;
$lng->loadLanguageModule("exc");
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setTarget("_top");
// Import file
include_once("./Services/Form/classes/class.ilFileInputGUI.php");
$fi = new ilFileInputGUI($lng->txt("import_file"), "importfile");
$fi->setSuffixes(array("zip"));
$fi->setRequired(true);
$this->form->addItem($fi);
$this->form->addCommandButton("importFile", $lng->txt("import"));
$this->form->addCommandButton("cancel", $lng->txt("cancel"));
$this->form->setTitle($lng->txt($a_new_type."_import"));
$ilCtrl->setParameter($this, "new_type", $a_new_type);
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::initPropertiesForm (   $a_mode = "create")

Init properties form.

Parameters
int$a_mode"create"/"edit"

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

References $ilCtrl, ilObjectGUI\$lng, ilExAssignment\countMandatory(), ilUtil\getImagePath(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilNumberInputGUI\setSize(), and ilRadioGroupInputGUI\setValue().

Referenced by createObject(), editObject(), saveObject(), and updateObject().

{
global $lng, $ilCtrl;
// init form
$lng->loadLanguageModule("form");
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTableWidth("600px");
if ($a_mode == "edit")
{
$this->form_gui->setTitle($lng->txt("exc_edit_exercise"));
}
else
{
$this->form_gui->setTitle($lng->txt("exc_new"));
}
$this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_exc.gif"));
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
// on creation: Type
if ($a_mode == "create")
{
$type_input = new ilHiddenInputGUI("new_type");
$type_input->setValue("exc");
$this->form_gui->addItem($type_input);
}
// Title
$title_input = new ilTextInputGUI($lng->txt("title"), "title");
$title_input->setRequired(true);
$title_input->setMaxLength(128);
$this->form_gui->addItem($title_input);
// Description
$desc_input = new ilTextAreaInputGUI($lng->txt("desc"), "desc");
$this->form_gui->addItem($desc_input);
/* // Work Instructions
$desc_input = new ilTextAreaInputGUI($lng->txt("exc_instruction"), "instruction");
$this->form_gui->addItem($desc_input);
// Edit until...
$edit_date = new ilDateTimeInputGUI($lng->txt("exc_edit_until"), "edit_date");
//$dt_prop->setDate(new ilDateTime("2006-12-24 15:44:00", IL_CAL_DATETIME);
$edit_date->setShowTime(true);
//$dt_prop->setInfo("Info text for the start date.");
$this->form_gui->addItem($edit_date);*/
// files
if ($a_mode == "edit")
{
// show submissions
$cb = new ilCheckboxInputGUI($this->lng->txt("exc_show_submissions"), "show_submissions");
$cb->setInfo($this->lng->txt("exc_show_submissions_info"));
$this->form_gui->addItem($cb);
// pass mode
$radg = new ilRadioGroupInputGUI($lng->txt("exc_pass_mode"), "pass_mode");
$radg->setValue("all");
$op1 = new ilRadioOption($lng->txt("exc_pass_all"), "all",
$lng->txt("exc_pass_all_info"));
$radg->addOption($op1);
$op2 = new ilRadioOption($lng->txt("exc_pass_minimum_nr"), "nr",
$lng->txt("exc_pass_minimum_nr_info"));
$radg->addOption($op2);
// minimum number of assignments to pass
$ni = new ilNumberInputGUI($lng->txt("exc_min_nr"), "pass_nr");
$ni->setSize(4);
$ni->setMaxLength(4);
$ni->setRequired(true);
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$mand = ilExAssignment::countMandatory($this->object->getId());
$min = max($mand, 1);
$ni->setMinValue($min);
$op2->addSubItem($ni);
$this->form_gui->addItem($radg);
$cbox = new ilCheckboxInputGUI($lng->txt("exc_submission_notification"), "notification");
$cbox->setInfo($lng->txt("exc_submission_notification_info"));
$this->form_gui->addItem($cbox);
/* if(count($files = $this->object->getFiles()))
{
// Files section header
$files_head = new ilFormSectionHeaderGUI();
$files_head->setTitle($lng->txt("files"));
$this->form_gui->addItem($files_head);
foreach($files as $file)
{
$i++;
$file_cb = new ilCheckboxInputGUI($this->lng->txt("exc_ask_delete"),
"delete_file_".$i);
$file_cb->setOptionTitle($file["name"]);
$file_cb->setValue($file["name"]);
$this->form_gui->addItem($file_cb);
}
}
*/
}
// save and cancel commands
if ($a_mode == "create")
{
$this->form_gui->addCommandButton("save", $lng->txt("save"));
$this->form_gui->addCommandButton("cancel", $lng->txt("cancel"));
}
else
{
$this->form_gui->addCommandButton("update", $lng->txt("save"));
$this->form_gui->addCommandButton("cancelEdit", $lng->txt("cancel"));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::initUploadForm ( )

Init upload form form.

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

References $ilCtrl, ilObjectGUI\$lng, and ilFileWizardInputGUI\setFilenames().

Referenced by submissionScreenObject().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// file input
include_once("./Services/Form/classes/class.ilFileWizardInputGUI.php");
$fi = new ilFileWizardInputGUI($lng->txt("file"), "deliver");
$fi->setFilenames(array(0 => ''));
//$fi->setInfo($lng->txt(""));
$this->form->addItem($fi);
$this->form->addCommandButton("deliverFile", $lng->txt("upload"));
$this->form->setTitle($lng->txt("file_add"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::initZipUploadForm ( )

Init upload form form.

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

References $ilCtrl, ilObjectGUI\$lng, and ilFileInputGUI\setSuffixes().

Referenced by submissionScreenObject().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// desc
include_once("./Services/Form/classes/class.ilFileInputGUI.php");
$fi = new ilFileInputGUI($lng->txt("file"), "deliver");
$fi->setSuffixes(array("zip"));
$this->form->addItem($fi);
$this->form->addCommandButton("deliverUnzip", $lng->txt("upload"));
$this->form->setTitle($lng->txt("header_zip"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::listAssignmentsObject ( )

List assignments.

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

References $ilCtrl, ilObjectGUI\$lng, $t, ilObjectGUI\$tpl, addContentSubTabs(), and ilObjectGUI\checkPermission().

{
global $tpl, $ilTabs, $ilToolbar, $lng, $ilCtrl;
$this->checkPermission("write");
$ilTabs->activateTab("content");
$this->addContentSubTabs("list_assignments");
$ilToolbar->addButton($lng->txt("exc_add_assignment"),
$ilCtrl->getLinkTarget($this, "addAssignment"));
include_once("./Modules/Exercise/classes/class.ilAssignmentsTableGUI.php");
$t = new ilAssignmentsTableGUI($this, "listAssignments", $this->object);
$tpl->setContent($t->getHTML());
}

+ Here is the call graph for this function:

ilObjExerciseGUI::listPublicSubmissionsObject ( )

List all submissions.

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

References $_GET, $tab, ilObjectGUI\$tpl, addContentSubTabs(), and ilObjectGUI\checkPermission().

{
global $tpl, $ilTabs;
$this->checkPermission("read");
$ilTabs->activateTab("content");
$this->addContentSubTabs("content");
include_once("./Modules/Exercise/classes/class.ilPublicSubmissionsTableGUI.php");
$tab = new ilPublicSubmissionsTableGUI($this, "listPublicSubmissions",
$this->object, (int) $_GET["ass_id"]);
$tpl->setContent($tab->getHTML());
}

+ Here is the call graph for this function:

ilObjExerciseGUI::membersObject ( )

All participants and submission of one assignment.

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

References $_GET, $ilCtrl, ilObjectGUI\$tpl, ilObjectGUI\$tree, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), addSubmissionSubTabs(), ilObjectGUI\checkPermission(), ilExAssignment\getAssignmentDataOfExercise(), ilUtil\sendInfo(), and ilSelectInputGUI\setOptions().

Referenced by saveCommentsObject(), and selectAssignmentObject().

{
global $rbacsystem, $tree, $tpl, $ilToolbar, $ilCtrl, $ilTabs;
$ilTabs->activateTab("grades");
include_once 'Services/Tracking/classes/class.ilLPMarks.php';
$this->checkPermission("write");
$this->addSubmissionSubTabs("assignment");
// assignment selection
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$ass = ilExAssignment::getAssignmentDataOfExercise($this->object->getId());
if ($_GET["ass_id"] == "")
{
$a = current($ass);
$_GET["ass_id"] = $a["id"];
}
reset($ass);
if (count($ass) > 1)
{
$options = array();
foreach ($ass as $a)
{
$options[$a["id"]] = $a["title"];
}
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI($this->lng->txt(""), "ass_id");
$si->setOptions($options);
$si->setValue($_GET["ass_id"]);
$ilToolbar->addInputItem($si);
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$ilToolbar->addFormButton($this->lng->txt("exc_select_ass"),
"selectAssignment");
$ilToolbar->addSeparator();
}
// add member
$ilToolbar->addButton($this->lng->txt("exc_add_participant"),
$this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','start'));
// add course members button, in case the exercise is inside a course
$parent_id = $tree->getParentId($_GET["ref_id"]);
$parent_obj_id = ilObject::_lookupObjId($parent_id);
$type = ilObject::_lookupType($parent_obj_id);
while ($parent_id != 1 && $type != "crs")
{
$parent_id = $tree->getParentId($parent_id);
$parent_obj_id = ilObject::_lookupObjId($parent_id);
$type = ilObject::_lookupType($parent_obj_id);
}
if ($type == "crs")
{
$this->ctrl->setParameterByClass('ilRepositorySearchGUI', "list_obj", $parent_obj_id);
$this->lng->loadLanguageModule("exercise");
$ilToolbar->addButton($this->lng->txt("exc_crs_add_members"),
$this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','listUsers'));
}
if (count($ass) > 0)
{
include_once("./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
$exc_tab = new ilExerciseMemberTableGUI($this, "members", $this->object, $_GET["ass_id"]);
$tpl->setContent($exc_tab->getHTML());
}
else
{
ilUtil::sendInfo("exc_no_assignments_available");
}
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::orderAssignmentsByDeadlineObject ( )

Order by deadline.

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

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), ilExAssignment\orderAssByDeadline(), and ilUtil\sendSuccess().

{
global $lng, $ilCtrl;
$this->checkPermission("write");
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
ilExAssignment::orderAssByDeadline($this->object->getId());
ilUtil::sendSuccess($lng->txt("exc_saved_order"), true);
$ilCtrl->redirect($this, "listAssignments");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::redirectFeedbackMailObject ( )

set feedback status for member and redirect to mail screen

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

References $_GET, $_POST, ilMailFormCall\_getRedirectTarget(), ilObjUser\_lookupLogin(), ilObjectGUI\checkPermission(), ilUtil\redirect(), ilUtil\sendFailure(), and ilExAssignment\updateStatusFeedbackForUser().

Referenced by updateMembersObject().

{
$this->checkPermission("write");
if ($_GET["member_id"] != "")
{
ilExAssignment::updateStatusFeedbackForUser((int) $_GET["ass_id"], (int) $_GET["member_id"], 1);
$login = ilObjUser::_lookupLogin((int) $_GET["member_id"]);
require_once 'Services/Mail/classes/class.ilMailFormCall.php';
ilUtil::redirect(ilMailFormCall::_getRedirectTarget($this, 'members', array(), array('type' => 'new', 'rcp_to' => urlencode($login))));
}
else if(count($_POST["member"]) > 0)
{
include_once('./Services/User/classes/class.ilObjUser.php');
$logins = array();
foreach($_POST["member"] as $member => $val)
{
$logins[] = ilObjUser::_lookupLogin($member);
ilExAssignment::updateStatusFeedbackForUser((int) $_GET["ass_id"], $member, 1);
}
$logins = implode($logins, ",");
require_once 'Services/Mail/classes/class.ilMailFormCall.php';
ilUtil::redirect(ilMailFormCall::_getRedirectTarget($this, 'members', array(), array('type' => 'new', 'rcp_to' => $logins)));
}
ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
$this->ctrl->redirect($this, "members");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::saveAssignmentObject ( )

Save assignment.

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

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), IL_CAL_UNIX, initAssignmentForm(), and ilUtil\sendSuccess().

{
global $tpl, $lng, $ilCtrl, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("content");
$this->addContentSubTabs("list_assignments");
$this->initAssignmentForm("create");
if ($this->form->checkInput())
{
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$ass = new ilExAssignment();
$ass->setTitle($_POST["title"]);
$ass->setInstruction($_POST["instruction"]);
$ass->setExerciseId($this->object->getId());
$ass->setMandatory($_POST["mandatory"]);
if ($_POST["start_time_cb"])
{
$date =
$this->form->getItemByPostVar("start_time")->getDate();
$ass->setStartTime($date->get(IL_CAL_UNIX));
}
else
{
$ass->setStartTime(null);
}
// deadline
$date =
$this->form->getItemByPostVar("deadline")->getDate();
$ass->setDeadline($date->get(IL_CAL_UNIX));
$ass->save();
// save files
$ass->uploadAssignmentFiles($_FILES["files"]);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "listAssignments");
}
else
{
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::saveAssignmentOrderObject ( )

Save assignments order.

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

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), ilExAssignment\saveAssOrderOfExercise(), and ilUtil\sendSuccess().

{
global $lng, $ilCtrl;
$this->checkPermission("write");
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
ilExAssignment::saveAssOrderOfExercise($this->object->getId(), $_POST["order"]);
ilUtil::sendSuccess($lng->txt("exc_saved_order"), true);
$ilCtrl->redirect($this, "listAssignments");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::saveCommentsObject ( )

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

References $_GET, $_POST, ilObjectGUI\checkPermission(), membersObject(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
$this->checkPermission("write");
if(!isset($_POST['comments_value']))
{
continue;
}
$this->object->members_obj->setNoticeForMember($_GET["member_id"],
ilUtil::stripSlashes($_POST["comments_value"]));
ilUtil::sendSuccess($this->lng->txt("exc_members_comments_saved"));
$this->membersObject();
}

+ Here is the call graph for this function:

ilObjExerciseGUI::saveGradesObject ( )

Save grades.

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

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
global $ilCtrl, $lng;
$this->checkPermission("write");
include_once 'Services/Tracking/classes/class.ilLPMarks.php';
if (is_array($_POST["lcomment"]))
{
foreach ($_POST["lcomment"] as $k => $v)
{
$marks_obj = new ilLPMarks($this->object->getId(), (int) $k);
$marks_obj->setComment(ilUtil::stripSlashes($v));
$marks_obj->setMark(ilUtil::stripSlashes($_POST["mark"][$k]));
$marks_obj->update();
}
}
ilUtil::sendSuccess($lng->txt("exc_msg_saved_grades"), true);
$ilCtrl->redirect($this, "showGradesOverview");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::saveObject ( )

save object public

Reimplemented from ilObjectGUI.

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

References ilObjectGUI\createObject(), initPropertiesForm(), ilUtil\redirect(), and ilUtil\sendSuccess().

{
global $rbacadmin;
$this->initPropertiesForm("create");
if ($this->form_gui->checkInput())
{
// always call parent method first to create an object_data entry & a reference
$newObj = parent::saveObject();
// put here your object specific stuff
$newObj->setTitle($this->form_gui->getInput("title"));
$newObj->setDescription($this->form_gui->getInput("desc"));
/* $newObj->setInstruction($this->form_gui->getInput("instruction"));
$edit_date =
$this->form_gui->getItemByPostVar("edit_date")->getDate();
$newObj->setTimestamp($edit_date->get(IL_CAL_UNIX));*/
$newObj->saveData();
$newObj->update();
// always send a message
ilUtil::sendSuccess($this->lng->txt("exc_added"),true);
ilUtil::redirect("ilias.php?baseClass=ilExerciseHandlerGUI&ref_id=".$newObj->getRefId()."&cmd=addAssignment");
}
else
{
$this->form_gui->setValuesByPost();
$this->createObject(true);
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::saveStatusObject (   $a_part_view = false)

Save status of selecte members.

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

References $_GET, $_POST, $ilCtrl, ilObjUser\_lookupName(), ilObjectGUI\checkPermission(), ilExAssignment\lookupMarkOfUser(), ilUtil\sendSuccess(), ilUtil\stripSlashes(), ilExAssignment\updateCommentForUser(), ilExAssignment\updateMarkOfUser(), ilExAssignment\updateNoticeForUser(), ilExAssignment\updateStatusOfUser(), and ilExAssignment\updateStatusTimeOfUser().

Referenced by saveStatusParticipantObject(), and updateMembersObject().

{
global $ilCtrl;
$this->checkPermission("write");
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
// include_once 'Services/Tracking/classes/class.ilLPMarks.php';
$saved_for = array();
foreach($_POST["id"] as $key => $value)
{
if (!$a_part_view)
{
if (count($_POST["member"]) > 0 && $_POST["member"][$key] != "1")
{
continue;
}
else
{
if (count($_POST["member"]) > 0)
{
$uname = ilObjUser::_lookupName($key);
$saved_for[] = $uname["lastname"].", ".$uname["firstname"];
}
}
}
if (!$a_part_view)
{
$ass_id = (int) $_GET["ass_id"];
$user_id = (int) $key;
}
else
{
$ass_id = (int) $key;
$user_id = (int) $_GET["part_id"];
}
ilUtil::stripSlashes($_POST["status"][$key]));
ilUtil::stripSlashes($_POST["notice"][$key]));
if (ilUtil::stripSlashes($_POST['mark'][$key]) !=
{
}
ilUtil::stripSlashes($_POST['mark'][$key]));
ilUtil::stripSlashes($_POST['lcomment'][$key]));
}
if (count($saved_for) > 0)
{
$save_for_str = "(".implode($saved_for, " - ").")";
}
ilUtil::sendSuccess($this->lng->txt("exc_status_saved")." ".$save_for_str,true);
if (!$a_part_view)
{
$ilCtrl->redirect($this, "members");
}
else
{
$ilCtrl->redirect($this, "showParticipant");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::saveStatusParticipantObject ( )

Save assignment status (participant view)

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

References saveStatusObject().

{
$this->saveStatusObject(true);
}

+ Here is the call graph for this function:

ilObjExerciseGUI::selectAssignmentObject ( )

Select assignment.

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

References $_GET, $_POST, membersObject(), and ilUtil\stripSlashes().

{
global $ilTabs;
$ilTabs->activateTab("grades");
$_GET["ass_id"] = ilUtil::stripSlashes($_POST["ass_id"]);
$this->membersObject();
}

+ Here is the call graph for this function:

ilObjExerciseGUI::selectParticipantObject ( )

Select participant.

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

References $_GET, $_POST, showParticipantObject(), and ilUtil\stripSlashes().

{
global $ilTabs;
$ilTabs->activateTab("grades");
$_GET["part_id"] = ilUtil::stripSlashes($_POST["part_id"]);
}

+ Here is the call graph for this function:

ilObjExerciseGUI::sendMembersObject ( )

Send assignment per mail to participants.

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

References $_GET, $_POST, $ilCtrl, ilObjectGUI\checkPermission(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

Referenced by updateMembersObject().

{
global $ilCtrl;
$this->checkPermission("write");
if(!count($_POST["member"]))
{
ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
}
else
{
$this->object->sendAssignment($this->object->getId(),
(int) $_GET["ass_id"], $_POST["member"]);
ilUtil::sendSuccess($this->lng->txt("exc_sent"),true);
}
$ilCtrl->redirect($this, "members");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::sendNotifications (   $assignment_id)
protected

Send submission notifications.

Parameters
int$assignment_id

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

References ilNotification\getNotificationsForObject(), ilNotification\TYPE_EXERCISE_SUBMISSION, and ilExerciseMailNotification\TYPE_SUBMISSION_UPLOAD.

Referenced by deliverFileObject(), and deliverUnzipObject().

{
include_once "./Services/Notification/classes/class.ilNotification.php";
include_once "./Modules/Exercise/classes/class.ilExerciseMailNotification.php";
$not->setAssignmentId($assignment_id);
$not->setRefId($this->ref_id);
$not->setRecipients($users);
$not->send();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::setAssignmentHeader ( )

Set assignment header.

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilExAssignment\lookupTitle().

Referenced by editAssignmentObject(), and executeCommand().

{
global $ilTabs, $lng, $ilCtrl, $tpl;
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$tpl->setTitle(ilExAssignment::lookupTitle($_GET["ass_id"]));
$tpl->setDescription("");
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "listAssignments"));
$ilTabs->addTab("ass_settings",
$lng->txt("settings"),
$ilCtrl->getLinkTarget($this, "editAssignment"));
$ilTabs->addTab("ass_files",
$lng->txt("files"),
$ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::setFiles (   $a_files)

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

{
$this->files = $a_files;
}
ilObjExerciseGUI::showGradesOverviewObject ( )

Show grades overview.

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

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\$tree, addSubmissionSubTabs(), and ilObjectGUI\checkPermission().

{
global $rbacsystem, $tree, $tpl, $ilToolbar, $ilCtrl, $ilTabs, $lng;
$this->checkPermission("write");
$ilTabs->activateTab("grades");
$this->addSubmissionSubTabs("grades");
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$mem_obj = new ilExerciseMembers($this->object);
$mems = $mem_obj->getMembers();
if (count($mems) > 0)
{
$ilToolbar->addButton($lng->txt("exc_export_excel"),
$ilCtrl->getLinkTarget($this, "exportExcel"));
}
include_once("./Modules/Exercise/classes/class.ilExGradesTableGUI.php");
$grades_tab = new ilExGradesTableGUI($this, "showGradesOverview",
$this->object, $mem_obj);
$tpl->setContent($grades_tab->getHTML());
}

+ Here is the call graph for this function:

ilObjExerciseGUI::showOverviewObject ( )

Show overview of assignments.

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

References ilObjectGUI\$tpl, ilLearningProgress\_tracProgress(), addContentSubTabs(), ilObjectGUI\checkPermission(), and ilExAssignment\getAssignmentDataOfExercise().

{
global $tpl, $ilTabs, $ilUser;
$this->checkPermission("read");
include_once("./Services/Tracking/classes/class.ilLearningProgress.php");
ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),
$this->object->getRefId(), 'exc');
$ilTabs->activateTab("content");
$this->addContentSubTabs("content");
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
$acc = new ilAccordionGUI();
$acc->setBehaviour("OneOpenSession");
$acc->setId("exc_ow_".$this->object->getId());
$ass_data = ilExAssignment::getAssignmentDataOfExercise($this->object->getId());
include_once("./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
$ass_gui = new ilExAssignmentGUI($this->object);
foreach ($ass_data as $ass)
{
$acc->addItem($ass_gui->getOverviewHeader($ass),
$ass_gui->getOverviewBody($ass));
}
$tpl->setContent($acc->getHTML());
}

+ Here is the call graph for this function:

ilObjExerciseGUI::showParticipantObject ( )

Show Participant.

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, $name, ilObjectGUI\$tpl, ilObjectGUI\$tree, ilObjUser\_lookupName(), ilObject\_lookupType(), addSubmissionSubTabs(), ilObjectGUI\checkPermission(), ilExAssignment\getAssignmentDataOfExercise(), ilUtil\sendInfo(), ilSelectInputGUI\setOptions(), and ilUtil\sortArray().

Referenced by selectParticipantObject().

{
global $rbacsystem, $tree, $tpl, $ilToolbar, $ilCtrl, $ilTabs, $lng;
$this->checkPermission("write");
$ilTabs->activateTab("grades");
$this->addSubmissionSubTabs("participant");
// participant selection
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$ass = ilExAssignment::getAssignmentDataOfExercise($this->object->getId());
$members = $this->object->members_obj->getMembers();
if (count($members) == 0)
{
ilUtil::sendInfo($lng->txt("exc_no_participants"));
return;
}
$mems = array();
foreach ($members as $mem_id)
{
if (ilObject::_lookupType($mem_id) == "usr")
{
include_once("./Services/User/classes/class.ilObjUser.php");
$mems[$mem_id] = $name;
}
}
$mems = ilUtil::sortArray($mems, "lastname", "asc", false, true);
if ($_GET["part_id"] == "" && count($mems) > 0)
{
$_GET["part_id"] = key($mems);
}
reset($mems);
if (count($mems) > 1)
{
$options = array();
foreach ($mems as $k => $m)
{
$options[$k] =
$m["lastname"].", ".$m["firstname"]." [".$m["login"]."]";
}
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI($this->lng->txt(""), "part_id");
$si->setOptions($options);
$si->setValue($_GET["part_id"]);
$ilToolbar->addInputItem($si);
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$ilToolbar->addFormButton($this->lng->txt("exc_select_part"),
"selectParticipant");
}
if (count($mems) > 0)
{
include_once("./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
$part_tab = new ilExParticipantTableGUI($this, "showParticipant",
$this->object, $_GET["part_id"]);
$tpl->setContent($part_tab->getHTML());
}
else
{
ilUtil::sendInfo("exc_no_assignments_available");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::submissionScreenObject ( )

Displays a form which allows members to deliver their solutions.

public

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

References $_GET, $tab, addContentSubTabs(), ilObjectGUI\checkPermission(), ilObjectGUI\getTemplateFile(), initUploadForm(), initZipUploadForm(), and ilUtil\sendInfo().

{
global $ilUser;
require_once "./Services/Utilities/classes/class.ilUtil.php";
$this->checkPermission("read");
$this->tabs_gui->setTabActive("content");
$this->addContentSubTabs("content");
if (mktime() > $this->ass->getDeadline())
{
ilUtil::sendInfo($this->lng->txt("exercise_time_over"));
}
$this->getTemplateFile("deliver_file", "exc");
include_once("./Modules/Exercise/classes/class.ilExcDeliveredFilesTableGUI.php");
$tab = new ilExcDeliveredFilesTableGUI($this, "deliver", $this->object, $_GET["ass_id"]);
$this->tpl->setVariable("DELIVERED_FILES_TABLE", $tab->getHTML());
if (mktime() < $this->ass->getDeadline())
{
$this->initUploadForm();
$this->tpl->setVariable("UPLOAD_SINGLE_FORM", $this->form->getHTML());
$this->tpl->setVariable("UPLOAD_MULTI_FORM", $this->form->getHTML());
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::updateAssignmentObject ( )

Update assignment.

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

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), IL_CAL_UNIX, initAssignmentForm(), and ilUtil\sendSuccess().

{
global $tpl, $lng, $ilCtrl, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("content");
$this->addContentSubTabs("list_assignments");
$this->initAssignmentForm("edit");
if ($this->form->checkInput())
{
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
$ass = new ilExAssignment($_GET["ass_id"]);
$ass->setTitle($_POST["title"]);
$ass->setInstruction($_POST["instruction"]);
$ass->setExerciseId($this->object->getId());
$ass->setMandatory($_POST["mandatory"]);
if ($_POST["start_time_cb"])
{
$date =
$this->form->getItemByPostVar("start_time")->getDate();
$ass->setStartTime($date->get(IL_CAL_UNIX));
}
else
{
$ass->setStartTime(null);
}
// deadline
$date =
$this->form->getItemByPostVar("deadline")->getDate();
$ass->setDeadline($date->get(IL_CAL_UNIX));
$ass->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "listAssignments");
}
else
{
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::updateMembersObject ( )

update data of members table

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

References $_POST, ilObjectGUI\checkPermission(), deassignMembersObject(), exit, redirectFeedbackMailObject(), saveStatusObject(), and sendMembersObject().

{
global $rbacsystem;
$this->checkPermission("write");
if ($_POST["downloadReturned"])
{
$this->object->members_obj->deliverReturnedFiles(key($_POST["downloadReturned"]));
}
else
{
switch($_POST["action"])
{
case "save_status":
$this->saveStatusObject();
break;
case "send_member":
break;
case "redirectFeedbackMail":
break;
case "delete_member":
break;
}
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::updateObject ( )

Update exercise from values from form.

Reimplemented from ilObjectGUI.

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

References $_POST, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), initPropertiesForm(), ilUtil\sendSuccess(), ilNotification\setNotification(), ilUtil\stripSlashes(), and ilNotification\TYPE_EXERCISE_SUBMISSION.

{
global $rbacsystem, $tpl, $ilUser;
$this->checkPermission("write");
$this->initPropertiesForm("edit");
if ($this->form_gui->checkInput())
{
$this->object->setTitle($this->form_gui->getInput("title"));
$this->object->setDescription($this->form_gui->getInput("desc"));
$this->object->setPassMode($this->form_gui->getInput("pass_mode"));
$this->object->setShowSubmissions($this->form_gui->getInput("show_submissions"));
if ($this->object->getPassMode() == "nr")
{
$this->object->setPassNr($this->form_gui->getInput("pass_nr"));
}
/* $this->object->setInstruction($this->form_gui->getInput("instruction"));
$edit_date =
$this->form_gui->getItemByPostVar("edit_date")->getDate();
$this->object->setTimestamp($edit_date->get(IL_CAL_UNIX));*/
// delete files
/* $del_files = array();
foreach ($_POST as $k => $v)
{
if (substr($k, 0, 12) == "delete_file_" && $v != "")
{
$del_files[] = $v;
}
}
$this->object->deleteFiles($del_files);*/
$this->object->update();
include_once "./Services/Notification/classes/class.ilNotification.php";
ilNotification::setNotification(ilNotification::TYPE_EXERCISE_SUBMISSION, $ilUser->getId(), $this->object->getId(), (bool)$this->form_gui->getInput("notification"));
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
$this->ctrl->redirect($this, "edit");
}
else
{
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}
return;
$this->object->setInstruction(ilUtil::stripSlashes($_POST["Fobject"]["instruction"]));
$this->object->setDate($_POST["d_hour"],$_POST["d_minutes"],$_POST["d_day"],
$_POST["d_month"],$_POST["d_year"]);
if($_POST["delete_file"])
{
$this->object->deleteFiles($_POST["delete_file"]);
}
$this->object->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
$this->object->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
$this->update = $this->object->update();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
$this->ctrl->redirect($this, "edit");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::uploadFileObject ( )

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

References ilObjectGUI\checkPermission(), and ilUtil\sendFailure().

{
global $rbacsystem;
$this->checkPermission("write");
if(!$this->object->addUploadedFile($_FILES["file"]))
{
ilUtil::sendFailure($this->lng->txt("exc_upload_error"),true);
}
$this->ctrl->redirect($this, "edit");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::uploadZipObject ( )

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

References ilObjectGUI\checkPermission(), and ilUtil\sendFailure().

{
global $rbacsystem;
$this->checkPermission("write");
if(!$this->object->addUploadedFile($_FILES["zipfile"], true))
{
ilUtil::sendFailure($this->lng->txt("exc_upload_error"),true);
}
$this->ctrl->redirect($this, "edit");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::viewObject ( )

list childs of current object

public

Reimplemented from ilObjectGUI.

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

References infoScreenObject().

{
$this->infoScreenObject();
}

+ Here is the call graph for this function:


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