ILIAS  release_8 Revision v8.24
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.

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

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ getComment()

ilExAssignmentMemberStatus::getComment ( )

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

188 : string
189 {
190 return $this->comment;
191 }

References $comment.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFeedback()

ilExAssignmentMemberStatus::getFeedback ( )

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

140 : bool
141 {
142 return $this->feedback;
143 }

References $feedback.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFeedbackTime()

ilExAssignmentMemberStatus::getFeedbackTime ( )

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

151 : string
152 {
154 }

References $feedback_time.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFields()

ilExAssignmentMemberStatus::getFields ( )
protected

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

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 }

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

Referenced by update().

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

178 : string
179 {
180 return $this->mark;
181 }

References $mark.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getNotice()

ilExAssignmentMemberStatus::getNotice ( )

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

62 : string
63 {
64 return $this->notice;
65 }

References $notice.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getReturned()

ilExAssignmentMemberStatus::getReturned ( )

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

76 : bool
77 {
78 return $this->returned;
79 }

References $returned.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSent()

ilExAssignmentMemberStatus::getSent ( )

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

116 : bool
117 {
118 return $this->sent;
119 }

References $sent.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSentTime()

ilExAssignmentMemberStatus::getSentTime ( )

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

127 : string
128 {
129 return $this->sent_time;
130 }

References $sent_time.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSolved()

ilExAssignmentMemberStatus::getSolved ( )
Deprecated:

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

92 : bool
93 {
94 return $this->solved;
95 }

References $solved.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getStatus()

ilExAssignmentMemberStatus::getStatus ( )

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

165 : string
166 {
167 return $this->status;
168 }

References $status.

Referenced by getFields(), and getStatusIcon().

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

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 }

References getStatus().

+ Here is the call graph for this function:

◆ getStatusTime()

ilExAssignmentMemberStatus::getStatusTime ( )

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

103 : string
104 {
105 return $this->status_time;
106 }

References $status_time.

Referenced by getFields().

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

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 }

References $DIC, and $ilDB.

◆ postUpdateReturned()

ilExAssignmentMemberStatus::postUpdateReturned ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException

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

266 : void
267 {
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)

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

Referenced by update().

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

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.

Referenced by update().

+ Here is the caller graph for this function:

◆ read()

ilExAssignmentMemberStatus::read ( )
protected

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

193 : void
194 {
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 }

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

Referenced by __construct().

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

183 : void
184 {
185 $this->comment = $a_value;
186 }

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

+ Here is the call graph for this function:

◆ setFeedback()

ilExAssignmentMemberStatus::setFeedback ( bool  $a_value)

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

132 : void
133 {
134 if ($a_value != $this->sent) {
136 }
137 $this->feedback = $a_value;
138 }
static now()
Return current timestamp in Y-m-d H:i:s format.

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

+ Here is the call graph for this function:

◆ setFeedbackTime()

ilExAssignmentMemberStatus::setFeedbackTime ( string  $a_value)
protected

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

146 : void
147 {
148 $this->feedback_time = $a_value;
149 }

Referenced by setFeedback().

+ Here is the caller graph for this function:

◆ setMark()

ilExAssignmentMemberStatus::setMark ( string  $a_value)

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

170 : void
171 {
172 if ($a_value != $this->mark) {
173 $this->setStatusTime(ilUtil::now());
174 }
175 $this->mark = $a_value;
176 }

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

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

108 : void
109 {
110 if ($a_value && $a_value != $this->sent) {
111 $this->setSentTime(ilUtil::now());
112 }
113 $this->sent = $a_value;
114 }

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

+ Here is the call graph for this function:

◆ setSentTime()

ilExAssignmentMemberStatus::setSentTime ( string  $a_value)
protected

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

122 : void
123 {
124 $this->sent_time = $a_value;
125 }

Referenced by setSent().

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

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 }

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

+ Here is the call graph for this function:

◆ setStatusTime()

ilExAssignmentMemberStatus::setStatusTime ( string  $a_value)
protected

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

98 : void
99 {
100 $this->status_time = $a_value;
101 }

Referenced by setMark(), and setStatus().

+ Here is the caller graph for this function:

◆ update()

ilExAssignmentMemberStatus::update ( )
Exceptions
ilExcUnknownAssignmentTypeException

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

239 : void
240 {
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

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

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