5 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
30 public function __construct($a_container_id, $a_objective_id, $a_test_type, $a_qpl_sequence)
32 $this->container_id = $a_container_id;
33 $this->objective_id = $a_objective_id;
34 $this->test_type = $a_test_type;
35 $this->qpl_seq = $a_qpl_sequence;
48 public static function lookupLimit($a_container_id, $a_objective_id, $a_test_type)
54 $query =
'SELECT * FROM loc_rnd_qpl ' .
55 'WHERE container_id = ' .
$ilDB->quote($a_container_id,
'integer') .
' ' .
56 'AND objective_id = ' .
$ilDB->quote($a_objective_id,
'integer') .
' ' .
57 'AND tst_type = ' .
$ilDB->quote($a_test_type,
'integer');
60 return $row->percentage;
73 public static function lookupSequences($a_container_id, $a_objective_id, $a_test_id)
79 $query =
'SELECT * FROM loc_rnd_qpl ' .
80 'WHERE container_id = ' .
$ilDB->quote($a_container_id,
'integer') .
' ' .
81 'AND objective_id = ' .
$ilDB->quote($a_objective_id,
'integer') .
' ' .
82 'AND tst_id = ' .
$ilDB->quote($a_test_id,
'integer');
87 $sequences[] =
$row->qp_seq;
89 return (array) $sequences;
105 $ilDB = $DIC[
'ilDB'];
107 $query =
'SELECT * FROM loc_rnd_qpl ' .
108 'WHERE container_id = ' .
$ilDB->quote($a_container_id,
'integer') .
' ' .
109 'AND objective_id = ' .
$ilDB->quote($a_objective_id,
'integer') .
' ' .
110 'AND tst_id = ' .
$ilDB->quote($a_test_id,
'integer') .
' ' .
111 'AND tst_type = ' .
$ilDB->quote($a_test_type,
'integer');
116 $sequences[] =
$row->qp_seq;
118 return (array) $sequences;
133 $ilDB = $DIC[
'ilDB'];
135 $query =
'SELECT objective_id FROM loc_rnd_qpl ' .
136 'WHERE container_id = ' .
$ilDB->quote($a_container_id,
'integer') .
' ' .
137 'AND qp_seq = ' .
$ilDB->quote($a_seq_id,
'integer');
139 $objectiveIds = array();
141 $objectiveIds[] =
$row->objective_id;
143 return $objectiveIds;
149 $this->container_id = $a_id;
159 $this->objective_id = $a_id;
179 $this->test_id = $a_id;
189 $this->qpl_seq = $a_id;
199 $this->limit = $a_id;
212 public function copy($a_copy_id, $a_new_course_id, $a_new_objective_id)
214 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
216 $mappings =
$options->getMappings();
227 $test_ref_id = $ref_id;
228 $mapped_id = $mappings[$ref_id];
239 $new_question_info = $mappings[$test_ref_id .
'_rndSelDef_' . $this->
getQplSequence()];
240 $new_question_arr = explode(
'_', $new_question_info);
241 if (!isset($new_question_arr[2])
or !$new_question_arr[2]) {
243 ilLoggerFactory::getLogger(
'crs')->debug(
'Found invalid or no mapping format of random question id mapping: ' . print_r($new_question_arr,
true));
253 $new_ass->setTestId($mapped_id);
254 $new_ass->setLimit($this->
getLimit());
269 $ilDB = $DIC[
'ilDB'];
271 $query =
'SELECT * FROM loc_rnd_qpl ' .
285 public function delete()
289 $ilDB = $DIC[
'ilDB'];
291 $query =
'DELETE FROM loc_rnd_qpl ' .
310 $query =
'DELETE FROM loc_rnd_qpl ' .
311 'WHERE container_id = ' . $db->quote($a_course_id,
'integer') .
' ' .
312 'AND objective_id = ' . $db->quote($a_objective_id,
'integer') .
' ' .
313 'AND tst_type = ' . $db->quote($a_tst_type,
'integer');
321 $ilDB = $DIC[
'ilDB'];
323 $query =
'INSERT INTO loc_rnd_qpl ' .
324 '(container_id, objective_id, tst_type, tst_id, qp_seq, percentage) ' .
341 $ilDB = $DIC[
'ilDB'];
343 $query =
'SELECT * FROM loc_rnd_qpl ' .
344 'WHERE objective_id = ' .
$ilDB->quote($a_objective_id,
'integer');
347 include_once
'./Modules/Course/classes/Objectives/class.ilLOXmlWriter.php';
352 'objId' =>
$row->tst_id,
353 'testType' =>
$row->tst_type,
354 'limit' =>
$row->percentage,
355 'poolId' =>
$row->qp_seq
static toXml(ilXmlWriter $writer, $a_objective_id)
static lookupSequences($a_container_id, $a_objective_id, $a_test_id)
Lookup sequence ids type $ilDB.
__construct($a_container_id, $a_objective_id, $a_test_type, $a_qpl_sequence)
Constructor.
static deleteForObjectiveAndTestType($a_course_id, $a_objective_id, $a_tst_type)
Delete assignment for objective id and test type.
static _getAllReferences($a_id)
get all reference ids of object
static _getInstance($a_copy_id)
Get instance of copy wizard options.
foreach($_POST as $key=> $value) $res
static lookupSequencesByType($a_container_id, $a_objective_id, $a_test_id, $a_test_type)
Lookup sequence ids type $ilDB.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
static lookupObjectiveIdsBySequence($a_container_id, $a_seq_id)
Lookup objective ids by sequence_id type $ilDB.
copy($a_copy_id, $a_new_course_id, $a_new_objective_id)
Copy assignment.
static getLogger($a_component_id)
Get component logger.
static lookupLimit($a_container_id, $a_objective_id, $a_test_type)
lookup limit type $ilDB
read()
read settings type $ilDB
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.