ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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. More...
 
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

◆ __add()

ilLPMarks::__add ( )

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

211 {
212 global $ilDB;
213
214 $query = "INSERT INTO ut_lp_marks (mark,u_comment, completed,obj_id,usr_id) ".
215 "VALUES( ".
216 $ilDB->quote($this->getMark(),'text').", ".
217 $ilDB->quote($this->getComment() ,'text').", ".
218 $ilDB->quote($this->getCompleted() ,'integer').", ".
219 $ilDB->quote($this->getObjId() ,'integer').", ".
220 $ilDB->quote($this->getUserId() ,'integer')." ".
221 ")";
222 $res = $ilDB->manipulate($query);
223 $this->has_entry = true;
224
225 return true;
226 }
global $ilDB

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

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __read()

ilLPMarks::__read ( )

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

190 {
191 global $ilDB;
192
193 $res = $this->db->query("SELECT * FROM ut_lp_marks ".
194 "WHERE obj_id = ".$this->db->quote($this->obj_id ,'integer')." ".
195 "AND usr_id = ".$ilDB->quote($this->usr_id ,'integer'));
196 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
197 {
198 $this->has_entry = true;
199 $this->completed = (int) $row->completed;
200 $this->comment = $row->u_comment;
201 $this->mark = $row->mark;
202 $this->status_changed = $row->status_changed;
203
204 return true;
205 }
206
207 return false;
208 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

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

Referenced by ilLPMarks().

+ Here is the caller graph for this function:

◆ _deleteForUsers()

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

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

229 {
230 global $ilDB;
231
232 $ilDB->manipulate("DELETE FROM ut_lp_marks".
233 " WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer").
234 " AND ".$ilDB->in("usr_id", $a_user_ids, "", "integer"));
235 }

References $ilDB.

Referenced by ilObjectLP\resetLPDataForUserIds().

+ Here is the caller graph for this function:

◆ _getAllUserIds()

static ilLPMarks::_getAllUserIds (   $a_obj_id)
static

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

238 {
239 global $ilDB;
240
241 $res = array();
242
243 $set = $ilDB->query("SELECT usr_id FROM ut_lp_marks".
244 " WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer"));
245 while($row = $ilDB->fetchAssoc($set))
246 {
247 $res[] = $row["usr_id"];
248 }
249
250 return $res;
251 }

References $ilDB, $res, and $row.

Referenced by ilObjectLP\gatherLPUsers().

+ Here is the caller graph for this function:

◆ _hasCompleted()

ilLPMarks::_hasCompleted (   $a_usr_id,
  $a_obj_id 
)

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

140 {
141 global $ilDB;
142
143 $query = "SELECT * FROM ut_lp_marks ".
144 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ".
145 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
146
147 $res = $ilDB->query($query);
148 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
149 {
150 return (bool) $row->completed;
151 }
152 return false;
153 }

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

Referenced by ilInfoScreenGUI\showLearningProgress().

+ Here is the caller graph for this function:

◆ _lookupComment()

ilLPMarks::_lookupComment (   $a_usr_id,
  $a_obj_id 
)

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

173 {
174 global $ilDB;
175
176 $query = "SELECT * FROM ut_lp_marks ".
177 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ".
178 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
179
180 $res = $ilDB->query($query);
181 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
182 {
183 return $row->u_comment;
184 }
185 return '';
186 }

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

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

+ Here is the caller graph for this function:

◆ _lookupMark()

ilLPMarks::_lookupMark (   $a_usr_id,
  $a_obj_id 
)

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

156 {
157 global $ilDB;
158
159 $query = "SELECT * FROM ut_lp_marks ".
160 "WHERE usr_id = ".$ilDB->quote($a_usr_id, 'integer')." ".
161 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
162
163 $res = $ilDB->query($query);
164 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
165 {
166 return $row->mark;
167 }
168 return '';
169 }

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

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

+ Here is the caller graph for this function:

◆ deleteObject()

static ilLPMarks::deleteObject (   $a_obj_id)
static

Delete object.

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

72 {
73 global $ilDB;
74
75 $query = "DELETE FROM ut_lp_marks ".
76 "WHERE obj_id = ".$ilDB->quote($a_obj_id,'integer');
77 $res = $ilDB->manipulate($query);
78 return true;
79 }

References $ilDB, $query, and $res.

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

+ Here is the caller graph for this function:

◆ getComment()

ilLPMarks::getComment ( )

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

99 {
100 return $this->comment;
101 }

References $comment.

Referenced by __add(), and update().

+ Here is the caller graph for this function:

◆ getCompleted()

ilLPMarks::getCompleted ( )

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

107 {
108 return $this->completed;
109 }

References $completed.

Referenced by __add(), and update().

+ Here is the caller graph for this function:

◆ getMark()

ilLPMarks::getMark ( )

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

91 {
92 return $this->mark;
93 }

References $mark.

Referenced by __add(), and update().

+ Here is the caller graph for this function:

◆ getObjId()

ilLPMarks::getObjId ( )

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

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

References $obj_id.

Referenced by __add(), and update().

+ Here is the caller graph for this function:

◆ getStatusChanged()

ilLPMarks::getStatusChanged ( )

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

111 {
113 }

References $status_changed.

◆ getUserId()

ilLPMarks::getUserId ( )

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

82 {
83 return $this->usr_id;
84 }

References $usr_id.

Referenced by __add(), and update().

+ Here is the caller graph for this function:

◆ ilLPMarks()

ilLPMarks::ilLPMarks (   $a_obj_id,
  $a_usr_id 
)

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

54 {
55 global $ilObjDataCache,$ilDB;
56
57 $this->db =& $ilDB;
58
59 $this->obj_id = $a_obj_id;
60 $this->usr_id = $a_usr_id;
61 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
62
63 $this->__read();
64 }

References $ilDB, and __read().

+ Here is the call graph for this function:

◆ setComment()

ilLPMarks::setComment (   $a_comment)

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

95 {
96 $this->comment = $a_comment;
97 }

◆ setCompleted()

ilLPMarks::setCompleted (   $a_status)

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

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

◆ setMark()

ilLPMarks::setMark (   $a_mark)

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

87 {
88 $this->mark = $a_mark;
89 }

◆ update()

ilLPMarks::update ( )

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

121 {
122 global $ilDB;
123
124 if(!$this->has_entry)
125 {
126 $this->__add();
127 }
128 $query = "UPDATE ut_lp_marks ".
129 "SET mark = ".$ilDB->quote($this->getMark(), 'text').", ".
130 "u_comment = ".$ilDB->quote($this->getComment() ,'text').", ".
131 "completed = ".$ilDB->quote($this->getCompleted() ,'integer')." ".
132 "WHERE obj_id = ".$ilDB->quote($this->getObjId() ,'integer')." ".
133 "AND usr_id = ".$ilDB->quote($this->getUserId(), 'integer');
134 $res = $ilDB->manipulate($query);
135 return true;
136 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $comment

ilLPMarks::$comment = ''

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

Referenced by getComment().

◆ $completed

ilLPMarks::$completed = false

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

Referenced by getCompleted().

◆ $db

ilLPMarks::$db = null

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

◆ $has_entry

ilLPMarks::$has_entry = false

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

◆ $mark

ilLPMarks::$mark = ''

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

Referenced by getMark().

◆ $obj_id

ilLPMarks::$obj_id = null

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

Referenced by getObjId().

◆ $obj_type

ilLPMarks::$obj_type = null

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

◆ $status_changed

ilLPMarks::$status_changed = ''

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

Referenced by getStatusChanged().

◆ $usr_id

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: