ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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

ILIAS Exercise Assignment DomainService $ass_domain
 
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 47 of file class.ilExAssignmentMemberStatus.php.

48 {
49 global $DIC;
50
51 $this->db = $DIC->database();
52 $this->ass_id = $a_ass_id;
53 $this->user_id = $a_user_id;
54
55 $this->read();
56 $this->ass_domain = $DIC->exercise()->internal()->domain()->assignment();
57 }
global $DIC
Definition: shib_login.php:26

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ getComment()

ilExAssignmentMemberStatus::getComment ( )

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

190 : string
191 {
192 return $this->comment;
193 }

References $comment.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFeedback()

ilExAssignmentMemberStatus::getFeedback ( )

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

142 : bool
143 {
144 return $this->feedback;
145 }

References $feedback.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFeedbackTime()

ilExAssignmentMemberStatus::getFeedbackTime ( )

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

153 : string
154 {
156 }

References $feedback_time.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFields()

ilExAssignmentMemberStatus::getFields ( )
protected

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

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

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 180 of file class.ilExAssignmentMemberStatus.php.

180 : string
181 {
182 return $this->mark;
183 }

References $mark.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getNotice()

ilExAssignmentMemberStatus::getNotice ( )

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

64 : string
65 {
66 return $this->notice;
67 }

References $notice.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getReturned()

ilExAssignmentMemberStatus::getReturned ( )

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

78 : bool
79 {
80 return $this->returned;
81 }

References $returned.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSent()

ilExAssignmentMemberStatus::getSent ( )

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

118 : bool
119 {
120 return $this->sent;
121 }

References $sent.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSentTime()

ilExAssignmentMemberStatus::getSentTime ( )

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

129 : string
130 {
131 return $this->sent_time;
132 }

References $sent_time.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSolved()

ilExAssignmentMemberStatus::getSolved ( )
Deprecated:

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

94 : bool
95 {
96 return $this->solved;
97 }

References $solved.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getStatus()

ilExAssignmentMemberStatus::getStatus ( )

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

167 : string
168 {
169 return $this->status;
170 }

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 298 of file class.ilExAssignmentMemberStatus.php.

298 : string
299 {
300 switch ($this->getStatus()) {
301 case "passed":
302 return "scorm/passed.svg";
303
304 case "failed":
305 return "scorm/failed.svg";
306
307 default:
308 return "scorm/not_attempted.svg";
309 }
310 }

References getStatus().

+ Here is the call graph for this function:

◆ getStatusTime()

ilExAssignmentMemberStatus::getStatusTime ( )

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

105 : string
106 {
107 return $this->status_time;
108 }

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 313 of file class.ilExAssignmentMemberStatus.php.

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

References $DIC, $ilDB, and $q.

◆ postUpdateReturned()

ilExAssignmentMemberStatus::postUpdateReturned ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException

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

269 : void
270 {
272
273 // first upload => notification on submission?
274 $set = $ilDB->query("SELECT fb_cron, fb_date, fb_file" .
275 " FROM exc_assignment" .
276 " WHERE id = " . $ilDB->quote($this->ass_id, "integer"));
277 $row = $ilDB->fetchAssoc($set);
278 if ($row["fb_cron"] &&
279 $row["fb_file"] &&
280 $row["fb_date"] == ilExAssignment::FEEDBACK_DATE_SUBMISSION) { // #16200
281 ilExAssignment::sendFeedbackNotifications($this->ass_id, $this->user_id);
282 }
283 }
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 288 of file class.ilExAssignmentMemberStatus.php.

288 : void
289 {
290 $ass = new ilExAssignment($this->ass_id);
291 $exc = new ilObjExercise($ass->getExerciseId(), false);
292 $exc->updateUserStatus($this->user_id);
293 }
Exercise assignment.
Class ilObjExercise.

Referenced by update().

+ Here is the caller graph for this function:

◆ read()

ilExAssignmentMemberStatus::read ( )
protected

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

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

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 185 of file class.ilExAssignmentMemberStatus.php.

185 : void
186 {
187 $this->comment = $a_value;
188 }

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 134 of file class.ilExAssignmentMemberStatus.php.

134 : void
135 {
136 if ($a_value != $this->sent) {
138 }
139 $this->feedback = $a_value;
140 }
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 148 of file class.ilExAssignmentMemberStatus.php.

148 : void
149 {
150 $this->feedback_time = $a_value;
151 }

Referenced by setFeedback().

+ Here is the caller graph for this function:

◆ setMark()

