ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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

 $db
 
 $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 34 of file class.ilExAssignmentMemberStatus.php.

References $DIC, and read().

35  {
36  global $DIC;
37 
38  $this->db = $DIC->database();
39  $this->ass_id = $a_ass_id;
40  $this->user_id = $a_user_id;
41 
42  $this->read();
43  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ getComment()

ilExAssignmentMemberStatus::getComment ( )

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

References $comment.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFeedback()

ilExAssignmentMemberStatus::getFeedback ( )

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

References $feedback.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getFeedbackTime()

ilExAssignmentMemberStatus::getFeedbackTime ( )

Definition at line 130 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 198 of file class.ilExAssignmentMemberStatus.php.

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

Referenced by update().

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

◆ getMark()

ilExAssignmentMemberStatus::getMark ( )

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

References $mark.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getNotice()

ilExAssignmentMemberStatus::getNotice ( )

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

References $notice.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getReturned()

ilExAssignmentMemberStatus::getReturned ( )

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

References $returned.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSent()

ilExAssignmentMemberStatus::getSent ( )

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

References $sent.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getSentTime()

ilExAssignmentMemberStatus::getSentTime ( )

Definition at line 107 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 74 of file class.ilExAssignmentMemberStatus.php.

References $solved.

Referenced by getFields().

+ Here is the caller graph for this function:

◆ getStatus()

ilExAssignmentMemberStatus::getStatus ( )

Definition at line 144 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 264 of file class.ilExAssignmentMemberStatus.php.

References getStatus().

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

◆ getStatusTime()

ilExAssignmentMemberStatus::getStatusTime ( )

Definition at line 84 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 281 of file class.ilExAssignmentMemberStatus.php.

References $DIC, and $ilDB.

282  {
283  global $DIC;
284 
285  $ilDB = $DIC->database();
286 
287  $q = "SELECT count(*) AS cnt" .
288  " FROM exc_mem_ass_status" .
289  " WHERE NOT sent_time IS NULL" .
290  " AND ass_id = " . $ilDB->quote($a_ass_id, "integer");
291  $set = $ilDB->query($q);
292  $rec = $ilDB->fetchAssoc($set);
293  return ($rec["cnt"] > 0);
294  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ postUpdateReturned()

ilExAssignmentMemberStatus::postUpdateReturned ( )
protected

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

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

Referenced by update().

240  {
241  $ilDB = $this->db;
242 
243  // first upload => notification on submission?
244  $set = $ilDB->query("SELECT fb_cron, fb_date, fb_file" .
245  " FROM exc_assignment" .
246  " WHERE id = " . $ilDB->quote($this->ass_id, "integer"));
247  $row = $ilDB->fetchAssoc($set);
248  if ($row["fb_cron"] &&
249  $row["fb_file"] &&
250  $row["fb_date"] == ilExAssignment::FEEDBACK_DATE_SUBMISSION) { // #16200
251  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
252  ilExAssignment::sendFeedbackNotifications($this->ass_id, $this->user_id);
253  }
254  }
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 256 of file class.ilExAssignmentMemberStatus.php.

References ilObjExercise\updateUserStatus().

Referenced by update().

257  {
258  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
259  $ass = new ilExAssignment($this->ass_id);
260  $exc = new ilObjExercise($ass->getExerciseId(), false);
261  $exc->updateUserStatus($this->user_id);
262  }
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 172 of file class.ilExAssignmentMemberStatus.php.

References $db, $ilDB, $row, and comment().

Referenced by __construct().

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

◆ setComment()

ilExAssignmentMemberStatus::setComment (   $a_value)

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

References comment().

163  {
164  $this->comment = $a_value;
165  }
comment()
Definition: comment.php:2
+ Here is the call graph for this function:

◆ setFeedback()

ilExAssignmentMemberStatus::setFeedback (   $a_value)

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

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

113  {
114  if ($a_value != $this->sent) {
115  $this->setFeedbackTime(ilUtil::now());
116  }
117  $this->feedback = $a_value;
118  }
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 125 of file class.ilExAssignmentMemberStatus.php.

Referenced by setFeedback().

126  {
127  $this->feedback_time = $a_value;
128  }
+ Here is the caller graph for this function:

◆ setMark()

ilExAssignmentMemberStatus::setMark (   $a_value)

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

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

150  {
151  if ($a_value != $this->mark) {
152  $this->setStatusTime(ilUtil::now());
153  }
154  $this->mark = $a_value;
155  }
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 45 of file class.ilExAssignmentMemberStatus.php.

46  {
47  $this->notice = $a_value;
48  }

◆ setReturned()

ilExAssignmentMemberStatus::setReturned (   $a_value)

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

56  {
57  if ($a_value &&
58  !$this->returned) {
59  $this->returned_update = true;
60  }
61  $this->returned = $a_value;
62  }

◆ setSent()

ilExAssignmentMemberStatus::setSent (   $a_value)

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

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

90  {
91  if ($a_value && $a_value != $this->sent) {
92  $this->setSentTime(ilUtil::now());
93  }
94  $this->sent = $a_value;
95  }
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 102 of file class.ilExAssignmentMemberStatus.php.

Referenced by setSent().

103  {
104  $this->sent_time = $a_value;
105  }
+ Here is the caller graph for this function:

◆ setSolved()

ilExAssignmentMemberStatus::setSolved (   $a_value)

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

70  {
71  $this->solved = $a_value;
72  }

◆ setStatus()

ilExAssignmentMemberStatus::setStatus (   $a_value)

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

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

136  {
137  if ($a_value != $this->status) {
138  $this->setStatusTime(ilUtil::now());
139  $this->status = $a_value;
140  $this->status_update = true;
141  }
142  }
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 79 of file class.ilExAssignmentMemberStatus.php.

Referenced by setMark(), and setStatus().

80  {
81  $this->status_time = $a_value;
82  }
+ Here is the caller graph for this function:

◆ update()

ilExAssignmentMemberStatus::update ( )

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

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

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

Field Documentation

◆ $ass_id

ilExAssignmentMemberStatus::$ass_id
protected

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

◆ $comment

ilExAssignmentMemberStatus::$comment
protected

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

Referenced by getComment().

◆ $db

ilExAssignmentMemberStatus::$db
protected

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

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

◆ $db_exists

ilExAssignmentMemberStatus::$db_exists
protected

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

◆ $feedback

ilExAssignmentMemberStatus::$feedback
protected

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

Referenced by getFeedback().

◆ $feedback_time

ilExAssignmentMemberStatus::$feedback_time
protected

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

Referenced by getFeedbackTime().

◆ $mark

ilExAssignmentMemberStatus::$mark
protected

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

Referenced by getMark().

◆ $notice

ilExAssignmentMemberStatus::$notice
protected

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

Referenced by getNotice().

◆ $returned

ilExAssignmentMemberStatus::$returned
protected

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

Referenced by getReturned().

◆ $returned_update

ilExAssignmentMemberStatus::$returned_update
protected

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

◆ $sent

ilExAssignmentMemberStatus::$sent
protected

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

Referenced by getSent().

◆ $sent_time

ilExAssignmentMemberStatus::$sent_time
protected

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

Referenced by getSentTime().

◆ $solved

ilExAssignmentMemberStatus::$solved
protected

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

Referenced by getSolved().

◆ $status

ilExAssignmentMemberStatus::$status = "notgraded"
protected

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

Referenced by getStatus().

◆ $status_time

ilExAssignmentMemberStatus::$status_time
protected

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

Referenced by getStatusTime().

◆ $status_update

ilExAssignmentMemberStatus::$status_update
protected

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

◆ $user_id

ilExAssignmentMemberStatus::$user_id
protected

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


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