ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilLPMarks Class Reference
+ Collaboration diagram for ilLPMarks:

Public Member Functions

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

Static Public Member Functions

static deleteObject ($a_obj_id)
 Delete object. More...
 
static _hasCompleted ($a_usr_id, $a_obj_id)
 
static _lookupMark ($a_usr_id, $a_obj_id)
 
static _lookupComment ($a_usr_id, $a_obj_id)
 
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.

Constructor & Destructor Documentation

◆ __construct()

ilLPMarks::__construct (   $a_obj_id,
  $a_usr_id 
)

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

References $ilDB, and __read().

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  }
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ __add()

ilLPMarks::__add ( )

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

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

Referenced by update().

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
+ 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.

References $ilDB, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by __construct().

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(ilDBConstants::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  }
global $ilDB
+ 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.

References $ilDB.

Referenced by ilObjectLP\resetLPDataForUserIds().

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  }
global $ilDB
+ 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.

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

Referenced by ilObjectLP\gatherLPUsers().

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  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _hasCompleted()

static ilLPMarks::_hasCompleted (   $a_usr_id,
  $a_obj_id 
)
static

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

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilInfoScreenGUI\showLearningProgress().

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(ilDBConstants::FETCHMODE_OBJECT))
149  {
150  return (bool) $row->completed;
151  }
152  return false;
153  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupComment()

static ilLPMarks::_lookupComment (   $a_usr_id,
  $a_obj_id 
)
static

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

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

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

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(ilDBConstants::FETCHMODE_OBJECT))
182  {
183  return $row->u_comment;
184  }
185  return '';
186  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupMark()

static ilLPMarks::_lookupMark (   $a_usr_id,
  $a_obj_id 
)
static

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

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

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

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(ilDBConstants::FETCHMODE_OBJECT))
165  {
166  return $row->mark;
167  }
168  return '';
169  }
global $ilDB
+ 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.

References $ilDB, $query, and $res.

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

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  }
global $ilDB
+ Here is the caller graph for this function:

◆ getComment()

ilLPMarks::getComment ( )

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

References $comment.

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

99  {
100  return $this->comment;
101  }
+ Here is the caller graph for this function:

◆ getCompleted()

ilLPMarks::getCompleted ( )

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

References $completed.

Referenced by __add(), and update().

107  {
108  return $this->completed;
109  }
+ Here is the caller graph for this function:

◆ getMark()

ilLPMarks::getMark ( )

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

References $mark.

Referenced by __add(), and update().

91  {
92  return $this->mark;
93  }
+ Here is the caller graph for this function:

◆ getObjId()

ilLPMarks::getObjId ( )

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

References $obj_id.

Referenced by __add(), and update().

116  {
117  return (int) $this->obj_id;
118  }
+ Here is the caller graph for this function:

◆ getStatusChanged()

ilLPMarks::getStatusChanged ( )

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

References $status_changed.

111  {
112  return $this->status_changed;
113  }

◆ getUserId()

ilLPMarks::getUserId ( )

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

References $usr_id.

Referenced by __add(), and update().

82  {
83  return $this->usr_id;
84  }
+ Here is the caller graph for this function:

◆ setComment()

ilLPMarks::setComment (   $a_comment)

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

References comment().

95  {
96  $this->comment = $a_comment;
97  }
comment()
Definition: comment.php:2
+ Here is the call graph for this function:

◆ setCompleted()

ilLPMarks::setCompleted (   $a_status)

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

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

103  {
104  $this->completed = (bool) $a_status;
105  }
+ Here is the caller graph for this function:

◆ 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.

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

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  }
global $ilDB
+ 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: