ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLPMarks Class Reference
+ Collaboration diagram for ilLPMarks:

Public Member Functions

 ilLPMarks ($a_obj_id, $a_usr_id)
 getUserId ()
 setMark ($a_mark)
 getMark ()
 setComment ($a_comment)
 getComment ()
 setCompleted ($a_status)
 getCompleted ()
 getStatusChanged ()
 getObjId ()
 update ()
 _hasCompleted ($a_usr_id, $a_obj_id)
 _lookupMark ($a_usr_id, $a_obj_id)
 _lookupComment ($a_usr_id, $a_obj_id)
 __read ()
 __add ()

Static Public Member Functions

static deleteObject ($a_obj_id)
 Delete object.
static _deleteForUsers ($a_obj_id, array $a_user_ids)
static _getAllUserIds ($a_obj_id)

Data Fields

 $db = null
 $obj_id = null
 $usr_id = null
 $obj_type = null
 $completed = false
 $comment = ''
 $mark = ''
 $status_changed = ''
 $has_entry = false

Detailed Description

Definition at line 36 of file class.ilLPMarks.php.

Member Function Documentation

ilLPMarks::__add ( )

Definition at line 210 of file class.ilLPMarks.php.

References $query, $res, getComment(), getCompleted(), getMark(), getObjId(), and getUserId().

Referenced by update().

{
global $ilDB;
$query = "INSERT INTO ut_lp_marks (mark,u_comment, completed,obj_id,usr_id) ".
"VALUES( ".
$ilDB->quote($this->getMark(),'text').", ".
$ilDB->quote($this->getComment() ,'text').", ".
$ilDB->quote($this->getCompleted() ,'integer').", ".
$ilDB->quote($this->getObjId() ,'integer').", ".
$ilDB->quote($this->getUserId() ,'integer')." ".
")";
$res = $ilDB->manipulate($query);
$this->has_entry = true;
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPMarks::__read ( )

Definition at line 189 of file class.ilLPMarks.php.

References $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLPMarks().

{
global $ilDB;
$res = $this->db->query("SELECT * FROM ut_lp_marks ".
"WHERE obj_id = ".$this->db->quote($this->obj_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($this->usr_id ,'integer'));
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->has_entry = true;
$this->completed = (int) $row->completed;
$this->comment = $row->u_comment;
$this->mark = $row->mark;
$this->status_changed = $row->status_changed;
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilLPMarks::_deleteForUsers (   $a_obj_id,
array  $a_user_ids 
)
static

Definition at line 228 of file class.ilLPMarks.php.

Referenced by ilObjectLP\resetLPDataForUserIds().

{
global $ilDB;
$ilDB->manipulate("DELETE FROM ut_lp_marks".
" WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer").
" AND ".$ilDB->in("usr_id", $a_user_ids, "", "integer"));
}

+ Here is the caller graph for this function:

static ilLPMarks::_getAllUserIds (   $a_obj_id)
static

Definition at line 237 of file class.ilLPMarks.php.

References $res, and $row.

Referenced by ilObjectLP\gatherLPUsers().

{
global $ilDB;
$res = array();
$set = $ilDB->query("SELECT usr_id FROM ut_lp_marks".
" WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer"));
while($row = $ilDB->fetchAssoc($set))
{
$res[] = $row["usr_id"];
}
return $res;
}

+ Here is the caller graph for this function:

ilLPMarks::_hasCompleted (   $a_usr_id,
  $a_obj_id 
)

Definition at line 139 of file class.ilLPMarks.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilInfoScreenGUI\showLearningProgress().

{
global $ilDB;
$query = "SELECT * FROM ut_lp_marks ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ".
"AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return (bool) $row->completed;
}
return false;
}

+ Here is the caller graph for this function:

ilLPMarks::_lookupComment (   $a_usr_id,
  $a_obj_id 
)

Definition at line 172 of file class.ilLPMarks.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLearningProgressBaseGUI\__appendLPDetails(), ilWikiContributorsTableGUI\fillRow(), ilExGradesTableGUI\fillRow(), ilObjWikiGUI\infoScreen(), ilObjExerciseGUI\infoScreen(), and ilTrackingTest\testLPMarks().

{
global $ilDB;
$query = "SELECT * FROM ut_lp_marks ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ".
"AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->u_comment;
}
return '';
}

+ Here is the caller graph for this function:

ilLPMarks::_lookupMark (   $a_usr_id,
  $a_obj_id 
)

