Public Member Functions | Data Fields

ilObjExercise Class Reference
[Modules/Exercise]

Class ilObjExercise. More...

Inheritance diagram for ilObjExercise:
Collaboration diagram for ilObjExercise:

Public Member Functions

 ilObjExercise ($a_id=0, $a_call_by_reference=true)
 Constructor public.
 setDate ($a_hour, $a_minutes, $a_day, $a_month, $a_year)
 getTimestamp ()
 setTimestamp ($a_timestamp)
 setInstruction ($a_instruction)
 getInstruction ()
 getFiles ()
 checkDate ()
 deliverFile ($a_http_post_files, $user_id, $unzip=false)
 addUploadedFile ($a_http_post_files, $unzipUploadedFile=false)
 deleteFiles ($a_files)
 saveData ()
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone exercise (no member data).
getDeliveredFiles ($user_id)
 Returns the delivered files of an user.
 deleteDeliveredFiles ($file_id_array, $user_id)
 Deletes already delivered files.
 deliverReturnedFiles ($user_id)
 Delivers the returned files of an user.
 delete ()
 delete course and all related data
 notify ($a_event, $a_ref_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts.
 read ()
 update ()
 update object in db
 getMemberListData ()
 get member list data
 getLastSubmission ($member_id)
 Get the date of the last submission of a user for the exercise.
 send ($a_members)
 send exercise per mail to members
 _lookupUpdatedSubmission ($exc_id, $member_id)
 Check whether student has upload new files after tutor has set the exercise to another than notgraded.
 _lookupAnyExerciseSent ($a_exc_id)
 Check whether exercise has been sent to any student per mail.
 _lookupNewFiles ($exc_id, $member_id)
 Check how much files have been uploaded by the learner after the last download of the tutor.
 _lookupStatusTime ($exc_id, $member_id)
 Get time when exercise has been set to solved.
 _lookupSentTime ($exc_id, $member_id)
 Get time when exercise has been sent per e-mail to user.
 _lookupFeedbackTime ($exc_id, $member_id)
 Get time when feedback mail has been sent.
 __formatBody ()
 __formatSubject ()
 __formatRecipients ($a_members)
 _checkCondition ($a_exc_id, $a_operator, $a_value)
 processUploadedFile ($fileTmp, $storageMethod, $persistentErrorMessage)
 processes errorhandling etc for uploaded archive

Data Fields

 $file_obj
 $members_obj
 $files
 $timestamp
 $hour
 $minutes
 $day
 $month
 $year
 $instruction

Detailed Description

Class ilObjExercise.

Author:
Stefan Meyer <smeyer@databay.de>
Version:
Id:
class.ilObjExercise.php 17104 2008-08-03 18:20:59Z akill

Definition at line 39 of file class.ilObjExercise.php.


Member Function Documentation

ilObjExercise::__formatBody (  ) 

Definition at line 570 of file class.ilObjExercise.php.

References ilObject::$lng, formatDate(), getInstruction(), getTimestamp(), and ilObject::getType().

Referenced by send().

        {
                global $lng;

                $body = $this->getInstruction();
                $body .= "\n\n";
                $body .= $lng->txt("exc_edit_until") . ": ".
                        ilFormat::formatDate(date("Y-m-d H:i:s",$this->getTimestamp()), "datetime", true);
                $body .= "\n\n";
                $body .= ILIAS_HTTP_PATH.
                        "/goto.php?target=".
                        $this->getType().
                        "_".$this->getRefId()."&client_id=".CLIENT_ID;

                return $body;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjExercise::__formatRecipients ( a_members  ) 

Definition at line 592 of file class.ilObjExercise.php.

References ilObjectFactory::getInstanceByObjId().

Referenced by send().

        {
                foreach($a_members as $member_id => $value)
                {
                        $tmp_obj = ilObjectFactory::getInstanceByObjId($member_id);
                        $tmp_members[] = $tmp_obj->getLogin();

                        unset($tmp_obj);
                }

                return implode(',',$tmp_members ? $tmp_members : array());
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjExercise::__formatSubject (  ) 

Definition at line 587 of file class.ilObjExercise.php.

References ilObject::getDescription(), and ilObject::getTitle().

Referenced by send().

        {
                return $subject = $this->getTitle()." (".$this->getDescription().")";
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjExercise::_checkCondition ( a_exc_id,
a_operator,
a_value 
)

Definition at line 605 of file class.ilObjExercise.php.

References ilObject::$ilias, and ilExerciseMembers::_lookupStatus().

        {
                global $ilias;

                switch($a_operator)
                {
                        case 'passed':
                                if (ilExerciseMembers::_lookupStatus($a_exc_id, $ilias->account->getId()) == "passed")
                                {
                                        return true;
                                }
                                else
                                {
                                        return false;
                                }
                                break;

                        default:
                                return true;
                }
                return true;
        }

Here is the call graph for this function:

ilObjExercise::_lookupAnyExerciseSent ( a_exc_id  ) 

Check whether exercise has been sent to any student per mail.

Definition at line 464 of file class.ilObjExercise.php.

        {
                global $ilDB;

                $q = "SELECT count(*) AS cnt FROM exc_members".
                        " WHERE sent_time <> '0000-00-00 00:00:00'".
                        " AND obj_id = ".$ilDB->quote($a_exc_id);
                $set = $ilDB->query($q);
                $rec = $set->fetchRow(DB_FETCHMODE_ASSOC);

                if ($rec["cnt"] > 0)
                {
                        return true;
                }
                else
                {
                        return false;
                }
        }

ilObjExercise::_lookupFeedbackTime ( exc_id,
member_id 
)

Get time when feedback mail has been sent.

Definition at line 553 of file class.ilObjExercise.php.

References ilObject::$lng, and ilUtil::getMySQLTimestamp().

Referenced by ilObjExerciseGUI::membersObject().

        {

                global $ilDB, $lng;

                $q = "SELECT * ".
                "FROM exc_members ".
                "WHERE obj_id= ".$ilDB->quote($exc_id)." AND usr_id= ".$ilDB->quote($member_id);

                $set = $ilDB->query($q);
                if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        return ilUtil::getMySQLTimestamp($rec["feedback_time"]);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjExercise::_lookupNewFiles ( exc_id,
member_id 
)

Check how much files have been uploaded by the learner after the last download of the tutor.

Definition at line 488 of file class.ilObjExercise.php.

        {
                global $ilDB, $ilUser;

                $q = "SELECT exc_returned.returned_id AS id ".
                        "FROM exc_usr_tutor, exc_returned ".
                        "WHERE exc_returned.obj_id = exc_usr_tutor.obj_id ".
                        "AND exc_returned.user_id = exc_usr_tutor.usr_id ".
                        "AND exc_returned.obj_id = ".$ilDB->quote($exc_id).
                        "AND exc_returned.user_id = ".$ilDB->quote($member_id).
                        "AND exc_usr_tutor.tutor_id = ".$ilDB->quote($ilUser->getId()).
                        "AND exc_usr_tutor.download_time < exc_returned.timestamp ";

                $new_up_set = $ilDB->query($q);

                $new_up = array();
                while ($new_up_rec = $new_up_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        $new_up[] = $new_up_rec["id"];
                }

                return $new_up;
        }

ilObjExercise::_lookupSentTime ( exc_id,
member_id 
)

Get time when exercise has been sent per e-mail to user.

Definition at line 534 of file class.ilObjExercise.php.

References ilObject::$lng, and ilUtil::getMySQLTimestamp().

Referenced by ilObjExerciseGUI::membersObject().

        {

                global $ilDB, $lng;

                $q = "SELECT * ".
                "FROM exc_members ".
                "WHERE obj_id= ".$ilDB->quote($exc_id)." AND usr_id= ".$ilDB->quote($member_id);

                $set = $ilDB->query($q);
                if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        return ilUtil::getMySQLTimestamp($rec["sent_time"]);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjExercise::_lookupStatusTime ( exc_id,
member_id 
)

Get time when exercise has been set to solved.

Definition at line 515 of file class.ilObjExercise.php.

References ilObject::$lng, and ilUtil::getMySQLTimestamp().

Referenced by ilObjExerciseGUI::membersObject().

        {

                global $ilDB, $lng;

                $q = "SELECT * ".
                "FROM exc_members ".
                "WHERE obj_id= ".$ilDB->quote($exc_id)." AND usr_id= ".$ilDB->quote($member_id);

                $set = $ilDB->query($q);
                if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        return ilUtil::getMySQLTimestamp($rec["status_time"]);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjExercise::_lookupUpdatedSubmission ( exc_id,
member_id 
)

Check whether student has upload new files after tutor has set the exercise to another than notgraded.

Definition at line 431 of file class.ilObjExercise.php.

References ilObject::$lng.

        {

                global $ilDB, $lng;

                $q="SELECT exc_members.status_time, exc_returned.timestamp ".
                        "FROM exc_members, exc_returned ".
                        "WHERE exc_members.status_time < exc_returned.timestamp ".
                        "AND exc_members.status_time <> '0000-00-00 00:00:00' ".
                        "AND exc_returned.obj_id = exc_members.obj_id ".
                        "AND exc_returned.user_id = exc_members.usr_id ".
                        "AND exc_returned.obj_id=".$ilDB->quote($exc_id)." AND exc_returned.user_id=".
                        $ilDB->quote($member_id);

                $usr_set = $ilDB->query($q);

                $array=$usr_set->fetchRow(DB_FETCHMODE_ASSOC);

                if (count($array)==0)
                {
                        return 0;
                }
                else
                {
                        return 1;
                }

        }

ilObjExercise::addUploadedFile ( a_http_post_files,
unzipUploadedFile = false 
)

Definition at line 132 of file class.ilObjExercise.php.

References ilObject::$lng, and processUploadedFile().

        {
                global $lng;
                if ($unzipUploadedFile && preg_match("/zip/",   $a_http_post_files["type"]) == 1)
                {

                        $this->processUploadedFile($a_http_post_files["tmp_name"], "storeUploadedFile", true);
                        return true;
                        
                        
                }
                else 
                {
                        $this->file_obj->storeUploadedFile($a_http_post_files, true);
                        return true;
                }
        }

Here is the call graph for this function:

ilObjExercise::checkDate (  ) 

Definition at line 97 of file class.ilObjExercise.php.

        {
                return  $this->hour == (int) date("H",$this->timestamp) and
                        $this->minutes == (int) date("i",$this->timestamp) and
                        $this->day == (int) date("d",$this->timestamp) and
                        $this->month == (int) date("m",$this->timestamp) and
                        $this->year == (int) date("Y",$this->timestamp);

        }

ilObjExercise::cloneObject ( a_target_id,
a_copy_id = 0 
)

Clone exercise (no member data).

public

Parameters:
int target ref_id
int copy id

Reimplemented from ilObject.

Definition at line 174 of file class.ilObjExercise.php.

References ilObject::getId(), getInstruction(), and getTimestamp().

        {
                global $ilDB;
                
                // Copy settings
                $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
                $new_obj->setInstruction($this->getInstruction());
                $new_obj->setTimestamp($this->getTimestamp());
                $new_obj->saveData();
                
                // Copy files
                $tmp_file_obj =& new ilFileDataExercise($this->getId());
                $tmp_file_obj->ilClone($new_obj->getId());
                unset($tmp_file_obj);
                
                // Copy learning progress settings
                include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
                $obj_settings = new ilLPObjSettings($this->getId());
                $obj_settings->cloneSettings($new_obj->getId());
                unset($obj_settings);
                
                return $new_obj;
        }

Here is the call graph for this function:

ilObjExercise::delete (  ) 

delete course and all related data

public

Returns:
boolean true if all object data were removed; false if only a references were removed

Reimplemented from ilObject.

Definition at line 245 of file class.ilObjExercise.php.

References ilObject::getId().

        {
                global $ilDB;

                // always call parent delete function first!!
                if (!parent::delete())
                {
                        return false;
                }
                // put here course specific stuff
                $query = "DELETE FROM exc_data ".
                        "WHERE obj_id = ".$ilDB->quote($this->getId());

                $this->ilias->db->query($query);

                $this->file_obj->delete();
                $this->members_obj->delete();

                return true;
        }

Here is the call graph for this function:

ilObjExercise::deleteDeliveredFiles ( file_id_array,
user_id 
)

Deletes already delivered files.

Parameters:
array $file_id_array An array containing database ids of the delivered files
numeric $user_id The database id of the user public

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

        {
                $this->members_obj->deleteDeliveredFiles($file_id_array, $user_id);

                // Finally update status 'returned' of member if no file exists
                if(!count($this->members_obj->getDeliveredFiles($user_id)))
                {
                        $this->members_obj->setStatusReturnedForMember($user_id,0);
                }

        }

ilObjExercise::deleteFiles ( a_files  ) 

Definition at line 149 of file class.ilObjExercise.php.

        {
                $this->file_obj->unlinkFiles($a_files);
        }

ilObjExercise::deliverFile ( a_http_post_files,
user_id,
unzip = false 
)

Definition at line 107 of file class.ilObjExercise.php.

        {
                $deliver_result = $this->file_obj->deliverFile($a_http_post_files, $user_id, $unzip);
//var_dump($deliver_result);
                if ($deliver_result)
                {
                        $query = sprintf("INSERT INTO exc_returned ".
                                                         "(returned_id, obj_id, user_id, filename, filetitle, mimetype, TIMESTAMP) ".
                                                         "VALUES (NULL, %s, %s, %s, %s, %s, NULL)",
                                $this->ilias->db->quote($this->getId() . ""),
                                $this->ilias->db->quote($user_id . ""),
                                $this->ilias->db->quote($deliver_result["fullname"]),
                                $this->ilias->db->quote($a_http_post_files["name"]),
                                $this->ilias->db->quote($deliver_result["mimetype"])
                        );
                        $this->ilias->db->query($query);
                        if (!$this->members_obj->isAssigned($user_id))
                        {
                                $this->members_obj->assignMember($user_id);
                        }
                        $this->members_obj->setStatusReturnedForMember($user_id, 1);
                }
                return true;
        }

ilObjExercise::deliverReturnedFiles ( user_id  ) 

Delivers the returned files of an user.

Parameters:
numeric $user_id The database id of the user public

Definition at line 234 of file class.ilObjExercise.php.

        {
                require_once "./Services/Utilities/classes/class.ilUtil.php";
        }

& ilObjExercise::getDeliveredFiles ( user_id  ) 

Returns the delivered files of an user.

Parameters:
numeric $user_id The database id of the user
Returns:
array An array containing the information on the delivered files public

Definition at line 205 of file class.ilObjExercise.php.

        {
                $delivered_files =& $this->members_obj->getDeliveredFiles($user_id);
                return $delivered_files;
        }

ilObjExercise::getFiles (  ) 

Definition at line 92 of file class.ilObjExercise.php.

        {
                return $this->files;
        }

ilObjExercise::getInstruction (  ) 

Definition at line 88 of file class.ilObjExercise.php.

Referenced by __formatBody(), cloneObject(), saveData(), and update().

        {
                return $this->instruction;
        }

Here is the caller graph for this function:

ilObjExercise::getLastSubmission ( member_id  ) 

Get the date of the last submission of a user for the exercise.

Parameters:
int $member_id User ID of member.
Returns:
mixed false or mysql timestamp of last submission

Definition at line 363 of file class.ilObjExercise.php.

References ilObject::$lng, ilObject::getId(), and ilUtil::getMySQLTimestamp().

Referenced by getMemberListData().

        {
                global $ilDB, $lng;

                $q="SELECT obj_id,user_id,timestamp FROM exc_returned ".
                        "WHERE obj_id =".$ilDB->quote($this->getId())." AND user_id=".
                        $ilDB->quote($member_id).
                        " ORDER BY timestamp DESC";

                $usr_set = $ilDB->query($q);

                $array=$usr_set->fetchRow(DB_FETCHMODE_ASSOC);
                if ($array["timestamp"]==NULL)
                {
                        return false;
                }
                else
                {
                        return ilUtil::getMySQLTimestamp($array["timestamp"]);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjExercise::getMemberListData (  ) 

get member list data

Definition at line 328 of file class.ilObjExercise.php.

References ilObject::_exists(), ilObjUser::_lookupLogin(), ilObjUser::_lookupName(), ilObject::_lookupType(), ilObject::getId(), and getLastSubmission().

        {
                global $ilDB;

                $mem = array();
                $q = "SELECT * FROM exc_members ".
                        "WHERE obj_id = ".$ilDB->quote($this->getId());
                $set = $ilDB->query($q);
                while($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        if (ilObject::_exists($rec["usr_id"]) &&
                                (ilObject::_lookupType($rec["usr_id"]) == "usr"))
                        {
                                $name = ilObjUser::_lookupName($rec["usr_id"]);
                                $login = ilObjUser::_lookupLogin($rec["usr_id"]);
                                $mem[] =
                                        array("name" => $name["lastname"].", ".$name["firstname"],
                                        "login" => $login,
                                        "sent_time" => $rec["sent_time"],
                                        "submission" => $this->getLastSubmission($rec["usr_id"]),
                                        "status_time" => $rec["status_time"],
                                        "feedback_time" => $rec["feedback_time"],
                                        "usr_id" => $rec["usr_id"]
                                        );
                        }
                }
                return $mem;
        }

Here is the call graph for this function:

ilObjExercise::getTimestamp (  ) 

Definition at line 76 of file class.ilObjExercise.php.

Referenced by __formatBody(), cloneObject(), saveData(), and update().

        {
                return $this->timestamp;
        }

Here is the caller graph for this function:

ilObjExercise::ilObjExercise ( a_id = 0,
a_call_by_reference = true 
)

Constructor public.

Parameters:
integer reference_id or object_id
boolean treat the id as reference_id (true) or object_id (false)

Definition at line 59 of file class.ilObjExercise.php.

References ilObject::ilObject().

        {
                $this->type = "exc";
                $this->ilObject($a_id,$a_call_by_reference);
        }

Here is the call graph for this function:

ilObjExercise::notify ( a_event,
a_ref_id,
a_node_id,
a_params = 0 
)

notifys an object about an event occured Based on the event happend, each object may decide how it reacts.

public

Parameters:
string event
integer reference id of object where the event occured
array passes optional paramters if required
Returns:
boolean

Definition at line 276 of file class.ilObjExercise.php.

        {
                // object specific event handling

                parent::notify($a_event,$a_ref_id,$a_node_id,$a_params);
        }

ilObjExercise::processUploadedFile ( fileTmp,
storageMethod,
persistentErrorMessage 
)

processes errorhandling etc for uploaded archive

Parameters:
string $tmpFile path and filename to uploaded file
string $storageMethod deliverFile or storeUploadedFile
boolean $persistentErrorMessage Defines whether sendInfo will be persistent or not

Definition at line 634 of file class.ilObjExercise.php.

References $filename, ilObject::$lng, ilUtil::delDir(), ilUtil::ilTempnam(), ilUtil::makeDir(), ilFileUtils::processZipFile(), ilFileUtils::recursive_dirscan(), and ilUtil::sendInfo().

Referenced by addUploadedFile().

        {
                global $lng, $ilUser;

                // Create unzip-directory
                $newDir = ilUtil::ilTempnam();
                ilUtil::makeDir($newDir);

                include_once ("Services/Utilities/classes/class.ilFileUtils.php");
                
                try 
                {
                        $processDone = ilFileUtils::processZipFile($newDir,$fileTmp, false);
                        ilFileUtils::recursive_dirscan($newDir, $filearray);                    

                        foreach ($filearray["file"] as $key => $filename)
                        {
                                $a_http_post_files["name"] = $filename;
                                $a_http_post_files["type"] = "other";
                                $a_http_post_files["tmp_name"] = $filearray["path"][$key]."/".$filename;
                                $a_http_post_files["error"] = 0;
                                $a_http_post_files["size"] = filesize($filearray["path"][$key]."/".$filename);

                                if ($storageMethod == "deliverFile")
                                {
                                        $this->$storageMethod($a_http_post_files, $ilUser->id, true);
                                }
                                else if ($storageMethod == "storeUploadedFile")
                                {
                                        $this->file_obj->$storageMethod($a_http_post_files, true, true);                                
                                }
                        }
                        ilUtil::sendInfo($this->lng->txt("file_added"),$persistentErrorMessage);                                        

                } 
                catch (ilFileUtilsException $e) 
                {
                        ilUtil::sendInfo($e->getMessage(), $persistentErrorMessage);
                }
                

                ilUtil::delDir($newDir);
                return $processDone;

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjExercise::read (  ) 

Definition at line 283 of file class.ilObjExercise.php.

References $res, ilObject::getId(), ilObject::getRefId(), setInstruction(), and setTimestamp().

        {
                global $ilDB;

                parent::read();

                $query = "SELECT * FROM exc_data ".
                        "WHERE obj_id = ".$ilDB->quote($this->getId());

                $res = $this->ilias->db->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $this->setInstruction($row->instruction);
                        $this->setTimestamp($row->time_stamp);
                }
                $this->members_obj =& new ilExerciseMembers($this->getId(),$this->getRefId());
                $this->members_obj->read();

                // GET FILE ASSIGNED TO EXERCISE
                $this->file_obj = new ilFileDataExercise($this->getId());
                $this->files = $this->file_obj->getFiles();

                return true;
        }

Here is the call graph for this function:

ilObjExercise::saveData (  ) 

Definition at line 154 of file class.ilObjExercise.php.

References ilObject::getId(), getInstruction(), and getTimestamp().

        {
                global $ilDB;

                // SAVE ONLY EXERCISE SPECIFIC DATA
                $query = "INSERT INTO exc_data SET ".
                        "obj_id = ".$ilDB->quote($this->getId()).", ".
                        "instruction = ".$ilDB->quote($this->getInstruction()).", ".
                        "time_stamp = ".$ilDB->quote($this->getTimestamp());
                $this->ilias->db->query($query);
                return true;
        }

Here is the call graph for this function:

ilObjExercise::send ( a_members  ) 

send exercise per mail to members

Definition at line 388 of file class.ilObjExercise.php.

References $_SESSION, $file, $files, __formatBody(), __formatRecipients(), and __formatSubject().

        {
                $files = $this->file_obj->getFiles();
                if(count($files))
                {
                        include_once "./classes/class.ilFileDataMail.php";

                        $mfile_obj = new ilFileDataMail($_SESSION["AccountId"]);
                        foreach($files as $file)
                        {
                                $mfile_obj->copyAttachmentFile($this->file_obj->getAbsolutePath($file["name"]),$file["name"]);
                                $file_names[] = $file["name"];
                        }
                }

                include_once "Services/Mail/classes/class.ilMail.php";

                $tmp_mail_obj = new ilMail($_SESSION["AccountId"]);
                $message = $tmp_mail_obj->sendMail($this->__formatRecipients($a_members),"","",$this->__formatSubject(),$this->__formatBody(),
                                                                                   count($file_names) ? $file_names : array(),array("normal"));

                unset($tmp_mail_obj);

                if(count($file_names))
                {
                        $mfile_obj->unlinkFiles($file_names);
                        unset($mfile_obj);
                }


                // SET STATUS SENT FOR ALL RECIPIENTS
                foreach($a_members as $member_id => $value)
                {
                        $this->members_obj->setStatusSentForMember($member_id,1);
                }

                return true;
        }

Here is the call graph for this function:

ilObjExercise::setDate ( a_hour,
a_minutes,
a_day,
a_month,
a_year 
)

Definition at line 66 of file class.ilObjExercise.php.

        {
                $this->hour = (int) $a_hour;
                $this->minutes = (int) $a_minutes;
                $this->day = (int) $a_day;
                $this->month = (int) $a_month;
                $this->year = (int) $a_year;
                $this->timestamp = mktime($this->hour,$this->minutes,0,$this->month,$this->day,$this->year);
                return true;
        }

ilObjExercise::setInstruction ( a_instruction  ) 

Definition at line 84 of file class.ilObjExercise.php.

Referenced by read().

        {
                $this->instruction = $a_instruction;
        }

Here is the caller graph for this function:

ilObjExercise::setTimestamp ( a_timestamp  ) 

Definition at line 80 of file class.ilObjExercise.php.

Referenced by read().

        {
                $this->timestamp = $a_timestamp;
        }

Here is the caller graph for this function:

ilObjExercise::update (  ) 

update object in db

public

Returns:
boolean true on success

Reimplemented from ilObject.

Definition at line 308 of file class.ilObjExercise.php.

References $res, ilObject::getId(), getInstruction(), and getTimestamp().

        {
                global $ilDB;

                parent::update();

                $query = "UPDATE exc_data SET ".
                        "instruction = ".$ilDB->quote($this->getInstruction()).", ".
                        "time_stamp = ".$ilDB->quote($this->getTimestamp())." ".
                        "WHERE obj_id = ".$ilDB->quote($this->getId());

                $res = $this->ilias->db->query($query);

                #$this->members_obj->update();
                return true;
        }

Here is the call graph for this function:


Field Documentation

ilObjExercise::$day

Definition at line 48 of file class.ilObjExercise.php.

ilObjExercise::$file_obj

Definition at line 41 of file class.ilObjExercise.php.

ilObjExercise::$files

Definition at line 43 of file class.ilObjExercise.php.

Referenced by send().

ilObjExercise::$hour

Definition at line 46 of file class.ilObjExercise.php.

ilObjExercise::$instruction

Definition at line 51 of file class.ilObjExercise.php.

ilObjExercise::$members_obj

Definition at line 42 of file class.ilObjExercise.php.

ilObjExercise::$minutes

Definition at line 47 of file class.ilObjExercise.php.

ilObjExercise::$month

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

ilObjExercise::$timestamp

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

ilObjExercise::$year

Definition at line 50 of file class.ilObjExercise.php.


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