ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLOTestAssignment Class Reference

Settings for LO courses. More...

+ Collaboration diagram for ilLOTestAssignment:

Public Member Functions

 __construct (int $a_id=0)
 
 setAssignmentId (int $a_id)
 
 getAssignmentId ()
 
 setContainerId (int $a_id)
 
 getContainerId ()
 
 setAssignmentType (int $a_type)
 
 getAssignmentType ()
 
 setObjectiveId (int $a_id)
 
 getObjectiveId ()
 
 setTestRefId (int $a_id)
 
 getTestRefId ()
 
 save ()
 
 create ()
 
 update ()
 
 delete ()
 
 read ()
 
 cloneSettings (int $a_copy_id, int $a_target_id, int $a_objective_id)
 

Protected Attributes

ilDBInterface $db
 

Private Attributes

int $assignment_id = 0
 
int $container_id = 0
 
int $assignment_type = 0
 
int $objective_id = 0
 
int $test_ref_id = 0
 

Detailed Description

Settings for LO courses.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 25 of file class.ilLOTestAssignment.php.

Constructor & Destructor Documentation

◆ __construct()

ilLOTestAssignment::__construct ( int  $a_id = 0)

Definition at line 35 of file class.ilLOTestAssignment.php.

References $DIC, read(), and setAssignmentId().

36  {
37  global $DIC;
38 
39  $this->db = $DIC->database();
40  $this->setAssignmentId($a_id);
41  $this->read();
42  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ cloneSettings()

ilLOTestAssignment::cloneSettings ( int  $a_copy_id,
int  $a_target_id,
int  $a_objective_id 
)

Definition at line 152 of file class.ilLOTestAssignment.php.

References ilCopyWizardOptions\_getInstance(), getAssignmentType(), and getTestRefId().

152  : void
153  {
154  $options = ilCopyWizardOptions::_getInstance($a_copy_id);
155  $mappings = $options->getMappings();
156 
157  if (!array_key_exists($this->getTestRefId(), $mappings)) {
158  return;
159  }
160 
161  $copy = new ilLOTestAssignment();
162  $copy->setContainerId($a_target_id);
163  $copy->setAssignmentType($this->getAssignmentType());
164  $copy->setObjectiveId($a_objective_id);
165  $copy->setTestRefId($mappings[$this->getTestRefId()]);
166  $copy->create();
167  }
Settings for LO courses.
static _getInstance(int $a_copy_id)
+ Here is the call graph for this function:

◆ create()

ilLOTestAssignment::create ( )

Definition at line 103 of file class.ilLOTestAssignment.php.

References getAssignmentId(), getAssignmentType(), getContainerId(), getObjectiveId(), getTestRefId(), and setAssignmentId().

Referenced by save().

103  : void
104  {
105  $this->setAssignmentId($this->db->nextId('loc_tst_assignments'));
106  $query = 'INSERT INTO loc_tst_assignments (assignment_id, container_id, assignment_type, objective_id, tst_ref_id) ' .
107  'VALUES ( ' .
108  $this->db->quote($this->getAssignmentId(), 'integer') . ', ' .
109  $this->db->quote($this->getContainerId(), 'integer') . ', ' .
110  $this->db->quote($this->getAssignmentType(), 'integer') . ', ' .
111  $this->db->quote($this->getObjectiveId(), 'integer') . ', ' .
112  $this->db->quote($this->getTestRefId(), 'integer') . ' ' .
113  ') ';
114  $this->db->manipulate($query);
115  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilLOTestAssignment::delete ( )

Definition at line 128 of file class.ilLOTestAssignment.php.

References getAssignmentId().

128  : void
129  {
130  $query = 'DELETE FROM loc_tst_assignments ' .
131  'WHERE assignment_id = ' . $this->db->quote($this->getAssignmentId(), 'integer') . ' ';
132  $this->db->manipulate($query);
133  }
+ Here is the call graph for this function:

◆ getAssignmentId()

ilLOTestAssignment::getAssignmentId ( )

Definition at line 49 of file class.ilLOTestAssignment.php.

References $assignment_id.

Referenced by create(), delete(), read(), save(), and update().

49  : int
50  {
51  return $this->assignment_id;
52  }
+ Here is the caller graph for this function:

◆ getAssignmentType()

ilLOTestAssignment::getAssignmentType ( )

Definition at line 69 of file class.ilLOTestAssignment.php.

References $assignment_type.

Referenced by cloneSettings(), create(), and update().

69  : int
70  {
72  }
+ Here is the caller graph for this function:

◆ getContainerId()

ilLOTestAssignment::getContainerId ( )

Definition at line 59 of file class.ilLOTestAssignment.php.

References $container_id.

Referenced by create(), and update().

59  : int
60  {
61  return $this->container_id;
62  }
+ Here is the caller graph for this function:

◆ getObjectiveId()

ilLOTestAssignment::getObjectiveId ( )

Definition at line 79 of file class.ilLOTestAssignment.php.

References $objective_id.

Referenced by create(), and update().

79  : int
80  {
81  return $this->objective_id;
82  }
+ Here is the caller graph for this function:

◆ getTestRefId()

ilLOTestAssignment::getTestRefId ( )

Definition at line 89 of file class.ilLOTestAssignment.php.

References $test_ref_id.

Referenced by cloneSettings(), create(), and update().

89  : int
90  {
91  return $this->test_ref_id;
92  }
+ Here is the caller graph for this function:

◆ read()

ilLOTestAssignment::read ( )

Definition at line 135 of file class.ilLOTestAssignment.php.

References $res, ilDBConstants\FETCHMODE_OBJECT, getAssignmentId(), setAssignmentType(), setContainerId(), setObjectiveId(), and setTestRefId().

Referenced by __construct().

135  : void
136  {
137  if (!$this->getAssignmentId()) {
138  return;
139  }
140 
141  $query = 'SELECT * FROM loc_tst_assignments ' .
142  'WHERE assignment_id = ' . $this->db->quote($this->getAssignmentId(), 'integer') . ' ';
143  $res = $this->db->query($query);
144  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
145  $this->setContainerId((int) $row->container_id);
146  $this->setObjectiveId((int) $row->objective_id);
147  $this->setAssignmentType((int) $row->assignment_type);
148  $this->setTestRefId((int) $row->tst_ref_id);
149  }
150  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilLOTestAssignment::save ( )

Definition at line 94 of file class.ilLOTestAssignment.php.

References create(), getAssignmentId(), and update().

94  : void
95  {
96  if ($this->getAssignmentId()) {
97  $this->update();
98  } else {
99  $this->create();
100  }
101  }
+ Here is the call graph for this function:

◆ setAssignmentId()

ilLOTestAssignment::setAssignmentId ( int  $a_id)

Definition at line 44 of file class.ilLOTestAssignment.php.

Referenced by __construct(), and create().

44  : void
45  {
46  $this->assignment_id = $a_id;
47  }
+ Here is the caller graph for this function:

◆ setAssignmentType()

ilLOTestAssignment::setAssignmentType ( int  $a_type)

Definition at line 64 of file class.ilLOTestAssignment.php.

Referenced by read().

64  : void
65  {
66  $this->assignment_type = $a_type;
67  }
+ Here is the caller graph for this function:

◆ setContainerId()

ilLOTestAssignment::setContainerId ( int  $a_id)

Definition at line 54 of file class.ilLOTestAssignment.php.

Referenced by read().

54  : void
55  {
56  $this->container_id = $a_id;
57  }
+ Here is the caller graph for this function:

◆ setObjectiveId()

ilLOTestAssignment::setObjectiveId ( int  $a_id)

Definition at line 74 of file class.ilLOTestAssignment.php.

Referenced by read().

74  : void
75  {
76  $this->objective_id = $a_id;
77  }
+ Here is the caller graph for this function:

◆ setTestRefId()

ilLOTestAssignment::setTestRefId ( int  $a_id)

Definition at line 84 of file class.ilLOTestAssignment.php.

Referenced by read().

84  : void
85  {
86  $this->test_ref_id = $a_id;
87  }
+ Here is the caller graph for this function:

◆ update()

ilLOTestAssignment::update ( )

Definition at line 117 of file class.ilLOTestAssignment.php.

References getAssignmentId(), getAssignmentType(), getContainerId(), getObjectiveId(), and getTestRefId().

Referenced by save().

117  : void
118  {
119  $query = 'UPDATE loc_tst_assignments ' .
120  'SET container_id = ' . $this->db->quote($this->getContainerId(), 'integer') . ', ' .
121  'assignment_type = ' . $this->db->quote($this->getAssignmentType(), 'integer') . ', ' .
122  'objective_id = ' . $this->db->quote($this->getObjectiveId(), 'integer') . ', ' .
123  'tst_ref_id = ' . $this->db->quote($this->getTestRefId(), 'integer') . ' ' .
124  'WHERE assignment_id = ' . $this->db->quote($this->getAssignmentId(), 'integer');
125  $this->db->manipulate($query);
126  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $assignment_id

int ilLOTestAssignment::$assignment_id = 0
private

Definition at line 27 of file class.ilLOTestAssignment.php.

Referenced by getAssignmentId().

◆ $assignment_type

int ilLOTestAssignment::$assignment_type = 0
private

Definition at line 29 of file class.ilLOTestAssignment.php.

Referenced by getAssignmentType().

◆ $container_id

int ilLOTestAssignment::$container_id = 0
private

Definition at line 28 of file class.ilLOTestAssignment.php.

Referenced by getContainerId().

◆ $db

ilDBInterface ilLOTestAssignment::$db
protected

Definition at line 33 of file class.ilLOTestAssignment.php.

◆ $objective_id

int ilLOTestAssignment::$objective_id = 0
private

Definition at line 30 of file class.ilLOTestAssignment.php.

Referenced by getObjectiveId().

◆ $test_ref_id

int ilLOTestAssignment::$test_ref_id = 0
private

Definition at line 31 of file class.ilLOTestAssignment.php.

Referenced by getTestRefId().


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