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 () | |
Data Fields | |
$db = null | |
$obj_id = null | |
$usr_id = null | |
$obj_type = null | |
$completed = false | |
$comment = '' | |
$mark = '' | |
$has_entry = false |
Definition at line 36 of file class.ilLPMarks.php.
ilLPMarks::__add | ( | ) |
Definition at line 187 of file class.ilLPMarks.php.
References $query, getComment(), getCompleted(), and getMark().
Referenced by update().
{ $query = "INSERT INTO ut_lp_marks ". "SET mark = '".ilUtil::prepareDBString($this->getMark())."', ". "comment = '".ilUtil::prepareDBString($this->getComment())."', ". "completed = '".(int) $this->getCompleted()."', ". "obj_id = '".$this->getObjId()."', ". "usr_id = '".$this->getUserId()."'"; $this->db->query($query); $this->has_entry = true; return true; }
ilLPMarks::__read | ( | ) |
Definition at line 169 of file class.ilLPMarks.php.
Referenced by ilLPMarks().
{ $res = $this->db->query("SELECT * FROM ut_lp_marks ". "WHERE obj_id = ".$this->db->quote($this->obj_id)." ". "AND usr_id = '".(int) $this->usr_id."'"); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $this->has_entry = true; $this->completed = (int) $row->completed; $this->comment = $row->comment; $this->mark = $row->mark; return true; } return false; }
ilLPMarks::_hasCompleted | ( | $ | a_usr_id, | |
$ | a_obj_id | |||
) |
Definition at line 119 of file class.ilLPMarks.php.
References $query, $res, and $row.
Referenced by ilInfoScreenGUI::showLearningProgress().
{ global $ilDB; $query = "SELECT * FROM ut_lp_marks ". "WHERE usr_id = '".$a_usr_id."' ". "AND obj_id = '".$a_obj_id."'"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { return (bool) $row->completed; } return false; }
ilLPMarks::_lookupComment | ( | $ | a_usr_id, | |
$ | a_obj_id | |||
) |
Definition at line 152 of file class.ilLPMarks.php.
References $query, $res, and $row.
Referenced by ilLearningProgressBaseGUI::__appendLPDetails(), ilLPObjectItemListGUI::__readComment(), ilObjExerciseGUI::infoScreen(), and ilObjExerciseGUI::membersObject().
{ global $ilDB; $query = "SELECT * FROM ut_lp_marks ". "WHERE usr_id = '".$a_usr_id."' ". "AND obj_id = '".$a_obj_id."'"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { return $row->comment; } return ''; }
ilLPMarks::_lookupMark | ( | $ | a_usr_id, | |
$ | a_obj_id | |||
) |
Definition at line 135 of file class.ilLPMarks.php.
References $query, $res, and $row.
Referenced by ilLearningProgressBaseGUI::__appendLPDetails(), ilLPObjectItemListGUI::__readMark(), ilObjExerciseGUI::__saveStatus(), ilObjExerciseGUI::infoScreen(), and ilObjExerciseGUI::membersObject().
{ global $ilDB; $query = "SELECT * FROM ut_lp_marks ". "WHERE usr_id = '".$a_usr_id."' ". "AND obj_id = '".$a_obj_id."'"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { return $row->mark; } return ''; }
ilLPMarks::getComment | ( | ) |
Definition at line 82 of file class.ilLPMarks.php.
Referenced by __add(), and update().
{
return $this->comment;
}
ilLPMarks::getCompleted | ( | ) |
Definition at line 90 of file class.ilLPMarks.php.
Referenced by __add(), and update().
{
return $this->completed;
}
ilLPMarks::getMark | ( | ) |
Definition at line 74 of file class.ilLPMarks.php.
Referenced by __add(), and update().
{
return $this->mark;
}
ilLPMarks::getObjId | ( | ) |
Definition at line 95 of file class.ilLPMarks.php.
{ return (int) $this->obj_id; }
ilLPMarks::getUserId | ( | ) |
Definition at line 65 of file class.ilLPMarks.php.
{
return $this->usr_id;
}
ilLPMarks::ilLPMarks | ( | $ | a_obj_id, | |
$ | a_usr_id | |||
) |
Definition at line 52 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(); }
ilLPMarks::setComment | ( | $ | a_comment | ) |
Definition at line 78 of file class.ilLPMarks.php.
{ $this->comment = $a_comment; }
ilLPMarks::setCompleted | ( | $ | a_status | ) |
Definition at line 86 of file class.ilLPMarks.php.
{ $this->completed = (bool) $a_status; }
ilLPMarks::setMark | ( | $ | a_mark | ) |
Definition at line 70 of file class.ilLPMarks.php.
{ $this->mark = $a_mark; }
ilLPMarks::update | ( | ) |
Definition at line 100 of file class.ilLPMarks.php.
References $query, __add(), getComment(), getCompleted(), and getMark().
{ if(!$this->has_entry) { $this->__add(); } $query = "UPDATE ut_lp_marks ". "SET mark = '".ilUtil::prepareDBString($this->getMark())."', ". "comment = '".ilUtil::prepareDBString($this->getComment())."', ". "completed = '".(int) $this->getCompleted()."' ". "WHERE obj_id = '".$this->getObjId()."' ". "AND usr_id = '".$this->getUserId()."'"; $this->db->query($query); return true; }
ilLPMarks::$comment = '' |
Definition at line 45 of file class.ilLPMarks.php.
ilLPMarks::$completed = false |
Definition at line 44 of file class.ilLPMarks.php.
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.
ilLPMarks::$obj_id = null |
Definition at line 40 of file class.ilLPMarks.php.
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.