ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilModulesCourseTasks Class Reference

Class ilModulesCourseTasks. More...

+ Collaboration diagram for ilModulesCourseTasks:

Static Public Member Functions

static readLearnersFromCourse ($context, $params)
 
static readTutorsFromCourse ($context, $params)
 
static readAdminsFromCourse ($context, $params)
 
static createCourse ($context, $params)
 
static assignLearnersToCourse ($context, $params)
 
static assignTutorsToCourse ($context, $params)
 
static assignAdminsToCourse ($context, $params)
 

Detailed Description

Class ilModulesCourseTasks.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 11 of file class.ilModulesCourseTasks.php.

Member Function Documentation

◆ assignAdminsToCourse()

static ilModulesCourseTasks::assignAdminsToCourse (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params

Definition at line 204 of file class.ilModulesCourseTasks.php.

References $params, ilCourseParticipants\_getInstanceByObjId(), ilObject\_lookupObjectId(), and IL_CRS_ADMIN.

205  {
206  /*
207  * Modelling:
208 
209  <bpmn2:extensionElements>
210  <ilias:properties>
211  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesCourseTasks.php" api="ilModulesCourseTasks" method="assignAdminsToCourse" />
212  </ilias:properties>
213  </bpmn2:extensionElements>
214 
215  */
216 
217  require_once './Modules/Course/classes/class.ilCourseParticipants.php';
218  $input_params = $params[0];
219  $output_params = $params[1];
220 
221  $participants = ilCourseParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['crsRefId']));
222  foreach ($input_params['usrIdList'] as $user_id) {
223  $participants->add($user_id, IL_CRS_ADMIN);
224  }
225  return;
226  }
$params
Definition: disable.php:11
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupObjectId($a_ref_id)
lookup object id
const IL_CRS_ADMIN
Base class for course and group participants.
+ Here is the call graph for this function:

◆ assignLearnersToCourse()

static ilModulesCourseTasks::assignLearnersToCourse (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params
Returns
array

Definition at line 147 of file class.ilModulesCourseTasks.php.

References $params, ilCourseParticipants\_getInstanceByObjId(), ilObject\_lookupObjectId(), and IL_CRS_MEMBER.

148  {
149  /*
150  * Modelling:
151 
152  <bpmn2:extensionElements>
153  <ilias:properties>
154  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesCourseTasks.php" api="ilModulesCourseTasks" method="assignLearnersToCourse" />
155  </ilias:properties>
156  </bpmn2:extensionElements>
157 
158  */
159 
160  require_once './Modules/Course/classes/class.ilCourseParticipants.php';
161  $input_params = $params[0];
162  $output_params = $params[1];
163 
164  $participants = ilCourseParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['crsRefId']));
165  foreach ($input_params['usrIdList'] as $user_id) {
166  $participants->add($user_id, IL_CRS_MEMBER);
167  }
168 
169  return;
170  }
$params
Definition: disable.php:11
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupObjectId($a_ref_id)
lookup object id
const IL_CRS_MEMBER
+ Here is the call graph for this function:

◆ assignTutorsToCourse()

static ilModulesCourseTasks::assignTutorsToCourse (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params

Definition at line 176 of file class.ilModulesCourseTasks.php.

References $params, ilCourseParticipants\_getInstanceByObjId(), ilObject\_lookupObjectId(), and IL_CRS_TUTOR.

177  {
178  /*
179  * Modelling:
180 
181  <bpmn2:extensionElements>
182  <ilias:properties>
183  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesCourseTasks.php" api="ilModulesCourseTasks" method="assignTutorsToCourse" />
184  </ilias:properties>
185  </bpmn2:extensionElements>
186 
187  */
188 
189  require_once './Modules/Course/classes/class.ilCourseParticipants.php';
190  $input_params = $params[0];
191  $output_params = $params[1];
192 
193  $participants = ilCourseParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['crsRefId']));
194  foreach ($input_params['usrIdList'] as $user_id) {
195  $participants->add($user_id, IL_CRS_TUTOR);
196  }
197  return;
198  }
$params
Definition: disable.php:11
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
const IL_CRS_TUTOR
static _lookupObjectId($a_ref_id)
lookup object id
+ Here is the call graph for this function:

◆ createCourse()

