ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLOTestAssignment Class Reference

Settings for LO courses. More...

+ Collaboration diagram for ilLOTestAssignment:

Public Member Functions

 __construct ($a_id=0)
 constructor More...
 
 setAssignmentId ($a_id)
 
 getAssignmentId ()
 
 setContainerId ($a_id)
 
 getContainerId ()
 
 setAssignmentType ($a_type)
 
 getAssignmentType ()
 
 setObjectiveId ($a_id)
 
 getObjectiveId ()
 
 setTestRefId ($a_id)
 
 getTestRefId ()
 
 save ()
 save settings More...
 
 create ()
 Create new aassignment @global type $ilDB. More...
 
 update ()
 Update assignment @global type $ilDB. More...
 
 delete ()
 Delete assignment @global type $ilDB. More...
 
 read ()
 Read db entry @global type $ilDB. More...
 
 cloneSettings ($a_copy_id, $a_target_id, $a_objective_id)
 Clone assignments. More...
 

Private Attributes

 $assignment_id = 0
 
 $container_id = 0
 
 $assignment_type = 0
 
 $objective_id = 0
 
 $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 10 of file class.ilLOTestAssignment.php.

Constructor & Destructor Documentation

◆ __construct()

ilLOTestAssignment::__construct (   $a_id = 0)

constructor

Parameters
type$a_id

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

24 {
25 $this->setAssignmentId($a_id);
26 $this->read();
27 }
read()
Read db entry @global type $ilDB.

References read(), and setAssignmentId().

+ Here is the call graph for this function:

Member Function Documentation

◆ cloneSettings()

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

Clone assignments.

Parameters
type$a_target_id
type$a_copy_id

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

184 {
185 include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
187 $mappings = $options->getMappings();
188
189 if (!array_key_exists($this->getTestRefId(), $mappings)) {
190 return false;
191 }
192
193 $copy = new ilLOTestAssignment();
194 $copy->setContainerId($a_target_id);
195 $copy->setAssignmentType($this->getAssignmentType());
196 $copy->setObjectiveId($a_objective_id);
197 $copy->setTestRefId($mappings[$this->getTestRefId()]);
198 $copy->create();
199 }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Settings for LO courses.

References PHPMailer\PHPMailer\$options, ilCopyWizardOptions\_getInstance(), getAssignmentType(), and getTestRefId().

+ Here is the call graph for this function:

◆ create()

ilLOTestAssignment::create ( )

Create new aassignment @global type $ilDB.

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

97 {
98 global $DIC;
99
100 $ilDB = $DIC['ilDB'];
101
102 $this->setAssignmentId($ilDB->nextId('loc_tst_assignments'));
103 $query = 'INSERT INTO loc_tst_assignments (assignment_id, container_id, assignment_type, objective_id, tst_ref_id) ' .
104 'VALUES ( ' .
105 $ilDB->quote($this->getAssignmentId(), 'integer') . ', ' .
106 $ilDB->quote($this->getContainerId(), 'integer') . ', ' .
107 $ilDB->quote($this->getAssignmentType(), 'integer') . ', ' .
108 $ilDB->quote($this->getObjectiveId(), 'integer') . ', ' .
109 $ilDB->quote($this->getTestRefId(), 'integer') . ' ' .
110 ') ';
111 $GLOBALS['DIC']['ilLog']->write($query);
112 $ilDB->manipulate($query);
113 }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
$query
global $DIC
Definition: saml.php:7
global $ilDB

References $DIC, $GLOBALS, $ilDB, $query, getAssignmentId(), getAssignmentType(), getContainerId(), getObjectiveId(), getTestRefId(), and setAssignmentId().

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilLOTestAssignment::delete ( )

Delete assignment @global type $ilDB.

Returns
boolean

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

140 {
141 global $DIC;
142
143 $ilDB = $DIC['ilDB'];
144
145 $query = 'DELETE FROM loc_tst_assignments ' .
146 'WHERE assignment_id = ' . $ilDB->quote($this->getAssignmentId(), 'integer') . ' ';
147 $ilDB->manipulate($query);
148 return true;
149 }

References $DIC, $ilDB, $query, and getAssignmentId().

+ Here is the call graph for this function:

◆ getAssignmentId()

