5 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
30 public function __construct($a_container_id, $a_objective_id, $a_test_type)
32 $this->container_id = $a_container_id;
33 $this->objective_id = $a_objective_id;
34 $this->test_type = $a_test_type;
39 public static function lookupLimit($a_container_id, $a_objective_id, $a_test_type)
43 $query =
'SELECT * FROM loc_rnd_qpl '.
44 'WHERE container_id = '.$ilDB->quote($a_container_id,
'integer').
' '.
45 'AND objective_id = '.$ilDB->quote($a_objective_id,
'integer').
' '.
46 'AND tst_type = '.$ilDB->quote($a_test_type,
'integer');
50 return $row->percentage;
55 public static function lookupSequence($a_container_id, $a_objective_id, $a_test_id)
59 $query =
'SELECT * FROM loc_rnd_qpl '.
60 'WHERE container_id = '.$ilDB->quote($a_container_id,
'integer').
' '.
61 'AND objective_id = '.$ilDB->quote($a_objective_id,
'integer').
' '.
62 'AND tst_id = '.$ilDB->quote($a_test_id,
'integer');
79 $query =
'SELECT objective_id FROM loc_rnd_qpl '.
80 'WHERE container_id = '.$ilDB->quote($a_container_id,
'integer').
' '.
81 'AND qp_seq = '.$ilDB->quote($a_seq_id,
'integer');
83 $objectiveIds =
array();
86 $objectiveIds[] =
$row->objective_id;
94 $this->container_id = $a_id;
104 $this->objective_id = $a_id;
124 $this->test_id = $a_id;
134 $this->qpl_seq = $a_id;
144 $this->limit = $a_id;
157 public function copy($a_copy_id, $a_new_course_id, $a_new_objective_id)
159 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
161 $mappings =
$options->getMappings();
168 $new_ass->setLimit($this->
getLimit());
176 $mapped_id = $mappings[
$ref_id];
188 $new_ass->setTestId($mapped_id);
191 $new_question_info = $mappings[$test_ref_id.
'_rndSelDef_'.$this->
getQplSequence()];
192 $new_question_arr = explode(
'_',$new_question_info);
193 if(!isset($new_question_arr[2])
or !$new_question_arr[2])
196 ilLoggerFactory::getLogger(
'crs')->debug(
'Found invalid or no mapping format of random question id mapping: ' . print_r($new_question_arr,TRUE));
200 $new_ass->setQplSequence($new_question_arr[2]);
209 $query =
'SELECT * FROM loc_rnd_qpl '.
210 'WHERE container_id = '.$ilDB->quote($this->
getContainerId(),
'integer').
' '.
211 'AND objective_id = '.$ilDB->quote($this->
getObjectiveId(),
'integer').
' '.
212 'AND tst_type = '.$ilDB->quote($this->
getTestType(),
'integer');
224 public function delete()
228 $query =
'DELETE FROM loc_rnd_qpl '.
229 'WHERE container_id = '.$ilDB->quote($this->
getContainerId(),
'integer').
' '.
230 'AND objective_id = '.$ilDB->quote($this->
getObjectiveId(),
'integer').
' '.
231 'AND tst_type = '.$ilDB->quote($this->
getTestType(),
'integer');
232 $ilDB->manipulate(
$query);
239 $query =
'INSERT INTO loc_rnd_qpl ' .
240 '(container_id, objective_id, tst_type, tst_id, qp_seq, percentage) '.
245 $ilDB->quote($this->
getTestId(),
'integer').
', '.
247 $ilDB->quote($this->
getLimit()).
' '.
249 $ilDB->manipulate(
$query);
257 $query =
'SELECT * FROM loc_rnd_qpl '.
258 'WHERE objective_id = '.$ilDB->quote($a_objective_id,
'integer');
262 include_once
'./Modules/Course/classes/Objectives/class.ilLOXmlWriter.php';
267 'objId' =>
$row->tst_id,
268 'testType' =>
$row->tst_type,
269 'limit' =>
$row->percentage,
270 'poolId' =>
$row->qp_seq
static toXml(ilXmlWriter $writer, $a_objective_id)
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
__construct($a_container_id, $a_objective_id, $a_test_type)
Constructor.
static _getAllReferences($a_id)
get all reference ids of object
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static lookupSequence($a_container_id, $a_objective_id, $a_test_id)
if(!is_array($argv)) $options
Create styles array
The data for the language used.
static lookupObjectiveIdsBySequence($a_container_id, $a_seq_id)
Lookup objective id by sequence.
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)