ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilExAssignmentMemberStatus Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilExAssignmentMemberStatus:

Public Member Functions

 __construct (int $a_ass_id, int $a_user_id)
 
 setNotice (string $a_value)
 
 getNotice ()
 
 setReturned (bool $a_value)
 
 getReturned ()
 
 setSolved (bool $a_value)
 
 getSolved ()
 
 getStatusTime ()
 
 setSent (bool $a_value)
 
 getSent ()
 
 getSentTime ()
 
 setFeedback (bool $a_value)
 
 getFeedback ()
 
 getFeedbackTime ()
 
 setStatus (string $a_value)
 
 getStatus ()
 
 setMark (string $a_value)
 
 getMark ()
 
 setComment (string $a_value)
 
 getComment ()
 
 update ()
 
 getStatusIcon ()
 

Static Public Member Functions

static lookupAnyExerciseSent (int $a_ass_id)
 

Protected Member Functions

 setStatusTime (string $a_value)
 
 setSentTime (string $a_value)
 
 setFeedbackTime (string $a_value)
 
 read ()
 
 getFields ()
 
 postUpdateReturned ()
 
 postUpdateStatus ()
 

Protected Attributes

ilDBInterface $db
 
int $ass_id = 0
 
int $user_id = 0
 
string $notice = ""
 
bool $returned = false
 
bool $solved = false
 
bool $sent = false
 
string $sent_time = ""
 
bool $feedback = false
 
string $feedback_time = ""
 
string $status = "notgraded"
 
string $status_time = ""
 
string $mark = ""
 
string $comment = ""
 
bool $db_exists = false
 
bool $returned_update = false
 
bool $status_update = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Exercise assignment member status

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilExAssignmentMemberStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentMemberStatus::__construct ( int  $a_ass_id,
int  $a_user_id 
)

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

References $DIC, and read().