Definition at line 155 of file class.ilLPMarks.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLearningProgressBaseGUI\__appendLPDetails(), ilObjExercise\exportGradesExcel(), ilWikiContributorsTableGUI\fillRow(), ilExGradesTableGUI\fillRow(), ilExerciseCertificateAdapter\getCertificateVariablesForPresentation(), ilObjWikiGUI\infoScreen(), and ilObjExerciseGUI\infoScreen().

{
global $ilDB;
$query = "SELECT * FROM ut_lp_marks ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id, 'integer')." ".
"AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->mark;
}
return '';
}

+ Here is the caller graph for this function:

static ilLPMarks::deleteObject (   $a_obj_id)
static

Delete object.

Definition at line 71 of file class.ilLPMarks.php.

References $query, and $res.

Referenced by ilEventParticipants\_deleteByEvent(), ilObjectLP\handleDelete(), and ilTrackingTest\testLPMarks().

{
global $ilDB;
$query = "DELETE FROM ut_lp_marks ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id,'integer');
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

ilLPMarks::getComment ( )

Definition at line 98 of file class.ilLPMarks.php.

References $comment.

Referenced by __add(), ilObjWikiGUI\saveGradingObject(), and update().

{
}

+ Here is the caller graph for this function:

ilLPMarks::getCompleted ( )

Definition at line 106 of file class.ilLPMarks.php.

References $completed.

Referenced by __add(), and update().

{
}

+ Here is the caller graph for this function:

ilLPMarks::getMark ( )

Definition at line 90 of file class.ilLPMarks.php.

References $mark.

Referenced by __add(), and update().

{
return $this->mark;
}

+ Here is the caller graph for this function:

ilLPMarks::getObjId ( )

Definition at line 115 of file class.ilLPMarks.php.

References $obj_id.

Referenced by __add(), and update().

{
return (int) $this->obj_id;
}

+ Here is the caller graph for this function:

ilLPMarks::getStatusChanged ( )

Definition at line 110 of file class.ilLPMarks.php.

References $status_changed.

{
}
ilLPMarks::getUserId ( )

Definition at line 81 of file class.ilLPMarks.php.

References $usr_id.

Referenced by __add(), and update().

{
return $this->usr_id;
}

+ Here is the caller graph for this function:

ilLPMarks::ilLPMarks (   $a_obj_id,
  $a_usr_id 
)

Definition at line 53 of file class.ilLPMarks.php.

References __read().

{
global $ilObjDataCache,$ilDB;
$this->db =& $ilDB;
$this->obj_id = $a_obj_id;
$this->usr_id = $a_usr_id;
$this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
$this->__read();
}

+ Here is the call graph for this function:

ilLPMarks::setComment (   $a_comment)

Definition at line 94 of file class.ilLPMarks.php.

{
$this->comment = $a_comment;
}
ilLPMarks::setCompleted (   $a_status)

Definition at line 102 of file class.ilLPMarks.php.

Referenced by ilInfoScreenGUI\saveProgress(), and ilObjCourseGUI\updateLPFromStatus().

{
$this->completed = (bool) $a_status;
}

+ Here is the caller graph for this function:

ilLPMarks::setMark (   $a_mark)

Definition at line 86 of file class.ilLPMarks.php.

{
$this->mark = $a_mark;
}
ilLPMarks::update ( )

Definition at line 120 of file class.ilLPMarks.php.

References $query, $res, __add(), getComment(), getCompleted(), getMark(), getObjId(), and getUserId().

{
global $ilDB;
if(!$this->has_entry)
{
$this->__add();
}
$query = "UPDATE ut_lp_marks ".
"SET mark = ".$ilDB->quote($this->getMark(), 'text').", ".
"u_comment = ".$ilDB->quote($this->getComment() ,'text').", ".
"completed = ".$ilDB->quote($this->getCompleted() ,'integer')." ".
"WHERE obj_id = ".$ilDB->quote($this->getObjId() ,'integer')." ".
"AND usr_id = ".$ilDB->quote($this->getUserId(), 'integer');
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilLPMarks::$comment = ''

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

Referenced by getComment().

ilLPMarks::$completed = false

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

Referenced by getCompleted().

ilLPMarks::$db = null

Definition at line 38 of file class.ilLPMarks.php.

ilLPMarks::$has_entry = false

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

ilLPMarks::$mark = ''

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

Referenced by getMark().

ilLPMarks::$obj_id = null

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

Referenced by getObjId().

ilLPMarks::$obj_type = null

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

ilLPMarks::$status_changed = ''

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

Referenced by getStatusChanged().

ilLPMarks::$usr_id = null

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

Referenced by getUserId().


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