static ilModulesCourseTasks::createCourse (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params
Returns
array

Definition at line 108 of file class.ilModulesCourseTasks.php.

References $params, and array.

109  {
110  /*
111  * Modelling:
112 
113  <bpmn2:extensionElements>
114  <ilias:properties>
115  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesCourseTasks.php" api="ilModulesCourseTasks" method="createCourse" />
116  </ilias:properties>
117  </bpmn2:extensionElements>
118 
119  */
120 
121 
122  $input_params = $params[0];
123  $output_params =$params[1];
124 
125  require_once './Modules/Course/classes/class.ilObjCourse.php';
126 
127  $course_object = new ilObjCourse();
128  $course_object->setType('crs');
129  $course_object->setTitle($input_params['crsTitle']);
130  $course_object->setDescription("");
131  $course_object->create(true); // true for upload
132  $course_object->createReference();
133  $course_object->putInTree($input_params['destRefId']);
134  $course_object->setPermissions($input_params['destRefId']);
135 
136  $retval = array($output_params[0] => $course_object->getRefId());
137 
138  return $retval;
139  }
$params
Definition: disable.php:11
Class ilObjCourse.
Create styles array
The data for the language used.

◆ readAdminsFromCourse()

static ilModulesCourseTasks::readAdminsFromCourse (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params
Returns
array

Definition at line 78 of file class.ilModulesCourseTasks.php.

References $params, ilCourseParticipants\_getInstanceByObjId(), ilObject\_lookupObjectId(), and array.

79  {
80  /*
81  * Modelling:
82 
83  <bpmn2:extensionElements>
84  <ilias:properties>
85  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesCourseTasks.php" api="ilModulesCourseTasks" method="readAdminsFromCourse" />
86  </ilias:properties>
87  </bpmn2:extensionElements>
88 
89  */
90 
91  require_once './Modules/Course/classes/class.ilCourseParticipants.php';
92  $input_params = $params[0];
93  $output_params = $params[1];
94 
95  $participants = ilCourseParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['crsRefId']));
96  $admins = $participants->getAdmins();
97  $retval = array($output_params[0] => $admins);
98 
99  return $retval;
100  }
$params
Definition: disable.php:11
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupObjectId($a_ref_id)
lookup object id
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ readLearnersFromCourse()

static ilModulesCourseTasks::readLearnersFromCourse (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params
Returns
array

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

References $params, ilCourseParticipants\_getInstanceByObjId(), ilObject\_lookupObjectId(), and array.

20  {
21  /*
22  * Modelling:
23 
24  <bpmn2:extensionElements>
25  <ilias:properties>
26  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesCourseTasks.php" api="ilModulesCourseTasks" method="readLearnersFromCourse" />
27  </ilias:properties>
28  </bpmn2:extensionElements>
29 
30  */
31  require_once './Modules/Course/classes/class.ilCourseParticipants.php';
32  $input_params = $params[0];
33  $output_params = $params[1];
34 
35  $participants = ilCourseParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['crsRefId']));
36  $learners = $participants->getMembers();
37  $retval = array($output_params[0] => $learners);
38 
39  return $retval;
40  }
$params
Definition: disable.php:11
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupObjectId($a_ref_id)
lookup object id
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ readTutorsFromCourse()

static ilModulesCourseTasks::readTutorsFromCourse (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params
Returns
array

Definition at line 48 of file class.ilModulesCourseTasks.php.

References $params, ilCourseParticipants\_getInstanceByObjId(), ilObject\_lookupObjectId(), and array.

49  {
50  /*
51  * Modelling:
52 
53  <bpmn2:extensionElements>
54  <ilias:properties>
55  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesCourseTasks.php" api="ilModulesCourseTasks" method="readTutorsFromCourse" />
56  </ilias:properties>
57  </bpmn2:extensionElements>
58 
59  */
60 
61  require_once './Modules/Course/classes/class.ilCourseParticipants.php';
62  $input_params = $params[0];
63  $output_params = $params[1];
64 
65  $participants = ilCourseParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['crsRefId']));
66  $tutors = $participants->getTutors();
67  $retval = array($output_params[0] => $tutors);
68 
69  return $retval;
70  }
$params
Definition: disable.php:11
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupObjectId($a_ref_id)
lookup object id
Create styles array
The data for the language used.
+ Here is the call graph for this function:

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