47  {
48  global $DIC;
49 
50  $this->db = $DIC->database();
51  $this->ass_id = $a_ass_id;
52  $this->user_id = $a_user_id;
53 
54  $this->read();
55  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getComment()

ilExAssignmentMemberStatus::getComment ( )

Definition at line 188 of file class.ilExAssignmentMemberStatus.php.

References $comment.

Referenced by getFields().

188  : string
189  {
190  return $this->comment;
191  }
+ Here is the caller graph for this function:

◆ getFeedback()

ilExAssignmentMemberStatus::getFeedback ( )

Definition at line 140 of file class.ilExAssignmentMemberStatus.php.

References $feedback.

Referenced by getFields().

140  : bool
141  {
142  return $this->feedback;
143  }
+ Here is the caller graph for this function:

◆ getFeedbackTime()

ilExAssignmentMemberStatus::getFeedbackTime ( )

Definition at line 151 of file class.ilExAssignmentMemberStatus.php.

References $feedback_time.

Referenced by getFields().

151  : string
152  {
153  return $this->feedback_time;
154  }
+ Here is the caller graph for this function:

◆ getFields()

ilExAssignmentMemberStatus::getFields ( )
protected

Definition at line 219 of file class.ilExAssignmentMemberStatus.php.

References getComment(), getFeedback(), getFeedbackTime(), getMark(), getNotice(), getReturned(), getSent(), getSentTime(), getSolved(), getStatus(), and getStatusTime().

Referenced by update().

219  : array
220  {
221  return array(
222  "notice" => array("text", $this->getNotice())
223  ,"returned" => array("integer", (int) $this->getReturned())
224  ,"solved" => array("integer", $this->getSolved())
225  ,"status_time" => array("timestamp", $this->getStatusTime())
226  ,"sent" => array("integer", $this->getSent())
227  ,"sent_time" => array("timestamp", $this->getSentTime())
228  ,"feedback_time" => array("timestamp", $this->getFeedbackTime())
229  ,"feedback" => array("integer", (int) $this->getFeedback())
230  ,"status" => array("text", $this->getStatus())
231  ,"mark" => array("text", $this->getMark())
232  ,"u_comment" => array("text", $this->getComment())
233  );
234  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMark()

ilExAssignmentMemberStatus::getMark ( )

Definition at line 178 of file class.ilExAssignmentMemberStatus.php.

References $mark.

Referenced by getFields().

178  : string
179  {
180  return $this->mark;
181  }
+ Here is the caller graph for this function:

◆ getNotice()

ilExAssignmentMemberStatus::getNotice ( )

Definition at line 62 of file class.ilExAssignmentMemberStatus.php.

References $notice.

Referenced by getFields().

62  : string
63  {
64  return $this->notice;
65  }
+ Here is the caller graph for this function:

◆ getReturned()

ilExAssignmentMemberStatus::getReturned ( )

Definition at line 76 of file class.ilExAssignmentMemberStatus.php.

References $returned.

Referenced by getFields().

76  : bool
77  {
78  return $this->returned;
79  }
+ Here is the caller graph for this function:

◆ getSent()

ilExAssignmentMemberStatus::getSent ( )

Definition at line 116 of file class.ilExAssignmentMemberStatus.php.

References $sent.

Referenced by getFields().

116  : bool
117  {
118  return $this->sent;
119  }
+ Here is the caller graph for this function:

◆ getSentTime()

ilExAssignmentMemberStatus::getSentTime ( )

Definition at line 127 of file class.ilExAssignmentMemberStatus.php.

References $sent_time.

Referenced by getFields().

127  : string
128  {
129  return $this->sent_time;
130  }
+ Here is the caller graph for this function:

◆ getSolved()

ilExAssignmentMemberStatus::getSolved ( )
Deprecated:

Definition at line 92 of file class.ilExAssignmentMemberStatus.php.

References $solved.

Referenced by getFields().

92  : bool
93  {
94  return $this->solved;
95  }
+ Here is the caller graph for this function:

◆ getStatus()

ilExAssignmentMemberStatus::getStatus ( )

Definition at line 165 of file class.ilExAssignmentMemberStatus.php.

References $status.

Referenced by ilExGradesTableGUI\fillRow(), getFields(), and getStatusIcon().

165  : string
166  {
167  return $this->status;
168  }
+ Here is the caller graph for this function:

◆ getStatusIcon()

ilExAssignmentMemberStatus::getStatusIcon ( )
Deprecated:
will be deleted with R8

Definition at line 295 of file class.ilExAssignmentMemberStatus.php.

References getStatus().

295  : string
296  {
297  switch ($this->getStatus()) {
298  case "passed":
299  return "scorm/passed.svg";
300 
301  case "failed":
302  return "scorm/failed.svg";
303 
304  default:
305  return "scorm/not_attempted.svg";
306  }
307  }
+ Here is the call graph for this function:

◆ getStatusTime()

ilExAssignmentMemberStatus::getStatusTime ( )

Definition at line 103 of file class.ilExAssignmentMemberStatus.php.

References $status_time.

Referenced by getFields().

103  : string
104  {
105  return $this->status_time;
106  }
+ Here is the caller graph for this function:

◆ lookupAnyExerciseSent()

static ilExAssignmentMemberStatus::lookupAnyExerciseSent ( int  $a_ass_id)
static

Definition at line 310 of file class.ilExAssignmentMemberStatus.php.

References $DIC, and $ilDB.

310  : bool
311  {
312  global $DIC;
313 
314  $ilDB = $DIC->database();
315 
316  $q = "SELECT count(*) AS cnt" .
317  " FROM exc_mem_ass_status" .
318  " WHERE NOT sent_time IS NULL" .
319  " AND ass_id = " . $ilDB->quote($a_ass_id, "integer");
320  $set = $ilDB->query($q);
321  $rec = $ilDB->fetchAssoc($set);
322  return ($rec["cnt"] > 0);
323  }
global $DIC
Definition: feed.php:28

◆ postUpdateReturned()

ilExAssignmentMemberStatus::postUpdateReturned ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 266 of file class.ilExAssignmentMemberStatus.php.

References $db, $ilDB, ilExAssignment\FEEDBACK_DATE_SUBMISSION, and ilExAssignment\sendFeedbackNotifications().

Referenced by update().

266  : void
267  {
268  $ilDB = $this->db;
269 
270  // first upload => notification on submission?
271  $set = $ilDB->query("SELECT fb_cron, fb_date, fb_file" .
272  " FROM exc_assignment" .
273  " WHERE id = " . $ilDB->quote($this->ass_id, "integer"));
274  $row = $ilDB->fetchAssoc($set);
275  if ($row["fb_cron"] &&
276  $row["fb_file"] &&
277  $row["fb_date"] == ilExAssignment::FEEDBACK_DATE_SUBMISSION) { // #16200
278  ilExAssignment::sendFeedbackNotifications($this->ass_id, $this->user_id);
279  }
280  }
static sendFeedbackNotifications(int $a_ass_id, int $a_user_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ postUpdateStatus()

ilExAssignmentMemberStatus::postUpdateStatus ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 285 of file class.ilExAssignmentMemberStatus.php.

References ilObjExercise\updateUserStatus().

Referenced by update().

285  : void
286  {
287  $ass = new ilExAssignment($this->ass_id);
288  $exc = new ilObjExercise($ass->getExerciseId(), false);
289  $exc->updateUserStatus($this->user_id);
290  }
Exercise assignment.
Class ilObjExercise.
updateUserStatus(int $a_user_id=0)
Update exercise status of user.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilExAssignmentMemberStatus::read ( )
protected

Definition at line 193 of file class.ilExAssignmentMemberStatus.php.

References $db, $ilDB, and ILIAS\UI\examples\Symbol\Glyph\Comment\comment().

Referenced by __construct().

193  : void
194  {
195  $ilDB = $this->db;
196 
197  $set = $ilDB->query("SELECT * FROM exc_mem_ass_status" .
198  " WHERE ass_id = " . $ilDB->quote($this->ass_id, "integer") .
199  " AND usr_id = " . $ilDB->quote($this->user_id, "integer"));
200  if ($ilDB->numRows($set)) {
201  $row = $ilDB->fetchAssoc($set);
202 
203  // not using setters to circumvent any datetime-logic/-magic
204  $this->notice = (string) $row["notice"];
205  $this->returned = (bool) $row["returned"];
206  $this->solved = (bool) $row["solved"];
207  $this->status_time = (string) $row["status_time"];
208  $this->sent = (bool) $row["sent"];
209  $this->sent_time = (string) $row["sent_time"];
210  $this->feedback_time = (string) $row["feedback_time"];
211  $this->feedback = (bool) $row["feedback"];
212  $this->status = (string) $row["status"];
213  $this->mark = (string) $row["mark"];
214  $this->comment = (string) $row["u_comment"];
215  $this->db_exists = true;
216  }
217  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setComment()

ilExAssignmentMemberStatus::setComment ( string  $a_value)

Definition at line 183 of file class.ilExAssignmentMemberStatus.php.

References ILIAS\UI\examples\Symbol\Glyph\Comment\comment().

183  : void
184  {
185  $this->comment = $a_value;
186  }
+ Here is the call graph for this function:

◆ setFeedback()

ilExAssignmentMemberStatus::setFeedback ( bool  $a_value)

Definition at line 132 of file class.ilExAssignmentMemberStatus.php.

References ilUtil\now(), and setFeedbackTime().

132  : void
133  {
134  if ($a_value != $this->sent) {
135  $this->setFeedbackTime(ilUtil::now());
136  }
137  $this->feedback = $a_value;
138  }
static now()
Return current timestamp in Y-m-d H:i:s format.
+ Here is the call graph for this function:

◆ setFeedbackTime()

ilExAssignmentMemberStatus::setFeedbackTime ( string  $a_value)
protected

Definition at line 146 of file class.ilExAssignmentMemberStatus.php.

Referenced by setFeedback().

146  : void
147  {
148  $this->feedback_time = $a_value;
149  }
+ Here is the caller graph for this function:

◆ setMark()

ilExAssignmentMemberStatus::setMark ( string  $a_value)

Definition at line 170 of file class.ilExAssignmentMemberStatus.php.

References ilUtil\now(), and setStatusTime().

170  : void
171  {
172  if ($a_value != $this->mark) {
173  $this->setStatusTime(ilUtil::now());
174  }
175  $this->mark = $a_value;
176  }
static now()
Return current timestamp in Y-m-d H:i:s format.
+ Here is the call graph for this function:

◆ setNotice()

ilExAssignmentMemberStatus::setNotice ( string  $a_value)

Definition at line 57 of file class.ilExAssignmentMemberStatus.php.

57  : void
58  {
59  $this->notice = $a_value;
60  }

◆ setReturned()

ilExAssignmentMemberStatus::setReturned ( bool  $a_value)

Definition at line 67 of file class.ilExAssignmentMemberStatus.php.

67  : void
68  {
69  if ($a_value &&
70  !$this->returned) {
71  $this->returned_update = true;
72  }
73  $this->returned = $a_value;
74  }

◆ setSent()

ilExAssignmentMemberStatus::setSent ( bool  $a_value)

Definition at line 108 of file class.ilExAssignmentMemberStatus.php.

References ilUtil\now(), and setSentTime().

108  : void
109  {
110  if ($a_value && $a_value != $this->sent) {
111  $this->setSentTime(ilUtil::now());
112  }
113  $this->sent = $a_value;
114  }
static now()
Return current timestamp in Y-m-d H:i:s format.
+ Here is the call graph for this function:

◆ setSentTime()

ilExAssignmentMemberStatus::setSentTime ( string  $a_value)
protected

Definition at line 122 of file class.ilExAssignmentMemberStatus.php.

Referenced by setSent().

122  : void
123  {
124  $this->sent_time = $a_value;
125  }
+ Here is the caller graph for this function:

◆ setSolved()

ilExAssignmentMemberStatus::setSolved ( bool  $a_value)
Deprecated:

Definition at line 84 of file class.ilExAssignmentMemberStatus.php.

84  : void
85  {
86  $this->solved = $a_value;
87  }

◆ setStatus()

ilExAssignmentMemberStatus::setStatus ( string  $a_value)

Definition at line 156 of file class.ilExAssignmentMemberStatus.php.

References ilUtil\now(), and setStatusTime().

156  : void
157  {
158  if ($a_value != $this->status) {
159  $this->setStatusTime(ilUtil::now());
160  $this->status = $a_value;
161  $this->status_update = true;
162  }
163  }
static now()
Return current timestamp in Y-m-d H:i:s format.
+ Here is the call graph for this function:

◆ setStatusTime()

ilExAssignmentMemberStatus::setStatusTime ( string  $a_value)
protected

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

Referenced by setMark(), and setStatus().

98  : void
99  {
100  $this->status_time = $a_value;
101  }
+ Here is the caller graph for this function:

◆ update()

ilExAssignmentMemberStatus::update ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 239 of file class.ilExAssignmentMemberStatus.php.

References $db, $ilDB, $keys, getFields(), postUpdateReturned(), and postUpdateStatus().

239  : void
240  {
241  $ilDB = $this->db;
242 
243  $keys = array(
244  "ass_id" => array("integer", $this->ass_id)
245  ,"usr_id" => array("integer", $this->user_id)
246  );
247  $fields = $this->getFields();
248  if (!$this->db_exists) {
249  $fields = array_merge($keys, $fields);
250  $ilDB->insert("exc_mem_ass_status", $fields);
251  } else {
252  $ilDB->update("exc_mem_ass_status", $fields, $keys);
253  }
254 
255  if ($this->returned_update) {
256  $this->postUpdateReturned();
257  }
258  if ($this->status_update) {
259  $this->postUpdateStatus();
260  }
261  }
$keys
Definition: metadata.php:204
+ Here is the call graph for this function:

Field Documentation

◆ $ass_id

int ilExAssignmentMemberStatus::$ass_id = 0
protected

Definition at line 29 of file class.ilExAssignmentMemberStatus.php.

◆ $comment

string ilExAssignmentMemberStatus::$comment = ""
protected

Definition at line 41 of file class.ilExAssignmentMemberStatus.php.

Referenced by getComment().

◆ $db

ilDBInterface ilExAssignmentMemberStatus::$db
protected

Definition at line 27 of file class.ilExAssignmentMemberStatus.php.

Referenced by postUpdateReturned(), read(), and update().

◆ $db_exists

bool ilExAssignmentMemberStatus::$db_exists = false
protected

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

◆ $feedback

bool ilExAssignmentMemberStatus::$feedback = false
protected

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

Referenced by getFeedback().

◆ $feedback_time

string ilExAssignmentMemberStatus::$feedback_time = ""
protected

Definition at line 37 of file class.ilExAssignmentMemberStatus.php.

Referenced by getFeedbackTime().

◆ $mark

string ilExAssignmentMemberStatus::$mark = ""
protected

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

Referenced by getMark().

◆ $notice

string ilExAssignmentMemberStatus::$notice = ""
protected

Definition at line 31 of file class.ilExAssignmentMemberStatus.php.

Referenced by getNotice().

◆ $returned

bool ilExAssignmentMemberStatus::$returned = false
protected

Definition at line 32 of file class.ilExAssignmentMemberStatus.php.

Referenced by getReturned().

◆ $returned_update

bool ilExAssignmentMemberStatus::$returned_update = false
protected

Definition at line 43 of file class.ilExAssignmentMemberStatus.php.

◆ $sent

bool ilExAssignmentMemberStatus::$sent = false
protected

Definition at line 34 of file class.ilExAssignmentMemberStatus.php.

Referenced by getSent().

◆ $sent_time

string ilExAssignmentMemberStatus::$sent_time = ""
protected

Definition at line 35 of file class.ilExAssignmentMemberStatus.php.

Referenced by getSentTime().

◆ $solved

bool ilExAssignmentMemberStatus::$solved = false
protected

Definition at line 33 of file class.ilExAssignmentMemberStatus.php.

Referenced by getSolved().

◆ $status

string ilExAssignmentMemberStatus::$status = "notgraded"
protected

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

Referenced by getStatus().

◆ $status_time

string ilExAssignmentMemberStatus::$status_time = ""
protected

Definition at line 39 of file class.ilExAssignmentMemberStatus.php.

Referenced by getStatusTime().

◆ $status_update

bool ilExAssignmentMemberStatus::$status_update = false
protected

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

◆ $user_id

int ilExAssignmentMemberStatus::$user_id = 0
protected

Definition at line 30 of file class.ilExAssignmentMemberStatus.php.


The documentation for this class was generated from the following file: