5require_once(dirname(__FILE__).
"/../../../../Services/ActiveRecord/class.ActiveRecord.php");
47 return "prg_usr_progress";
194 $prg->setAssignmentId($a_ass->
getId())
199 ->setCurrentAmountOfPoints(0)
200 ->setCompletionBy(
null)
201 ->setLastChangeBy(
null)
217 $this->assignment_id = $a_id;
231 $this->prg_id = $a_id;
245 $this->usr_id = $a_id;
271 if (!is_numeric($a_points) || $a_points < 0) {
272 throw new ilException(
"ilStudyProgrammeProgress::setAmountOfPoints: "
273 .
"Expected a number >= 0 as argument, got '$a_points'");
276 $this->points = (int)$a_points;
300 if (!is_numeric($a_points) || $a_points < 0) {
301 throw new ilException(
"ilStudyProgrammeProgress::setCurrentAmountOfPoints: "
302 .
"Expected a number >= 0 as argument, got '$a_points'.");
305 $this->points_cur = (int)$a_points;
330 $a_status = (int)$a_status;
331 if (!in_array($a_status, self::$STATUS)) {
332 throw new ilException(
"ilStudyProgrammeProgress::setStatus: No status: "
336 $this->status = $a_status;
348 if ($a_id !==
null) {
351 $this->completion_by = $a_id;
384 throw new ilException(
"ilStudyProgrammeProgress::setLastChangeBy: '$a_usr_id' "
385 .
"is no id of a user.");
387 $this->last_change_by = $a_usr_id;
426 throw new ilException(
"ilStudyProgrammeProgress::setLastChange: Given "
427 .
"timestamp is before current timestamp. That "
428 .
"is logically impossible.");
@classDescription Date and time handling
get($a_format, $a_format_str='', $a_tz='')
get formatted date
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
Base class for ILIAS Exception handling.
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilStudyProgrammeAssignment.
getUserId()
Get the id of the user who is assigned.
getId()
Get the id of the assignment.
Class ilStudyProgrammeProgress.
setCurrentAmountOfPoints($a_points)
Set the amount of points the user currently has achieved on this node.
getAssignmentId()
Get the assignment, this progress belongs to.
setLastChangeBy($a_usr_id)
Set the id of the user who did the last change on this progress.
const STATUS_NOT_RELEVANT
getAmountOfPoints()
Get the amount of points the user needs to achieve on the subnodes of this node.
getStatus()
Get the status the user has on this node.
setAmountOfPoints($a_points)
Get the amount of points the user needs to achieve on the subnodes of this node.
getUserId()
Get the id of the user this progress is for.
getLastChange()
Get the timestamp of the last change on this progress.
updateLastChange()
Update the last change timestamp to the current time.
getCompletionBy()
Get the id of object or user that lead to the successful completion of this node.
getLastChangeBy()
Get the id of the user who did the last change on this assignment.
setStatus($a_status)
Set the status of this node.
static returnDbTableName()
getCurrentAmountOfPoints()
Get the amount of points the user currently has achieved on the node.
setLastChange(ilDateTime $a_timestamp)
Set the last change timestamp to the given time.
setCompletionBy($a_id)
Set the completion_by field.
static createFor(ilStudyProgramme $a_prg, ilStudyProgrammeAssignment $a_ass)
Create a new progress object for a given program node and assignment.
getNodeId()
Get the id of the program node this progress belongs to.
getPoints()
Get the amount of points.
getObjId()
Get the id of the study program.
static now()
Return current timestamp in Y-m-d H:i:s format.