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

Class ilModulesTestTasks. More...

+ Collaboration diagram for ilModulesTestTasks:

Static Public Member Functions

static createTestInCourse ($context, $params)
 
static assignUsersToTest ($context, $params)
 

Detailed Description

Class ilModulesTestTasks.

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

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

Member Function Documentation

◆ assignUsersToTest()

static ilModulesTestTasks::assignUsersToTest (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params
Returns
array

Definition at line 52 of file class.ilModulesTestTasks.php.

References $params, and array.

53  {
54  require_once './Modules/Test/classes/class.ilObjTest.php';
55  //IN: anonuserlist
56  //OUT: void
57 
58  $input_params = $params[0];
59  $output_params =$params[1];
60 
61  $usr_id_list = array();
62 
63  if (isset($input_params['usrIdList'])) {
64  $usr_id_list = $input_params['usrIdList'];
65  }
66  if (isset($input_params['discloseMap'])) {
67  foreach ($input_params['discloseMap'] as $map_entry) {
68  $usr_id_list[] = $map_entry['Anon User'];
69  }
70  }
71 
72  $test_object = new ilObjTest($input_params['tstRefId']);
73  foreach ($usr_id_list as $user_id) {
74  $test_object->inviteUser($user_id);
75  }
76  }
$params
Definition: disable.php:11
Create styles array
The data for the language used.

◆ createTestInCourse()

static ilModulesTestTasks::createTestInCourse (   $context,
  $params 
)
static
Parameters
ilNode$context
array$params
Returns
array

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

References $params, and array.

20  {
21  //IN: targetref, titlestring
22  //OUT: refid
23  $input_params = $params[0];
24  $output_params =$params[1];
25 
26  require_once './Modules/Test/classes/class.ilObjTest.php';
27 
28  $test_object = new ilObjTest();
29  $test_object->setType('tst');
30  $test_object->setTitle('Prüfung'); // Input?
31  $test_object->setDescription("");
32  $test_object->create(true); // true for upload
33  $test_object->createReference();
34  $test_object->putInTree($input_params['crsRefId']);
35  $test_object->setPermissions($input_params['crsRefId']);
36  $test_object->setFixedParticipants(1);
37  $test_object->createMetaData();
38  $test_object->updateMetaData();
39  $test_object->saveToDb();
40 
41  $retval = array($output_params[0] => $test_object->getRefId());
42 
43  return $retval;
44  }
$params
Definition: disable.php:11
Create styles array
The data for the language used.

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