ilLOTestAssignment::getAssignmentId ( )

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

References $assignment_id.

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

+ Here is the caller graph for this function:

◆ getAssignmentType()

ilLOTestAssignment::getAssignmentType ( )

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

References $assignment_type.

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

+ Here is the caller graph for this function:

◆ getContainerId()

ilLOTestAssignment::getContainerId ( )

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

References $container_id.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getObjectiveId()

ilLOTestAssignment::getObjectiveId ( )

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

References $objective_id.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getTestRefId()

ilLOTestAssignment::getTestRefId ( )

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

References $test_ref_id.

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

+ Here is the caller graph for this function:

◆ read()

ilLOTestAssignment::read ( )

Read db entry @global type $ilDB.

Returns
boolean

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

157 {
158 global $DIC;
159
160 $ilDB = $DIC['ilDB'];
161
162 if (!$this->getAssignmentId()) {
163 return false;
164 }
165
166 $query = 'SELECT * FROM loc_tst_assignments ' .
167 'WHERE assignment_id = ' . $ilDB->quote($this->getAssignmentId(), 'integer') . ' ';
168 $res = $ilDB->query($query);
169 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
170 $this->setContainerId($row->container_id);
171 $this->setObjectiveId($row->objective_id);
172 $this->setAssignmentType($row->assignment_type);
173 $this->setTestRefId($row->tst_ref_id);
174 }
175 return true;
176 }
$row
foreach($_POST as $key=> $value) $res

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilLOTestAssignment::save ( )

save settings

Returns
type

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

84 {
85 if ($this->getAssignmentId()) {
86 return $this->update();
87 } else {
88 return $this->create();
89 }
90 }
update()
Update assignment @global type $ilDB.
create()
Create new aassignment @global type $ilDB.

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

+ Here is the call graph for this function:

◆ setAssignmentId()

ilLOTestAssignment::setAssignmentId (   $a_id)

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

30 {
31 $this->assignment_id = $a_id;
32 }

Referenced by __construct(), and create().

+ Here is the caller graph for this function:

◆ setAssignmentType()

ilLOTestAssignment::setAssignmentType (   $a_type)

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

50 {
51 $this->assignment_type = $a_type;
52 }
$a_type
Definition: workflow.php:92

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ setContainerId()

ilLOTestAssignment::setContainerId (   $a_id)

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

40 {
41 $this->container_id = $a_id;
42 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setObjectiveId()

ilLOTestAssignment::setObjectiveId (   $a_id)

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

60 {
61 $this->objective_id = $a_id;
62 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTestRefId()

ilLOTestAssignment::setTestRefId (   $a_id)

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

70 {
71 $this->test_ref_id = $a_id;
72 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilLOTestAssignment::update ( )

Update assignment @global type $ilDB.

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

120 {
121 global $DIC;
122
123 $ilDB = $DIC['ilDB'];
124
125 $query = 'UPDATE loc_tst_assignments ' .
126 'SET container_id = ' . $ilDB->quote($this->getContainerId(), 'integer') . ', ' .
127 'assignment_type = ' . $ilDB->quote($this->getAssignmentType(), 'integer') . ', ' .
128 'objective_id = ' . $ilDB->quote($this->getObjectiveId(), 'integer') . ', ' .
129 'tst_ref_id = ' . $ilDB->quote($this->getTestRefId(), 'integer') . ' ' .
130 'WHERE assignment_id = ' . $ilDB->quote($this->getAssignmentId(), 'integer');
131 $ilDB->manipulate($query);
132 }

References $DIC, $ilDB, $query, getAssignmentId(), getAssignmentType(), getContainerId(), getObjectiveId(), and getTestRefId().

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $assignment_id

ilLOTestAssignment::$assignment_id = 0
private

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

Referenced by getAssignmentId().

◆ $assignment_type

ilLOTestAssignment::$assignment_type = 0
private

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

Referenced by getAssignmentType().

◆ $container_id

ilLOTestAssignment::$container_id = 0
private

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

Referenced by getContainerId().

◆ $objective_id

ilLOTestAssignment::$objective_id = 0
private

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

Referenced by getObjectiveId().

◆ $test_ref_id

ilLOTestAssignment::$test_ref_id = 0
private

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

Referenced by getTestRefId().


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