ilExAssignmentMemberStatus::setMark ( string  $a_value)

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

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

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

+ Here is the call graph for this function:

◆ setNotice()

ilExAssignmentMemberStatus::setNotice ( string  $a_value)

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

59 : void
60 {
61 $this->notice = $a_value;
62 }

◆ setReturned()

ilExAssignmentMemberStatus::setReturned ( bool  $a_value)

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

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

◆ setSent()

ilExAssignmentMemberStatus::setSent ( bool  $a_value)

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

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

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

+ Here is the call graph for this function:

◆ setSentTime()

ilExAssignmentMemberStatus::setSentTime ( string  $a_value)
protected

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

124 : void
125 {
126 $this->sent_time = $a_value;
127 }

Referenced by setSent().

+ Here is the caller graph for this function:

◆ setSolved()

ilExAssignmentMemberStatus::setSolved ( bool  $a_value)
Deprecated:

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

86 : void
87 {
88 $this->solved = $a_value;
89 }

◆ setStatus()

ilExAssignmentMemberStatus::setStatus ( string  $a_value)

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

158 : void
159 {
160 if ($a_value != $this->status) {
161 $this->setStatusTime(ilUtil::now());
162 $this->status = $a_value;
163 $this->status_update = true;
164 }
165 }

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

+ Here is the call graph for this function:

◆ setStatusTime()

ilExAssignmentMemberStatus::setStatusTime ( string  $a_value)
protected

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

100 : void
101 {
102 $this->status_time = $a_value;
103 }

Referenced by setMark(), and setStatus().

+ Here is the caller graph for this function:

◆ update()

ilExAssignmentMemberStatus::update ( )
Exceptions
ilExcUnknownAssignmentTypeException

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

241 : void
242 {
244
245 $keys = array(
246 "ass_id" => array("integer", $this->ass_id)
247 ,"usr_id" => array("integer", $this->user_id)
248 );
249 $fields = $this->getFields();
250 if (!$this->db_exists) {
251 $fields = array_merge($keys, $fields);
252 $ilDB->insert("exc_mem_ass_status", $fields);
253 $this->ass_domain->tutorFeedbackFile($this->ass_id)->createCollection($this->user_id);
254 } else {
255 $ilDB->update("exc_mem_ass_status", $fields, $keys);
256 }
257
258 if ($this->returned_update) {
259 $this->postUpdateReturned();
260 }
261 if ($this->status_update) {
262 $this->postUpdateStatus();
263 }
264 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $ass_domain

ILIAS Exercise Assignment DomainService ilExAssignmentMemberStatus::$ass_domain
protected

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

◆ $ass_id

int ilExAssignmentMemberStatus::$ass_id = 0
protected

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

◆ $comment

string ilExAssignmentMemberStatus::$comment = ""
protected

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

Referenced by getComment().

◆ $db

ilDBInterface ilExAssignmentMemberStatus::$db
protected

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

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

◆ $db_exists

bool ilExAssignmentMemberStatus::$db_exists = false
protected

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

◆ $feedback

bool ilExAssignmentMemberStatus::$feedback = false
protected

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

Referenced by getFeedback().

◆ $feedback_time

string ilExAssignmentMemberStatus::$feedback_time = ""
protected

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

Referenced by getFeedbackTime().

◆ $mark

string ilExAssignmentMemberStatus::$mark = ""
protected

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

Referenced by getMark().

◆ $notice

string ilExAssignmentMemberStatus::$notice = ""
protected

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

Referenced by getNotice().

◆ $returned

bool ilExAssignmentMemberStatus::$returned = false
protected

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

Referenced by getReturned().

◆ $returned_update

bool ilExAssignmentMemberStatus::$returned_update = false
protected

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

◆ $sent

bool ilExAssignmentMemberStatus::$sent = false
protected

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

Referenced by getSent().

◆ $sent_time

string ilExAssignmentMemberStatus::$sent_time = ""
protected

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

Referenced by getSentTime().

◆ $solved

bool ilExAssignmentMemberStatus::$solved = false
protected

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

Referenced by getSolved().

◆ $status

string ilExAssignmentMemberStatus::$status = "notgraded"
protected

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

Referenced by getStatus().

◆ $status_time

string ilExAssignmentMemberStatus::$status_time = ""
protected

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

Referenced by getStatusTime().

◆ $status_update

bool ilExAssignmentMemberStatus::$status_update = false
protected

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

◆ $user_id

int ilExAssignmentMemberStatus::$user_id = 0
protected

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


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