5 require_once(
"./Modules/StudyProgramme/classes/model/class.ilStudyProgrammeAssignment.php");
25 $this->assignment = $a_id_or_model;
28 $this->assignment = ilStudyProgrammeAssignment::find($a_id_or_model);
30 if ($this->assignment === null) {
31 throw new ilException(
"ilStudyProgrammeUserAssignment::__construct: " 32 .
"Unknown assignmemt id '$a_id_or_model'.");
63 foreach($assignments as $ass) {
66 if($tree->isInTree($value)) {
85 return array_map(
function($ass) {
87 }, array_values($assignments));
96 return $this->assignment->getId();
108 require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
111 throw new ilException(
"ilStudyProgrammeUserAssignment::getStudyProgramme: " 112 .
"could not find ref_id for program '" 113 .$this->assignment->getRootId().
"'.");
134 return $this->assignment->getUserId();
147 public function delete() {
148 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
150 foreach ($progresses as $progress) {
154 $this->assignment->delete();
163 public function updateFromProgram() {
165 $id = $this->
getId();
167 $prg->applyToSubTreeNodes(
function($node) use ($id) {
172 $progress = $node->getProgressForAssignment($id);
173 return $progress->updateFromProgramNode();
187 require_once(
"Modules/StudyProgramme/classes/exceptions/class.ilStudyProgrammeNoProgressForAssignmentException.php");
190 $id = $this->
getId();
193 $prg->applyToSubTreeNodes(
function($node) use ($id) {
195 $node->getProgressForAssignment($id);
200 $ilLog->write(
"Adding progress for: ".$this->
getId().
" ".$node->getId());
201 require_once(
"Modules/StudyProgramme/classes/model/class.ilStudyProgrammeProgress.php");
__construct($a_id_or_model)
Throws when id does not refer to a study programme assignment.
Base class for ILIAS Exception handling.
static createFor(ilStudyProgramme $a_prg, ilStudyProgrammeAssignment $a_ass)
Create a new progress object for a given program node and assignment.
addMissingProgresses()
Add missing progresses for new nodes in the programm.
deassign()
Remove this assignment.
getStudyProgramme()
Get the program node where this assignment was made.
getRootProgress()
Get the progress on the root node of the programme.
Exception is thrown when a progress for some programme node and assignment is missing.
static where($where, $operator=null)
static _getAllReferences($a_id)
get all reference ids of object
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.
static getInstancesForAssignment($a_assignment_id)
Get the instance for an assignment.
Class ilStudyProgrammeAssignment.
const STATUS_NOT_RELEVANT
getUserId()
Get the id of the user who is assigned.
getId()
Get the id of the assignment.
Create styles array
The data for the language used.
static getInstancesForProgram($a_program_id)
Get all assignments that were made to the given program.
static getInstancesOfUser($a_user_id)
Get all instances for a given user.
static getInstance($a_id)
Get an instance.
Represents one assignment of a user to a study programme.