ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilExAssignmentMemberStatus Class Reference

Exercise assignment member status. More...

+ Collaboration diagram for ilExAssignmentMemberStatus:

Public Member Functions

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

Static Public Member Functions

static lookupAnyExerciseSent ($a_ass_id)
 Check whether exercise has been sent to any student per mail. More...
 

Protected Member Functions

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

Protected Attributes

 $ass_id
 
 $user_id
 
 $notice
 
 $returned
 
 $solved
 
 $sent
 
 $sent_time
 
 $feedback
 
 $feedback_time
 
 $status = "notgraded"
 
 $status_time
 
 $mark
 
 $comment
 
 $db_exists
 
 $returned_update
 
 $status_update
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentMemberStatus::__construct (   $a_ass_id,
  $a_user_id 
)

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

References read().

30  {
31  $this->ass_id = $a_ass_id;
32  $this->user_id = $a_user_id;
33 
34  $this->read();
35  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getComment()

ilExAssignmentMemberStatus::getComment ( )

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

References $comment.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFeedback()

ilExAssignmentMemberStatus::getFeedback ( )

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

References $feedback.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFeedbackTime()

ilExAssignmentMemberStatus::getFeedbackTime ( )

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

References $feedback_time.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFields()

ilExAssignmentMemberStatus::getFields ( )
protected

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

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

Referenced by update().

197  {
198  return array(
199  "notice" => array("text", $this->getNotice())
200  ,"returned" => array("integer", $this->getReturned())
201  ,"solved" => array("integer", $this->getSolved())
202  ,"status_time" => array("timestamp", $this->getStatusTime())
203  ,"sent" => array("integer", $this->getSent())
204  ,"sent_time" => array("timestamp", $this->getSentTime())
205  ,"feedback_time" => array("timestamp", $this->getFeedbackTime())
206  ,"feedback" => array("integer", $this->getFeedback())
207  ,"status" => array("text", $this->getStatus())
208  ,"mark" => array("text", $this->getMark())
209  ,"u_comment" => array("text", $this->getComment())
210  );
211  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMark()

ilExAssignmentMemberStatus::getMark ( )

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

References $mark.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getNotice()

ilExAssignmentMemberStatus::getNotice ( )

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

References $notice.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getReturned()

ilExAssignmentMemberStatus::getReturned ( )

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

References $returned.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSent()

ilExAssignmentMemberStatus::getSent ( )

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

References $sent.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSentTime()

ilExAssignmentMemberStatus::getSentTime ( )

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

References $sent_time.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSolved()

ilExAssignmentMemberStatus::getSolved ( )

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

References $solved.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getStatus()

ilExAssignmentMemberStatus::getStatus ( )

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

References $status.

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

+ Here is the caller graph for this function:

◆ getStatusIcon()

ilExAssignmentMemberStatus::getStatusIcon ( )

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

References getStatus().

269  {
270  switch($this->getStatus())
271  {
272  case "passed":
273  return "scorm/passed.svg";
274 
275  case "failed":
276  return "scorm/failed.svg";
277 
278  default:
279  return "scorm/not_attempted.svg";
280  }
281  }
+ Here is the call graph for this function:

◆ getStatusTime()

ilExAssignmentMemberStatus::getStatusTime ( )

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

References $status_time.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ lookupAnyExerciseSent()

static ilExAssignmentMemberStatus::lookupAnyExerciseSent (   $a_ass_id)
static

Check whether exercise has been sent to any student per mail.

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

References $ilDB.

Referenced by ilExerciseMemberTableGUI\__construct().

287  {
288  global $ilDB;
289 
290  $q = "SELECT count(*) AS cnt".
291  " FROM exc_mem_ass_status".
292  " WHERE NOT sent_time IS NULL".
293  " AND ass_id = ".$ilDB->quote($a_ass_id, "integer");
294  $set = $ilDB->query($q);
295  $rec = $ilDB->fetchAssoc($set);
296  return ($rec["cnt"] > 0);
297  }
global $ilDB
+ Here is the caller graph for this function:

◆ postUpdateReturned()

ilExAssignmentMemberStatus::postUpdateReturned ( )
protected

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

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

Referenced by update().

243  {
244  global $ilDB;
245 
246  // first upload => notification on submission?
247  $set = $ilDB->query("SELECT fb_cron, fb_date, fb_file".
248  " FROM exc_assignment".
249  " WHERE id = ".$ilDB->quote($this->ass_id, "integer"));
250  $row = $ilDB->fetchAssoc($set);
251  if($row["fb_cron"] &&
252  $row["fb_file"] &&
253  $row["fb_date"] == ilExAssignment::FEEDBACK_DATE_SUBMISSION) // #16200
254  {
255  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
256  ilExAssignment::sendFeedbackNotifications($this->ass_id, $this->user_id);
257  }
258  }
static sendFeedbackNotifications($a_ass_id, $a_user_id=null)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ postUpdateStatus()

ilExAssignmentMemberStatus::postUpdateStatus ( )
protected

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

References ilObjExercise\updateUserStatus().

Referenced by update().

261  {
262  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
263  $ass = new ilExAssignment($this->ass_id);
264  $exc = new ilObjExercise($ass->getExerciseId(), false);
265  $exc->updateUserStatus($this->user_id);
266  }
Exercise assignment.
Class ilObjExercise.
updateUserStatus($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 169 of file class.ilExAssignmentMemberStatus.php.

References $ilDB, and $row.

Referenced by __construct().

170  {
171  global $ilDB;
172 
173  $set = $ilDB->query("SELECT * FROM exc_mem_ass_status".
174  " WHERE ass_id = ".$ilDB->quote($this->ass_id, "integer").
175  " AND usr_id = ".$ilDB->quote($this->user_id, "integer"));
176  if($ilDB->numRows($set))
177  {
178  $row = $ilDB->fetchAssoc($set);
179 
180  // not using setters to circumvent any datetime-logic/-magic
181  $this->notice = $row["notice"];
182  $this->returned = $row["returned"];
183  $this->solved = $row["solved"];
184  $this->status_time = $row["status_time"];
185  $this->sent = $row["sent"];
186  $this->sent_time = $row["sent_time"];
187  $this->feedback_time = $row["feedback_time"];
188  $this->feedback = $row["feedback"];
189  $this->status = $row["status"];
190  $this->mark = $row["mark"];
191  $this->comment = $row["u_comment"];
192  $this->db_exists = true;
193  }
194  }
global $ilDB
+ Here is the caller graph for this function:

◆ setComment()

ilExAssignmentMemberStatus::setComment (   $a_value)

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

160  {
161  $this->comment = $a_value;
162  }

◆ setFeedback()

ilExAssignmentMemberStatus::setFeedback (   $a_value)

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

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

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

◆ setFeedbackTime()

ilExAssignmentMemberStatus::setFeedbackTime (   $a_value)
protected

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

Referenced by setFeedback().

121  {
122  $this->feedback_time = $a_value;
123  }
+ Here is the caller graph for this function:

◆ setMark()

ilExAssignmentMemberStatus::setMark (   $a_value)

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

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

146  {
147  if($a_value != $this->mark)
148  {
149  $this->setStatusTime(ilUtil::now());
150  }
151  $this->mark = $a_value;
152  }
static now()
Return current timestamp in Y-m-d H:i:s format.
+ Here is the call graph for this function:

◆ setNotice()

ilExAssignmentMemberStatus::setNotice (   $a_value)

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

38  {
39  $this->notice = $a_value;
40  }

◆ setReturned()

ilExAssignmentMemberStatus::setReturned (   $a_value)

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

48  {
49  if($a_value &&
50  !$this->returned)
51  {
52  $this->returned_update = true;
53  }
54  $this->returned = $a_value;
55  }

◆ setSent()

ilExAssignmentMemberStatus::setSent (   $a_value)

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

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

83  {
84  if($a_value && $a_value != $this->sent)
85  {
86  $this->setSentTime(ilUtil::now());
87  }
88  $this->sent = $a_value;
89  }
static now()
Return current timestamp in Y-m-d H:i:s format.
+ Here is the call graph for this function:

◆ setSentTime()

ilExAssignmentMemberStatus::setSentTime (   $a_value)
protected

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

Referenced by setSent().

97  {
98  $this->sent_time = $a_value;
99  }
+ Here is the caller graph for this function:

◆ setSolved()

ilExAssignmentMemberStatus::setSolved (   $a_value)

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

63  {
64  $this->solved = $a_value;
65  }

◆ setStatus()

ilExAssignmentMemberStatus::setStatus (   $a_value)

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

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

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

◆ setStatusTime()

ilExAssignmentMemberStatus::setStatusTime (   $a_value)
protected

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

Referenced by setMark(), and setStatus().

73  {
74  $this->status_time = $a_value;
75  }
+ Here is the caller graph for this function:

◆ update()

ilExAssignmentMemberStatus::update ( )

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

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

214  {
215  global $ilDB;
216 
217  $keys = array(
218  "ass_id" => array("integer", $this->ass_id)
219  ,"usr_id" => array("integer", $this->user_id)
220  );
221  $fields = $this->getFields();
222  if(!$this->db_exists)
223  {
224  $fields = array_merge($keys, $fields);
225  $ilDB->insert("exc_mem_ass_status", $fields);
226  }
227  else
228  {
229  $ilDB->update("exc_mem_ass_status", $fields, $keys);
230  }
231 
232  if($this->returned_update)
233  {
234  $this->postUpdateReturned();
235  }
236  if($this->status_update)
237  {
238  $this->postUpdateStatus();
239  }
240  }
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $ass_id

ilExAssignmentMemberStatus::$ass_id
protected

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

◆ $comment

ilExAssignmentMemberStatus::$comment
protected

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

Referenced by getComment().

◆ $db_exists

ilExAssignmentMemberStatus::$db_exists
protected

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

◆ $feedback

ilExAssignmentMemberStatus::$feedback
protected

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

Referenced by getFeedback().

◆ $feedback_time

ilExAssignmentMemberStatus::$feedback_time
protected

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

Referenced by getFeedbackTime().

◆ $mark

ilExAssignmentMemberStatus::$mark
protected

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

Referenced by getMark().

◆ $notice

ilExAssignmentMemberStatus::$notice
protected

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

Referenced by getNotice().

◆ $returned

ilExAssignmentMemberStatus::$returned
protected

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

Referenced by getReturned().

◆ $returned_update

ilExAssignmentMemberStatus::$returned_update
protected

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

◆ $sent

ilExAssignmentMemberStatus::$sent
protected

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

Referenced by getSent().

◆ $sent_time

ilExAssignmentMemberStatus::$sent_time
protected

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

Referenced by getSentTime().

◆ $solved

ilExAssignmentMemberStatus::$solved
protected

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

Referenced by getSolved().

◆ $status

ilExAssignmentMemberStatus::$status = "notgraded"
protected

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

Referenced by getStatus().

◆ $status_time

ilExAssignmentMemberStatus::$status_time
protected

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

Referenced by getStatusTime().

◆ $status_update

ilExAssignmentMemberStatus::$status_update
protected

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

◆ $user_id

ilExAssignmentMemberStatus::$user_id
protected

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


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