ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
65  $usr_id_list = $input_params['usrIdList'];
66  }
67  if(isset($input_params['discloseMap']))
68  {
69  foreach($input_params['discloseMap'] as $map_entry)
70  {
71  $usr_id_list[] = $map_entry['Anon User'];
72  }
73  }
74 
75  $test_object = new ilObjTest($input_params['tstRefId']);
76  foreach($usr_id_list as $user_id)
77  {
78  $test_object->inviteUser($user_id);
79  }
80  }
Create styles array
The data for the language used.
$params
Definition: example_049.php:96

◆ 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  }
Create styles array
The data for the language used.
$params
Definition: example_049.php:96

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