ILIAS  Release_4_1_x_branch Revision 61804
 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 ()
 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.

Data Fields

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

Detailed Description

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

Member Function Documentation

ilLPMarks::__add ( )

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

References $ilDB, $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 184 of file class.ilLPMarks.php.

References $ilDB, $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;
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilLPMarks::_hasCompleted (   $a_usr_id,
  $a_obj_id 
)

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

References $ilDB, $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 167 of file class.ilLPMarks.php.

References $ilDB, $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 150 of file class.ilLPMarks.php.

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

Referenced by ilLearningProgressBaseGUI\__appendLPDetails(), ilObjExercise\exportGradesExcel(), ilWikiContributorsTableGUI\fillRow(), ilExGradesTableGUI\fillRow(), 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 70 of file class.ilLPMarks.php.

References $ilDB, $query, and $res.

Referenced by ilEventParticipants\_deleteByEvent(), 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 97 of file class.ilLPMarks.php.

References $comment.

Referenced by __add(), and update().

{
}

+ Here is the caller graph for this function:

ilLPMarks::getCompleted ( )

Definition at line 105 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 89 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 110 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::getUserId ( )

Definition at line 80 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 52 of file class.ilLPMarks.php.

References $ilDB, and __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 93 of file class.ilLPMarks.php.

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

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

Referenced by ilInfoScreenGUI\saveProgress().

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

+ Here is the caller graph for this function:

ilLPMarks::setMark (   $a_mark)

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

Referenced by ilObjWikiGUI\saveGradingObject().

{
$this->mark = $a_mark;
}

+ Here is the caller graph for this function:

ilLPMarks::update ( )

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

References $ilDB, $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 48 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::$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: