ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 205 of file class.ilLPMarks.php.

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

Referenced by update().

206  {
207  global $ilDB;
208 
209  $query = "INSERT INTO ut_lp_marks (mark,u_comment, completed,obj_id,usr_id) " .
210  "VALUES( " .
211  $ilDB->quote($this->getMark(), 'text') . ", " .
212  $ilDB->quote($this->getComment(), 'text') . ", " .
213  $ilDB->quote($this->getCompleted(), 'integer') . ", " .
214  $ilDB->quote($this->getObjId(), 'integer') . ", " .
215  $ilDB->quote($this->getUserId(), 'integer') . " " .
216  ")";
217  $res = $ilDB->manipulate($query);
218  $this->has_entry = true;
219 
220  return true;
221  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __read()

ilLPMarks::__read ( )

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

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

Referenced by __construct().

186  {
187  global $ilDB;
188 
189  $res = $this->db->query("SELECT * FROM ut_lp_marks " .
190  "WHERE obj_id = " . $this->db->quote($this->obj_id, 'integer') . " " .
191  "AND usr_id = " . $ilDB->quote($this->usr_id, 'integer'));
192  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
193  $this->has_entry = true;
194  $this->completed = (int) $row->completed;
195  $this->comment = $row->u_comment;
196  $this->mark = $row->mark;
197  $this->status_changed = $row->status_changed;
198 
199  return true;
200  }
201 
202  return false;
203  }
foreach($_POST as $key=> $value) $res
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 223 of file class.ilLPMarks.php.

References $ilDB.

Referenced by ilObjectLP\resetLPDataForUserIds().

224  {
225  global $ilDB;
226 
227  $ilDB->manipulate("DELETE FROM ut_lp_marks" .
228  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer") .
229  " AND " . $ilDB->in("usr_id", $a_user_ids, "", "integer"));
230  }
global $ilDB
+ Here is the caller graph for this function:

◆ _getAllUserIds()

static ilLPMarks::_getAllUserIds (   $a_obj_id)
static

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

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

Referenced by ilObjectLP\gatherLPUsers().

233  {
234  global $ilDB;
235 
236  $res = array();
237 
238  $set = $ilDB->query("SELECT usr_id FROM ut_lp_marks" .
239  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer"));
240  while ($row = $ilDB->fetchAssoc($set)) {
241  $res[] = $row["usr_id"];
242  }
243 
244  return $res;
245  }
foreach($_POST as $key=> $value) $res
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 138 of file class.ilLPMarks.php.

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

Referenced by ilInfoScreenGUI\showLearningProgress().

139  {
140  global $ilDB;
141 
142  $query = "SELECT * FROM ut_lp_marks " .
143  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
144  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
145 
146  $res = $ilDB->query($query);
147  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
148  return (bool) $row->completed;
149  }
150  return false;
151  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupComment()

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

Definition at line 169 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().

170  {
171  global $ilDB;
172 
173  $query = "SELECT * FROM ut_lp_marks " .
174  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
175  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
176 
177  $res = $ilDB->query($query);
178  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
179  return $row->u_comment;
180  }
181  return '';
182  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupMark()

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

Definition at line 153 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().

154  {
155  global $ilDB;
156 
157  $query = "SELECT * FROM ut_lp_marks " .
158  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
159  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
160 
161  $res = $ilDB->query($query);
162  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
163  return $row->mark;
164  }
165  return '';
166  }
foreach($_POST as $key=> $value) $res
$query
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  }
foreach($_POST as $key=> $value) $res
$query
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  $this->__add();
126  }
127  $query = "UPDATE ut_lp_marks " .
128  "SET mark = " . $ilDB->quote($this->getMark(), 'text') . ", " .
129  "u_comment = " . $ilDB->quote($this->getComment(), 'text') . ", " .
130  "completed = " . $ilDB->quote($this->getCompleted(), 'integer') . " " .
131  "WHERE obj_id = " . $ilDB->quote($this->getObjId(), 'integer') . " " .
132  "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer');
133  $res = $ilDB->manipulate($query);
134  return true;
135  }
foreach($_POST as $key=> $value) $res
$query
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: