ILIAS  Release_4_0_x_branch Revision 61816
 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)
 createObject ($a_reload=false)
 viewObject ()
 list childs of current object
 downloadObject ()
 desc
 deleteDeliveredObject ()
 Delete delivered file.
 deliverObject ()
 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.
 downloadFileObject ()
 Download files.
 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 ()
 membersObject ()
 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 exercise to members.
 deassignMembersObject ()
 Deassign members from exercise.
 saveCommentsObject ()
 getComments ($member_id)
 saveStatusObject ()
 Save status of selecte members.
 __getDateSelect ($a_type, $a_selected)
 __filterAssignedUsers ($a_result)
 getTabs (&$tabs_gui)
 adds tabs to tab gui object
executeCommand ()
 execute command
 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.
- 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.

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
- 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
 __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.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Member Function Documentation

ilObjExerciseGUI::__filterAssignedUsers (   $a_result)

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

References $user.

{
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 985 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 817 of file class.ilObjExerciseGUI.php.

References $result, and 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 846 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 1347 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("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::addLocatorItems ( )

Add locator item.

Reimplemented from ilObjectGUI.

Definition at line 1376 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 ( )

Definition at line 683 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);
}
$this->ctrl->redirect($this, "members");
return false;
}

+ Here is the call graph for this function:

ilObjExerciseGUI::cancelEditObject ( )

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

{
$this->ctrl->redirect($this, "view");
}
ilObjExerciseGUI::createObject (   $a_reload = false)

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

References ilObjectGUI\$tpl, ilObjectGUI\fillCloneTemplate(), ilObjectGUI\getTemplateFile(), 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');
}

+ Here is the call graph for this function:

ilObjExerciseGUI::deassignMembersObject ( )

Deassign members from exercise.

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

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

Referenced by updateMembersObject().

{
global $ilCtrl;
$this->checkPermission("write");
if(is_array($_POST["member"]))
{
foreach($_POST["member"] as $usr_id => $member)
{
$this->object->members_obj->deassignMember($usr_id);
}
$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::deleteDeliveredObject ( )

Delete delivered file.

Parameters
@return

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

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

{
global $ilUser, $ilCtrl;
$this->checkPermission("read");
if (mktime() > $this->object->getTimestamp())
{
ilUtil::sendFailure($this->lng->txt("exercise_time_over"), true);
$ilCtrl->redirect($this, "deliver");
}
if (count($_POST["delivered"]) && mktime() < $this->object->getTimestamp())
{
$this->object->deleteDeliveredFiles($_POST["delivered"], $ilUser->id);
}
else
{
ilUtil::sendFailure($this->lng->txt("please_select_a_delivered_file_to_delete"), true);
}
$ilCtrl->redirect($this, "deliver");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::deliverFileObject ( )

Upload files.

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

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

{
global $ilUser, $lng, $ilCtrl;
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, $ilUser->id))
{
ilUtil::sendFailure($this->lng->txt("exc_upload_error"), true);
}
}
$ilCtrl->redirect($this, "deliver");
}

+ Here is the call graph for this function:

ilObjExerciseGUI::deliverObject ( )

Displays a form which allows members to deliver their solutions.

public

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

References $tab, 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("exc_your_submission");
if (mktime() > $this->object->getTimestamp())
{
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);
$this->tpl->setVariable("DELIVERED_FILES_TABLE", $tab->getHTML());
if (mktime() < $this->object->getTimestamp())
{
$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::deliverUnzipObject ( )

Upload zip file.

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

References $ilCtrl, and ilObjectGUI\checkPermission().

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

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadAllObject ( )

Download all submitted files (of all members).

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

References ilObject\_exists(), ilObjectGUI\checkPermission(), and ilObjectFactory\getInstanceByObjId().

{
$this->checkPermission("write");
$members = array();
foreach($this->object->members_obj->getMembers() as $member_id)
{
// update download time
$this->object->members_obj->updateTutorDownloadTime($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);
}
}
$this->object->file_obj->downloadAllDeliveredFiles($members);
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadFileObject ( )

Download files.

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

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

{
global $rbacsystem;
$file = ($_POST["file"])
? $_POST["file"]
: $_GET["file"];
$this->checkPermission("read");
if (!isset($file))
{
ilUtil::sendFailure($this->lng->txt("exc_select_one_file"),true);
$this->ctrl->redirect($this, "view");
}
$files = $this->object->getFiles();
$file_exist = false;
foreach($this->object->getFiles() as $lfile)
{
if($lfile["name"] == urldecode($file))
{
$file_exist = true;
break;
}
}
if(!$file_exist)
{
echo "FILE DOES NOT EXIST";
}
ilUtil::deliverFile($this->object->file_obj->getAbsolutePath(urldecode($file)),
urldecode($file));
return true;
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadNewReturnedObject ( )

Download newly submitted files of user.

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

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

{
$this->checkPermission("write");
if (!$this->object->members_obj->deliverReturnedFiles($_GET["member_id"], true))
{
$this->ctrl->redirect($this, "members");
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::downloadObject ( )

desc

Parameters
@return

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

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

{
global $ilUser, $ilCtrl;
$this->checkPermission("read");
if (count($_POST["delivered"]))
{
$this->object->members_obj->downloadSelectedFiles($_POST["delivered"],$ilUser->getId());
}
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 658 of file class.ilObjExerciseGUI.php.

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

{
$this->checkPermission("write");
if (!$this->object->members_obj->deliverReturnedFiles($_GET["member_id"]))
{
$this->ctrl->redirect($this, "members");
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::editObject ( )

edit object

public

Reimplemented from ilObjectGUI.

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

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

{
global $rbacsystem, $tpl;
$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 1112 of file class.ilObjExerciseGUI.php.

References $_GET, $cmd, $ilCtrl, $ret, infoScreen(), LP_MODE_REPOSITORY, and ilObjectGUI\prepareOutput().

{
global $ilUser,$ilCtrl;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
//echo "-".$next_class."-".$cmd."-"; exit;
switch($next_class)
{
case "ilinfoscreengui":
$this->infoScreen(); // forwards command
break;
case 'ilpermissiongui':
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case "illearningprogressgui":
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':
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;
default:
if(!$cmd)
{
$cmd = "infoScreen";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjExerciseGUI::getComments (   $member_id)

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

{
return $this->object->members_obj->getNoticeByMember($member_id);
}
ilObjExerciseGUI::getFiles ( )

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

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

Get values for properties form.

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

References IL_CAL_UNIX, and ilDateTime\setDate().

Referenced by editObject().

{
$values["title"] = $this->object->getTitle();
$values["desc"] = $this->object->getLongDescription();
$values["instruction"] = $this->object->getInstruction();
$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

Reimplemented from ilObjectGUI.

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

References $_GET, and ilLearningProgressAccess\checkAccess().

{
global $ilAccess,$ilUser;
$next_class = strtolower($this->ctrl->getNextClass());
if ($ilAccess->checkAccess("visible", "", $this->object->getRefId()))
{
$force_active = ($next_class == "ilinfoscreengui")
? true
: false;
$tabs_gui->addTarget("info_short",
$this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
"showSummary",
"ilinfoscreengui", "", $force_active);
}
/*
$tabs_gui->addTarget("view",
$this->ctrl->getLinkTarget($this, 'view'),
array("view",""), "");*/
if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
{
$tabs_gui->addTarget("exc_your_submission",
$this->ctrl->getLinkTarget($this, "deliver"),
"deliver", "");
}
// edit properties
if ($ilAccess->checkAccess("write", "", $this->ref_id))
{
$tabs_gui->addTarget("edit_properties",
$this->ctrl->getLinkTarget($this, 'edit'),
"edit", "");
$tabs_gui->addTarget("members",
$this->ctrl->getLinkTarget($this, 'members'),
array("members", "newMembers", "newmembers"), "");
}
// 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->addTarget('learning_progress',
$this->ctrl->getLinkTargetByClass(array('ilobjexercisegui','illearningprogressgui'),''),
'',
array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
}
$_GET["sort_order"] = $save_sort_order; // hack, part ii
$_GET["sort_by"] = $save_sort_by;
$_GET["offset"] = $save_offset;
// permissions
if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
array("perm","info","owner"), 'ilpermissiongui');
}
}

+ 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 24 of file class.ilObjExerciseGUI.php.

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

{
global $lng;
$this->type = "exc";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
$lng->loadLanguageModule("exercise");
$this->ctrl->saveParameter($this, array("sort_by", "sort_order", "offset"));
}

+ Here is the call graph for this function:

ilObjExerciseGUI::infoScreen ( )

show information screen

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

References $_GET, $file, $files, ilLPMarks\_lookupComment(), ilLPMarks\_lookupMark(), ilExerciseMembers\_lookupStatus(), ilObjectGUI\checkPermission(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, ilUtil\int2array(), and ilUtil\timearray2string().

Referenced by executeCommand(), and infoScreenObject().

{
global $ilAccess, $ilUser;
$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_instruction"));
$info->addProperty("",
nl2br($this->object->getInstruction()));
// schedule
$info->addSection($this->lng->txt("exc_schedule"));
$info->addProperty($this->lng->txt("exc_edit_until"),
ilDatePresentation::formatDate(new ilDateTime($this->object->getTimestamp(),IL_CAL_UNIX)));
if ($this->object->getTimestamp()-time() <= 0)
{
$time_str = $this->lng->txt("exc_time_over_short");
}
else
{
$time_diff = ilUtil::int2array($this->object->getTimestamp()-time(),null);
// BEGIN Usability: Never display seconds
unset($time_diff['seconds']);
// END Usability: Never display seconds
// BEGIN Usability: Don't display minutes, if it takes days
if (isset($time_diff['days']))
{
unset($time_diff['minutes']);
}
// END Usability: Don't display minutes, if it takes days
// BEGIN Usability: Don't display hours, if it takes months
if (isset($time_diff['months']))
{
unset($time_diff['hours']);
}
// END Usability: Don't display minutes, if it takes months
$time_str = ilUtil::timearray2string($time_diff);
}
$info->addProperty($this->lng->txt("exc_time_to_send"),
"<b>".$time_str."</b>");
// download files
if ($ilAccess->checkAccess("read", "", $this->ref_id))
{
$files = $this->object->getFiles();
if (count($files) > 0)
{
$info->addSection($this->lng->txt("exc_files"));
foreach($files as $file)
{
$this->ctrl->setParameter($this, "file", urlencode($file["name"]));
$info->addProperty($file["name"],
$this->lng->txt("download"),
$this->ctrl->getLinkTarget($this, "downloadFile"));
$this->ctrl->setParameter($this, "file", "");
}
}
}
// submission and feedback info only if read permission given
if ($ilAccess->checkAccess("read", "", $this->ref_id))
{
// submission
$info->addSection($this->lng->txt("exc_your_submission"));
$delivered_files = $this->object->getDeliveredFiles($ilUser->id);
$titles = array();
foreach($delivered_files as $file)
{
$titles[] = $file["filetitle"];
}
$files_str = implode($titles, ", ");
if ($files_str == "")
{
$files_str = $this->lng->txt("message_no_delivered_files");
}
$info->addProperty($this->lng->txt("exc_files_returned"),
$files_str);
$last_sub = $this->object->getLastSubmission($ilUser->getId());
if ($last_sub)
{
}
else
{
$last_sub = "---";
}
$info->addProperty($this->lng->txt("exc_last_submission"),
$last_sub);
// feedback from tutor
include_once("Services/Tracking/classes/class.ilLPMarks.php");
$lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
$mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
$status = ilExerciseMembers::_lookupStatus($this->object->getId(), $ilUser->getId());
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")
{
$info->addProperty($this->lng->txt("status"),
$this->lng->txt("exc_".$status));
}
}
}
// 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 1187 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::initPropertiesForm (   $a_mode = "create")

Init properties form.

Parameters
int$a_mode"create"/"edit"

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

References $file, $files, $ilCtrl, ilObjectGUI\$lng, ilUtil\getImagePath(), ilCheckboxInputGUI\setOptionTitle(), ilFormPropertyGUI\setRequired(), and ilDateTimeInputGUI\setShowTime().

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("60%");
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")
{
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 229 of file class.ilObjExerciseGUI.php.

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

Referenced by deliverObject().

{
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 252 of file class.ilObjExerciseGUI.php.

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

Referenced by deliverObject().

{
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::membersObject ( )

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

References $_GET, ilObjectGUI\$tpl, ilObjectGUI\$tree, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), and ilObjectGUI\checkPermission().

Referenced by saveCommentsObject().

{
global $rbacsystem, $tree, $tpl;
include_once 'Services/Tracking/classes/class.ilLPMarks.php';
$this->checkPermission("write");
//add template for buttons
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
// add member button
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','start'));
$this->tpl->setVariable("BTN_TXT",$this->lng->txt("add_member"));
$this->tpl->parseCurrentBlock();
// 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")
{
// $search_for_role = "il_crs_member_" . $parent_id;
$this->tpl->setCurrentBlock("btn_cell");
// $_SESSION['rep_query']['role']['title'] = $search_for_role;
// $_SESSION['rep_search_type'] = 'role';
// fixed bug 5535
$this->ctrl->setParameterByClass('ilRepositorySearchGUI', "list_obj", $parent_obj_id);
$this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','listUsers'));
//$this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','performSearch'));
$this->lng->loadLanguageModule("exercise");
$this->tpl->setVariable("BTN_TXT",$this->lng->txt("exc_crs_add_members"));
$this->tpl->parseCurrentBlock();
}
include_once("./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
$exc_tab = new ilExerciseMemberTableGUI($this, "members", $this->object);
$tpl->setContent($exc_tab->getHTML());
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::redirectFeedbackMailObject ( )

set feedback status for member and redirect to mail screen

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

References $_GET, $_POST, $login, ilObjUser\_lookupLogin(), ilObjectGUI\checkPermission(), ilUtil\redirect(), and ilUtil\sendFailure().

Referenced by updateMembersObject().

{
$this->checkPermission("write");
if ($_GET["member_id"] != "")
{
$this->object->members_obj->setStatusFeedbackForMember($_GET["member_id"], 1);
$login = ilObjUser::_lookupLogin((int) $_GET["member_id"]);
ilUtil::redirect("ilias.php?baseClass=ilMailGUI&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);
$this->object->members_obj->setStatusFeedbackForMember($member, 1);
}
$logins = implode($logins, ",");
ilUtil::redirect("ilias.php?baseClass=ilMailGUI&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::saveCommentsObject ( )

Definition at line 913 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::saveObject ( )

save object public

Reimplemented from ilObjectGUI.

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

References ilObjectGUI\createObject(), IL_CAL_UNIX, 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();
// setup rolefolder & default local roles if needed (see ilObjForum & ilObjForumGUI for an example)
//$roles = $newObj->initDefaultRoles();
// 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=edit");
}
else
{
$this->form_gui->setValuesByPost();
$this->createObject(true);
}
}

+ Here is the call graph for this function:

ilObjExerciseGUI::saveStatusObject ( )

Save status of selecte members.

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

References $_POST, $ilCtrl, $key, ilLPMarks\_lookupMark(), ilObjUser\_lookupName(), ilObjectGUI\checkPermission(), ilUtil\sendSuccess(), ilLPMarks\setMark(), and ilUtil\stripSlashes().

Referenced by updateMembersObject().

{
global $ilCtrl;
$this->checkPermission("write");
include_once 'Services/Tracking/classes/class.ilLPMarks.php';
$saved_for = array();
foreach($_POST["id"] as $key => $value)
{
if (count($_POST["member"]) > 0 && $_POST["member"][$key] != "1")
{
continue;
}
else
{
if (count($_POST["member"]) > 0)
{
$saved_for[] = $uname["lastname"].", ".$uname["firstname"];
}
}
$this->object->members_obj->setStatusForMember($key, $_POST["status"][$key]);
//$this->object->members_obj->setStatusFeedbackForMember($key, $_POST["feedback"][$key] ? 1 : 0);
$this->object->members_obj->setNoticeForMember($key,ilUtil::stripSlashes($_POST["notice"][$key]));
if (ilUtil::stripSlashes($_POST['mark'][$key]) !=
ilLPMarks::_lookupMark($key, $this->object->getId()))
{
$this->object->members_obj->updateStatusTimeForMember($key);
}
// save mark and comment
$marks_obj = new ilLPMarks($this->object->getId(),$key);
$marks_obj->setMark(ilUtil::stripSlashes($_POST['mark'][$key]));
$marks_obj->setComment(ilUtil::stripSlashes($_POST['lcomment'][$key]));
$marks_obj->update();
}
if (count($saved_for) > 0)
{
$save_for_str = "(".implode($saved_for, " - ").")";
}
ilUtil::sendSuccess($this->lng->txt("exc_status_saved")." ".$save_for_str,true);
$ilCtrl->redirect($this, "members");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjExerciseGUI::sendMembersObject ( )

Send exercise to members.

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

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

Referenced by updateMembersObject().

{
global $ilCtrl;
if(!count($_POST["member"]))
{
ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
}
else
{
$this->object->send($_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::setFiles (   $a_files)

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

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

update data of members table

Definition at line 621 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 527 of file class.ilObjExerciseGUI.php.

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

{
global $rbacsystem, $tpl;
$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->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();
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 604 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 590 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 60 of file class.ilObjExerciseGUI.php.

References $_GET, $file, ilLearningProgress\_tracProgress(), ilUtil\formRadioButton(), ilUtil\getImagePath(), ilObjectGUI\getTemplateFile(), infoScreenObject(), ilUtil\int2array(), and ilUtil\timearray2string().

{
$this->infoScreenObject();
return;
global $rbacsystem,$ilUser;
include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),'exc');
if (strtolower($_GET["baseClass"]) == "iladministrationgui")
{
return;
}
if (!$rbacsystem->checkAccess("read", $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
$this->getTemplateFile("view", "exc");
$this->tpl->setVariable("FORM_DOWNLOAD_ACTION", $this->ctrl->getFormAction($this, "downloadFile"));
$this->tpl->setVariable("TITLE_TXT",$this->lng->txt("title"));
$this->tpl->setVariable("TITLE",$this->object->getTitle());
$this->tpl->setVariable("TXT_HEADER",$this->lng->txt("exc_details"));
$this->tpl->setVariable("DESCRIPTION_TXT",$this->lng->txt("description"));
$this->tpl->setVariable("DESCRIPTION",$this->object->getDescription());
$this->tpl->setVariable("INSTRUCTION_TXT",$this->lng->txt("exc_instruction"));
$this->tpl->setVariable("INSTRUCTION",nl2br($this->object->getInstruction()));
$this->tpl->setVariable("EDIT_UNTIL_TXT",$this->lng->txt("exc_edit_until"));
$this->tpl->setVariable("EDIT_UNTIL",date("H:i, d.m.Y",$this->object->getTimestamp()));
$this->tpl->setVariable("TIME_TO_SEND_TXT",$this->lng->txt("exc_time_to_send"));
if ($this->object->getTimestamp()-time() <= 0)
{
$this->tpl->setCurrentBlock("TIME_REACHED");
$this->tpl->setVariable("TIME_TO_SEND",$this->lng->txt("exc_time_over_short"));
$this->tpl->parseCurrentBlock();
}
else {
$timediff = ilUtil::int2array($this->object->getTimestamp()-time(),null);
$timestr = ilUtil::timearray2string($timediff);
$this->tpl->setCurrentBlock("TIME_NOT_REACHED");
$this->tpl->setVariable("TIME_TO_SEND",$timestr);
$this->tpl->parseCurrentBlock();
}
$anyfiles = false;
foreach($this->object->getFiles() as $file)
{
$this->tpl->setCurrentBlock("FILES_ROW");
$this->tpl->setVariable("FILE_DATA",$file["name"]);
$this->tpl->setVariable("FILE_CHECK",ilUtil::formRadioButton(0,"file",urlencode($file["name"])));
$this->tpl->parseCurrentBlock();
$anyfiles = true;
}
if ($anyfiles)
{
$this->tpl->setCurrentBlock("FILES");
$this->tpl->setVariable("FILES_TXT",$this->lng->txt("exc_files"));
$this->tpl->setVariable("TXT_DOWNLOAD",$this->lng->txt("download"));
$this->tpl->setVariable("IMG",ilUtil::getImagePath("arrow_downright.gif"));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("perma_link");
$this->tpl->setVariable("PERMA_LINK", ILIAS_HTTP_PATH.
"/goto.php?target=".
$this->object->getType().
"_".$this->object->getRefId()."&client_id=".CLIENT_ID);
$this->tpl->setVariable("TXT_PERMA_LINK", $this->lng->txt("perma_link"));
$this->tpl->setVariable("PERMA_TARGET", "_top");
$this->tpl->parseCurrentBlock();
return true;
}

+ Here is the call graph for this function:


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