ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
Represents the progress of a user at one node of a study programme. More...
Public Member Functions | |
__construct ($a_ids_or_model) | |
Throws when id does not refer to a study programme progress. More... | |
getStudyProgramme () | |
Get the program node where this progress belongs to was made. More... | |
getAssignment () | |
Get the assignment this progress belongs to. More... | |
getId () | |
Get the id of the progress. More... | |
getNodeId () | |
Get the id of the program node the progress belongs to. More... | |
getUserId () | |
Get the id of the user who is assigned. More... | |
getStatus () | |
Get the status of the progress. More... | |
getAmountOfPoints () | |
Get the amount of points needed to complete the node. More... | |
getCurrentAmountOfPoints () | |
Get the amount of points the user currently achieved. More... | |
getLastChange () | |
Get the timestamp when the last change was made on this progress. More... | |
getLastChangeBy () | |
Get the id of the user who did the last change on this progress. More... | |
getCompletionBy () | |
Get the id of the user or course that lead to completion of this node. More... | |
delete () | |
Delete the assignment from database. More... | |
markAccredited ($a_user_id) | |
Mark this progress as accredited. More... | |
unmarkAccredited () | |
Set the node to in progress. More... | |
markNotRelevant ($a_user_id) | |
Set the node to be not relevant for the user. More... | |
markRelevant ($a_user_id) | |
Set the node to be relevant for the user. More... | |
setRequiredAmountOfPoints ($a_points, $a_user_id) | |
Set the amount of points the user is required to have to complete this node. More... | |
getMaximumPossibleAmountOfPoints ($only_relevant=false) | |
Get the maximum possible amount of points a user can achieve for the completion of this node. More... | |
canBeCompleted () | |
Check whether the user can achieve enough points on the subnodes to be able to complete this node. More... | |
hasIndividualModifications () | |
Check whether there are individual modifications for the user on this program. More... | |
isSuccessful () | |
Check whether the user was successful on this node. More... | |
isAccredited () | |
Check whether the user was accredited on this node. More... | |
isRelevant () | |
Check whether this node is relevant for the user. More... | |
updateFromProgramNode () | |
Update the progress from its program node. More... | |
setLPCompleted ($a_obj_id, $a_usr_id) | |
Set this node to be completed due to a completed learning progress. More... | |
getChildrenProgress () | |
Get the progresses on the child nodes of this node for the same assignment this progress belongs to. More... | |
getNamesOfCompletedOrAccreditedChildren () | |
Get a list with the names of the children of this node that a were completed or accredited for the given assignment. More... | |
Static Public Member Functions | |
static | getInstance ($a_assignment_id, $a_program_id, $a_user_id) |
Get an instance. More... | |
static | getInstanceById ($a_prgrs_id) |
Get an instance by progress id. More... | |
static | getInstancesForUser ($a_program_id, $a_user_id) |
Get the instances that user has on program. More... | |
static | getInstanceForAssignment ($a_program_id, $a_assignment_id) |
Get the instance for the assignment on the program. More... | |
static | getInstancesForAssignment ($a_assignment_id) |
Get the instance for an assignment. More... | |
static | getInstancesForProgram ($a_program_id) |
Get the instances for a program node. More... | |
static | statusToRepr ($a_status) |
Get a user readable representation of a status. More... | |
static | getPossibleActions ($a_node_id, $a_root_prg_id, $a_status) |
Get a list with possible actions on a progress record. More... | |
Data Fields | |
const | ACTION_MARK_ACCREDITED = "mark_accredited" |
const | ACTION_UNMARK_ACCREDITED = "unmark_accredited" |
const | ACTION_SHOW_INDIVIDUAL_PLAN = "show_individual_plan" |
const | ACTION_REMOVE_USER = "remove_user" |
Protected Member Functions | |
updateStatus () | |
Updates the status of this progress based on the status of the progress on the sub nodes. More... | |
hasSuccessfullChildren () | |
updateParentStatus () | |
Update the status of the parent of this node. More... | |
getParentProgress () | |
Get the progress on the parent node for the same assignment this progress belongs to. More... | |
refreshLPStatus () | |
Protected Attributes | |
$progress | |
Represents the progress of a user at one node of a study programme.
A user could have multiple progress' on one node, since he could also have multiple assignments to one node.
Definition at line 15 of file class.ilStudyProgrammeUserProgress.php.
ilStudyProgrammeUserProgress::__construct | ( | $a_ids_or_model | ) |
Throws when id does not refer to a study programme progress.
Expects an array [assignment_id, program_node_id, user_id] or an ilStudyProgress as first parameter.
ilException |
int[] | | ilStudyProgrammeAssignment $a_ids_or_model |
Definition at line 27 of file class.ilStudyProgrammeUserProgress.php.
References array, and ActiveRecord\where().
ilStudyProgrammeUserProgress::canBeCompleted | ( | ) |
Check whether the user can achieve enough points on the subnodes to be able to complete this node.
Definition at line 464 of file class.ilStudyProgrammeUserProgress.php.
References $progress, getAmountOfPoints(), getChildrenProgress(), getMaximumPossibleAmountOfPoints(), getStudyProgramme(), and ilStudyProgramme\MODE_LP_COMPLETED.
Referenced by ilStudyProgrammeIndividualPlanProgressListGUI\buildProgressStatus().
ilStudyProgrammeUserProgress::delete | ( | ) |
Delete the assignment from database.
Definition at line 304 of file class.ilStudyProgrammeUserProgress.php.
ilStudyProgrammeUserProgress::getAmountOfPoints | ( | ) |
Get the amount of points needed to complete the node.
This is the amount of points yielded for the completion of the node above as well.
Definition at line 257 of file class.ilStudyProgrammeUserProgress.php.
Referenced by ilStudyProgrammeProgressListGUI\buildProgressBar(), ilStudyProgrammeProgressListGUI\buildProgressStatus(), ilStudyProgrammeProgressListGUI\buildToolTip(), canBeCompleted(), getCurrentAmountOfPoints(), getMaximumPossibleAmountOfPoints(), and updateStatus().
ilStudyProgrammeUserProgress::getAssignment | ( | ) |
Get the assignment this progress belongs to.
Definition at line 210 of file class.ilStudyProgrammeUserProgress.php.
References ilStudyProgrammeUserAssignment\getInstance().
Referenced by getParentProgress(), and ilStudyProgrammeEvents\userSuccessful().
ilStudyProgrammeUserProgress::getChildrenProgress | ( | ) |
Get the progresses on the child nodes of this node for the same assignment this progress belongs to.
Definition at line 681 of file class.ilStudyProgrammeUserProgress.php.
References getStudyProgramme(), and ilStudyProgramme\MODE_LP_COMPLETED.
Referenced by canBeCompleted(), hasSuccessfullChildren(), and updateStatus().
ilStudyProgrammeUserProgress::getCompletionBy | ( | ) |
Get the id of the user or course that lead to completion of this node.
Definition at line 297 of file class.ilStudyProgrammeUserProgress.php.
ilStudyProgrammeUserProgress::getCurrentAmountOfPoints | ( | ) |
Get the amount of points the user currently achieved.
Definition at line 266 of file class.ilStudyProgrammeUserProgress.php.
References getAmountOfPoints(), getStudyProgramme(), isAccredited(), and isSuccessful().
Referenced by ilStudyProgrammeProgressListGUI\buildProgressBar(), ilStudyProgrammeProgressListGUI\buildProgressStatus(), and ilStudyProgrammeProgressListGUI\buildToolTip().
ilStudyProgrammeUserProgress::getId | ( | ) |
Get the id of the progress.
Definition at line 220 of file class.ilStudyProgrammeUserProgress.php.
Referenced by getParentProgress(), ilStudyProgrammeProgressListGUI\getTitleAndIconTarget(), and refreshLPStatus().
|
static |
Get an instance.
Just wraps constructor.
ilException |
int | $a_assignment_id | |
int | $a_program_id | |
int | $a_user_id |
Definition at line 61 of file class.ilStudyProgrammeUserProgress.php.
References array.
Referenced by ilStudyProgrammeIndividualPlanTableGUI\fetchData().
|
static |
Get an instance by progress id.
int | $a_prgrs_id |
Definition at line 71 of file class.ilStudyProgrammeUserProgress.php.
Referenced by ilObjStudyProgrammeMembersGUI\getProgressObject(), ilObjStudyProgrammeIndividualPlanGUI\updateRequiredPoints(), and ilObjStudyProgrammeIndividualPlanGUI\updateStatus().
|
static |
Get the instance for the assignment on the program.
Throws when the node does not belong to the assignment.
ilException |
int | $a_program_id | |
int | $a_user_id |
Definition at line 106 of file class.ilStudyProgrammeUserProgress.php.
References array, and ActiveRecord\where().
Referenced by ilStudyProgrammeMembersTableGUI\fetchData(), and ilObjStudyProgramme\getProgressForAssignment().
|
static |
Get the instance for an assignment.
Throws when the node does not belong to the assignment.
ilException |
int | $a_program_id | |
int | $a_user_id |
Definition at line 131 of file class.ilStudyProgrammeUserProgress.php.
References array, and ActiveRecord\where().
Referenced by ilStudyProgrammeUserAssignment\delete().
|
static |
Get the instances for a program node.
int | $a_program_id |
Definition at line 152 of file class.ilStudyProgrammeUserProgress.php.
References array, and ActiveRecord\where().
Referenced by ilObjStudyProgramme\getProgresses().
|
static |
Get the instances that user has on program.
int | $a_program_id | |
int | $a_user_id |
Definition at line 86 of file class.ilStudyProgrammeUserProgress.php.
References array, and ActiveRecord\where().
Referenced by ilObjStudyProgramme\getProgressesOf().
ilStudyProgrammeUserProgress::getLastChange | ( | ) |
Get the timestamp when the last change was made on this progress.
Definition at line 279 of file class.ilStudyProgrammeUserProgress.php.
ilStudyProgrammeUserProgress::getLastChangeBy | ( | ) |
Get the id of the user who did the last change on this progress.
Definition at line 288 of file class.ilStudyProgrammeUserProgress.php.
Referenced by hasIndividualModifications().
ilStudyProgrammeUserProgress::getMaximumPossibleAmountOfPoints | ( | $only_relevant = false | ) |
Get the maximum possible amount of points a user can achieve for the completion of this node.
If the program node runs in LP-mode this will be equal getAmountOfPoints.
TODO: Maybe caching this value would be a good idea.
$only_relevant | boolean true if check is nesserary the progress is relevant |
Definition at line 435 of file class.ilStudyProgrammeUserProgress.php.
References getAmountOfPoints(), getStudyProgramme(), and ilStudyProgramme\MODE_LP_COMPLETED.
Referenced by ilStudyProgrammeProgressListGUI\buildProgressBar(), ilStudyProgrammeProgressListGUI\buildProgressStatus(), and canBeCompleted().
ilStudyProgrammeUserProgress::getNamesOfCompletedOrAccreditedChildren | ( | ) |
Get a list with the names of the children of this node that a were completed or accredited for the given assignment.
int | $a_assignment_id |
Definition at line 703 of file class.ilStudyProgrammeUserProgress.php.
References $names, array, and getStudyProgramme().
ilStudyProgrammeUserProgress::getNodeId | ( | ) |
Get the id of the program node the progress belongs to.
Definition at line 229 of file class.ilStudyProgrammeUserProgress.php.
|
protected |
Get the progress on the parent node for the same assignment this progress belongs to.
Definition at line 661 of file class.ilStudyProgrammeUserProgress.php.
References getAssignment(), getId(), and getStudyProgramme().
Referenced by updateParentStatus().
|
static |
Get a list with possible actions on a progress record.
int | $a_node_id | object_id! |
int | $a_belongs | object_id! |
int | $a_status |
Definition at line 730 of file class.ilStudyProgrammeUserProgress.php.
References array, ilStudyProgrammeProgress\STATUS_ACCREDITED, and ilStudyProgrammeProgress\STATUS_IN_PROGRESS.
Referenced by ilStudyProgrammeMembersTableGUI\fetchData().
ilStudyProgrammeUserProgress::getStatus | ( | ) |
Get the status of the progress.
Definition at line 247 of file class.ilStudyProgrammeUserProgress.php.
Referenced by isAccredited(), isRelevant(), isSuccessful(), markAccredited(), updateFromProgramNode(), and updateStatus().
ilStudyProgrammeUserProgress::getStudyProgramme | ( | ) |
Get the program node where this progress belongs to was made.
Throws when program this assignment is about has no ref id.
TODO: I'm quite sure, this will profit from caching.
ilException |
Definition at line 194 of file class.ilStudyProgrammeUserProgress.php.
References ilObject\_getAllReferences(), and ilObjStudyProgramme\getInstanceByRefId().
Referenced by ilStudyProgrammeProgressListGUI\buildProgressStatus(), canBeCompleted(), getChildrenProgress(), getCurrentAmountOfPoints(), getMaximumPossibleAmountOfPoints(), getNamesOfCompletedOrAccreditedChildren(), getParentProgress(), markAccredited(), refreshLPStatus(), setLPCompleted(), ilStudyProgrammeExpandableProgressListGUI\shouldShowSubProgress(), updateFromProgramNode(), updateStatus(), and ilStudyProgrammeEvents\userSuccessful().
ilStudyProgrammeUserProgress::getUserId | ( | ) |
Get the id of the user who is assigned.
Definition at line 238 of file class.ilStudyProgrammeUserProgress.php.
Referenced by refreshLPStatus(), and setLPCompleted().
ilStudyProgrammeUserProgress::hasIndividualModifications | ( | ) |
Check whether there are individual modifications for the user on this program.
Definition at line 490 of file class.ilStudyProgrammeUserProgress.php.
References getLastChangeBy().
Referenced by updateFromProgramNode().
|
protected |
Definition at line 596 of file class.ilStudyProgrammeUserProgress.php.
References getChildrenProgress().
Referenced by updateStatus().
ilStudyProgrammeUserProgress::isAccredited | ( | ) |
Check whether the user was accredited on this node.
Definition at line 512 of file class.ilStudyProgrammeUserProgress.php.
References getStatus(), and ilStudyProgrammeProgress\STATUS_ACCREDITED.
Referenced by getCurrentAmountOfPoints().
ilStudyProgrammeUserProgress::isRelevant | ( | ) |
Check whether this node is relevant for the user.
Definition at line 523 of file class.ilStudyProgrammeUserProgress.php.
References getStatus(), and ilStudyProgrammeProgress\STATUS_NOT_RELEVANT.
Referenced by setLPCompleted(), and ilStudyProgrammeExpandableProgressListGUI\shouldShowSubProgress().
ilStudyProgrammeUserProgress::isSuccessful | ( | ) |
Check whether the user was successful on this node.
This is the case, when the node was accredited or completed.
Definition at line 500 of file class.ilStudyProgrammeUserProgress.php.
References getStatus(), ilStudyProgrammeProgress\STATUS_ACCREDITED, and ilStudyProgrammeProgress\STATUS_COMPLETED.
Referenced by ilStudyProgrammeProgressListGUI\buildProgressBar(), ilStudyProgrammeIndividualPlanProgressListGUI\buildProgressStatus(), getCurrentAmountOfPoints(), and setLPCompleted().
ilStudyProgrammeUserProgress::markAccredited | ( | $a_user_id | ) |
Mark this progress as accredited.
Throws when status is not IN_PROGRESS. Throws when program node is outdated and current status is NOT_RELEVANT.
ilException |
int | $a_user_id | The user who performed the operation. |
Definition at line 319 of file class.ilStudyProgrammeUserProgress.php.
References getStatus(), getStudyProgramme(), ilStudyProgrammeProgress\STATUS_ACCREDITED, ilStudyProgrammeProgress\STATUS_NOT_RELEVANT, ilStudyProgramme\STATUS_OUTDATED, updateParentStatus(), and ilStudyProgrammeEvents\userSuccessful().
ilStudyProgrammeUserProgress::markNotRelevant | ( | $a_user_id | ) |
Set the node to be not relevant for the user.
Throws when status is COMPLETED.
ilException |
int | $a_user_id | The user who marks the node as not relevant. |
Definition at line 371 of file class.ilStudyProgrammeUserProgress.php.
References ilStudyProgrammeProgress\STATUS_NOT_RELEVANT, and updateStatus().
ilStudyProgrammeUserProgress::markRelevant | ( | $a_user_id | ) |
Set the node to be relevant for the user.
Throws when status is not NOT_RELEVANT.
ilException |
int | $a_user_id | The user who marks the node as not relevant. |
Definition at line 390 of file class.ilStudyProgrammeUserProgress.php.
References ilStudyProgrammeProgress\STATUS_IN_PROGRESS, ilStudyProgrammeProgress\STATUS_NOT_RELEVANT, and updateStatus().
|
protected |
Definition at line 745 of file class.ilStudyProgrammeUserProgress.php.
References ilLPStatusWrapper\_refreshStatus(), array, getId(), getStudyProgramme(), and getUserId().
Referenced by setLPCompleted(), unmarkAccredited(), and updateStatus().
ilStudyProgrammeUserProgress::setLPCompleted | ( | $a_obj_id, | |
$a_usr_id | |||
) |
Set this node to be completed due to a completed learning progress.
Will only set the progress if this node is relevant and not successful.
Throws when this node is not in LP-Mode. Throws when object that was completed is no child of the node or user does not belong to this progress.
ilException |
Definition at line 626 of file class.ilStudyProgrammeUserProgress.php.
References getStudyProgramme(), getUserId(), isRelevant(), isSuccessful(), ilStudyProgramme\MODE_LP_COMPLETED, refreshLPStatus(), ilStudyProgrammeProgress\STATUS_COMPLETED, updateParentStatus(), and ilStudyProgrammeEvents\userSuccessful().
ilStudyProgrammeUserProgress::setRequiredAmountOfPoints | ( | $a_points, | |
$a_user_id | |||
) |
Set the amount of points the user is required to have to complete this node.
Throws when status is completed.
ilException |
int | $a_points | The amount of points the user needs for completion. |
int | $a_user_id | The id of the user who did the modification. |
Definition at line 414 of file class.ilStudyProgrammeUserProgress.php.
References updateStatus().
|
static |
Get a user readable representation of a status.
Definition at line 164 of file class.ilStudyProgrammeUserProgress.php.
References $DIC, $lng, ilStudyProgrammeProgress\STATUS_ACCREDITED, ilStudyProgrammeProgress\STATUS_COMPLETED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, and ilStudyProgrammeProgress\STATUS_NOT_RELEVANT.
Referenced by ilStudyProgrammeIndividualPlanTableGUI\fillRow(), and ilStudyProgrammeMembersTableGUI\fillRow().
ilStudyProgrammeUserProgress::unmarkAccredited | ( | ) |
Set the node to in progress.
Throws when status is not ACCREDITED.
ilException |
Definition at line 347 of file class.ilStudyProgrammeUserProgress.php.
References refreshLPStatus(), ilStudyProgrammeProgress\STATUS_ACCREDITED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, and updateParentStatus().
ilStudyProgrammeUserProgress::updateFromProgramNode | ( | ) |
Update the progress from its program node.
Will only update when the node does not have individual modifications and is not completed. Return false, when update could not be performed and true otherwise.
Definition at line 534 of file class.ilStudyProgrammeUserProgress.php.
References getStatus(), getStudyProgramme(), hasIndividualModifications(), ilStudyProgramme\STATUS_ACTIVE, ilStudyProgrammeProgress\STATUS_COMPLETED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, ilStudyProgrammeProgress\STATUS_NOT_RELEVANT, and updateStatus().
|
protected |
Update the status of the parent of this node.
Definition at line 609 of file class.ilStudyProgrammeUserProgress.php.
References getParentProgress().
Referenced by markAccredited(), setLPCompleted(), unmarkAccredited(), and updateStatus().
|
protected |
Updates the status of this progress based on the status of the progress on the sub nodes.
Then update the status of the parent.
Definition at line 557 of file class.ilStudyProgrammeUserProgress.php.
References getAmountOfPoints(), getChildrenProgress(), getStatus(), getStudyProgramme(), hasSuccessfullChildren(), ilStudyProgramme\MODE_LP_COMPLETED, refreshLPStatus(), ilStudyProgrammeProgress\STATUS_ACCREDITED, ilStudyProgrammeProgress\STATUS_COMPLETED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, ilStudyProgrammeProgress\STATUS_NOT_RELEVANT, updateParentStatus(), and ilStudyProgrammeEvents\userSuccessful().
Referenced by markNotRelevant(), markRelevant(), setRequiredAmountOfPoints(), and updateFromProgramNode().
|
protected |
Definition at line 16 of file class.ilStudyProgrammeUserProgress.php.
Referenced by canBeCompleted().
const ilStudyProgrammeUserProgress::ACTION_MARK_ACCREDITED = "mark_accredited" |
Definition at line 718 of file class.ilStudyProgrammeUserProgress.php.
Referenced by ilObjStudyProgrammeMembersGUI\getLinkTargetForAction().
const ilStudyProgrammeUserProgress::ACTION_REMOVE_USER = "remove_user" |
Definition at line 721 of file class.ilStudyProgrammeUserProgress.php.
Referenced by ilObjStudyProgrammeMembersGUI\getLinkTargetForAction().
const ilStudyProgrammeUserProgress::ACTION_SHOW_INDIVIDUAL_PLAN = "show_individual_plan" |
Definition at line 720 of file class.ilStudyProgrammeUserProgress.php.
Referenced by ilObjStudyProgrammeMembersGUI\getLinkTargetForAction().
const ilStudyProgrammeUserProgress::ACTION_UNMARK_ACCREDITED = "unmark_accredited" |
Definition at line 719 of file class.ilStudyProgrammeUserProgress.php.
Referenced by ilObjStudyProgrammeMembersGUI\getLinkTargetForAction().