5require_once(dirname(__FILE__) .
"/../../../../Services/ActiveRecord/class.ActiveRecord.php");
52 return "prg_usr_progress";
209 $prg->setAssignmentId($a_ass->
getId())
214 ->setCurrentAmountOfPoints(0)
215 ->setCompletionBy(
null)
216 ->setLastChangeBy(
null)
234 $this->assignment_id = $a_id;
250 $this->prg_id = $a_id;
266 $this->usr_id = $a_id;
294 if (!is_numeric($a_points) || $a_points < 0) {
295 throw new ilException(
"ilStudyProgrammeProgress::setAmountOfPoints: "
296 .
"Expected a number >= 0 as argument, got '$a_points'");
299 $this->points = (int) $a_points;
325 if (!is_numeric($a_points) || $a_points < 0) {
326 throw new ilException(
"ilStudyProgrammeProgress::setCurrentAmountOfPoints: "
327 .
"Expected a number >= 0 as argument, got '$a_points'.");
330 $this->points_cur = (int) $a_points;
357 $a_status = (int) $a_status;
358 if (!in_array($a_status, self::$STATUS)) {
359 throw new ilException(
"ilStudyProgrammeProgress::setStatus: No status: "
363 $this->status = $a_status;
376 if ($a_id !==
null) {
379 $this->completion_by = $a_id;
415 throw new ilException(
"ilStudyProgrammeProgress::setLastChangeBy: '$a_usr_id' "
416 .
"is no id of a user.");
418 $this->last_change_by = $a_usr_id;
460 throw new ilException(
"ilStudyProgrammeProgress::setLastChange: Given "
461 .
"timestamp is before current timestamp. That "
462 .
"is logically impossible.");
476 if ($this->deadline !==
null) {
An exception for terminatinating execution or to throw for unit testing.
@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.
setDeadline(ilDateTime $deadline=null)
Set the deadline of this progress.
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.
getDeadline()
Get the deadline of this progress.
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.