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)
52 $query =
'SELECT * FROM loc_rnd_qpl ' .
53 'WHERE container_id = ' . $ilDB->quote($a_container_id,
'integer') .
' ' .
54 'AND objective_id = ' . $ilDB->quote($a_objective_id,
'integer') .
' ' .
55 'AND tst_type = ' . $ilDB->quote($a_test_type,
'integer');
58 return $row->percentage;
71 public static function lookupSequences($a_container_id, $a_objective_id, $a_test_id)
75 $query =
'SELECT * FROM loc_rnd_qpl ' .
76 'WHERE container_id = ' . $ilDB->quote($a_container_id,
'integer') .
' ' .
77 'AND objective_id = ' . $ilDB->quote($a_objective_id,
'integer') .
' ' .
78 'AND tst_id = ' . $ilDB->quote($a_test_id,
'integer');
83 $sequences[] =
$row->qp_seq;
85 return (
array) $sequences;
101 $query =
'SELECT * FROM loc_rnd_qpl ' .
102 'WHERE container_id = ' . $ilDB->quote($a_container_id,
'integer') .
' ' .
103 'AND objective_id = ' . $ilDB->quote($a_objective_id,
'integer') .
' ' .
104 'AND tst_id = ' . $ilDB->quote($a_test_id,
'integer') .
' ' .
105 'AND tst_type = ' . $ilDB->quote($a_test_type,
'integer');
110 $sequences[] =
$row->qp_seq;
112 return (
array) $sequences;
127 $query =
'SELECT objective_id FROM loc_rnd_qpl ' .
128 'WHERE container_id = ' . $ilDB->quote($a_container_id,
'integer') .
' ' .
129 'AND qp_seq = ' . $ilDB->quote($a_seq_id,
'integer');
131 $objectiveIds =
array();
133 $objectiveIds[] =
$row->objective_id;
135 return $objectiveIds;
141 $this->container_id = $a_id;
151 $this->objective_id = $a_id;
171 $this->test_id = $a_id;
181 $this->qpl_seq = $a_id;
191 $this->limit = $a_id;
204 public function copy($a_copy_id, $a_new_course_id, $a_new_objective_id)
206 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
208 $mappings =
$options->getMappings();
219 $test_ref_id = $ref_id;
220 $mapped_id = $mappings[$ref_id];
231 $new_question_info = $mappings[$test_ref_id .
'_rndSelDef_' . $this->
getQplSequence()];
232 $new_question_arr = explode(
'_', $new_question_info);
233 if (!isset($new_question_arr[2]) or !$new_question_arr[2]) {
235 ilLoggerFactory::getLogger(
'crs')->debug(
'Found invalid or no mapping format of random question id mapping: ' . print_r($new_question_arr,
true));
245 $new_ass->setTestId($mapped_id);
246 $new_ass->setLimit($this->
getLimit());
261 $query =
'SELECT * FROM loc_rnd_qpl ' .
262 'WHERE container_id = ' . $ilDB->quote($this->
getContainerId(),
'integer') .
' ' .
263 'AND objective_id = ' . $ilDB->quote($this->
getObjectiveId(),
'integer') .
' ' .
264 'AND tst_type = ' . $ilDB->quote($this->
getTestType(),
'integer') .
' ' .
265 'AND qp_seq = ' . $ilDB->quote($this->
getQplSequence(),
'integer');
275 public function delete()
279 $query =
'DELETE FROM loc_rnd_qpl ' .
280 'WHERE container_id = ' . $ilDB->quote($this->
getContainerId(),
'integer') .
' ' .
281 'AND objective_id = ' . $ilDB->quote($this->
getObjectiveId(),
'integer') .
' ' .
282 'AND tst_type = ' . $ilDB->quote($this->
getTestType(),
'integer') .
' ' .
283 'AND qp_seq = ' . $ilDB->quote($this->
getQplSequence(),
'integer');
284 $ilDB->manipulate(
$query);
297 $query =
'DELETE FROM loc_rnd_qpl ' .
298 'WHERE container_id = ' . $db->quote($a_course_id,
'integer') .
' ' .
299 'AND objective_id = ' . $db->quote($a_objective_id,
'integer') .
' ' .
300 'AND tst_type = ' . $db->quote($a_tst_type,
'integer');
308 $query =
'INSERT INTO loc_rnd_qpl ' .
309 '(container_id, objective_id, tst_type, tst_id, qp_seq, percentage) ' .
313 $ilDB->quote($this->
getTestType(),
'integer') .
', ' .
314 $ilDB->quote($this->
getTestId(),
'integer') .
', ' .
316 $ilDB->quote($this->
getLimit()) .
' ' .
318 $ilDB->manipulate(
$query);
326 $query =
'SELECT * FROM loc_rnd_qpl ' .
327 'WHERE objective_id = ' . $ilDB->quote($a_objective_id,
'integer');
330 include_once
'./Modules/Course/classes/Objectives/class.ilLOXmlWriter.php';
335 'objId' =>
$row->tst_id,
336 'testType' =>
$row->tst_type,
337 'limit' =>
$row->percentage,
338 '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.
deleteForObjectiveAndTestType($a_course_id, $a_objective_id, $a_tst_type)
Delete assignment for objective id and test type.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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.
Create styles array
The data for the language used.
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
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options