35 $set = $ilDB->query(
"SELECT *".
37 " WHERE id = ".$ilDB->quote($a_id,
"integer"));
38 if($ilDB->numRows($set))
40 $row = $ilDB->fetchAssoc($set);
41 $obj = self::getInstanceByType(
$row[
"type"]);
42 $obj->importFromDB(
$row);
53 $set = $ilDB->query(
"SELECT *".
55 " WHERE parent = ".$ilDB->quote($a_parent_id,
"integer").
57 while(
$row = $ilDB->fetchAssoc($set))
59 $obj = self::getInstanceByType(
$row[
"type"]);
60 $obj->importFromDB(
$row);
61 $res[$obj->getId()] = $obj;
77 "bool" => $lng->txt(
"exc_criteria_type_bool")
78 ,
"rating" => $lng->txt(
"exc_criteria_type_rating")
79 ,
"text" => $lng->txt(
"exc_criteria_type_text")
80 ,
"file" => $lng->txt(
"exc_criteria_type_file")
92 $class =
"ilExcCriteria".ucfirst(
$a_type);
93 include_once
"Modules/Exercise/classes/class.".$class.
".php";
109 $this->
id = (int)$a_id;
112 abstract public function getType();
116 $this->
parent = ($a_value !== null)
128 $this->title = ($a_value !== null)
140 $this->desc = ($a_value !== null)
152 $this->required = (bool)$a_value;
162 $this->pos = (int)$a_value;
172 $this->def = $a_value;
184 if ($a_def_json !=
"")
186 $def = json_decode($a_def_json,
true);
195 if ($a_def !=
"" && version_compare(PHP_VERSION,
'7.0.0') >= 0)
197 $a_def = @unserialize($a_def,
false);
212 $this->
setId($a_row[
"id"]);
219 ? unserialize($a_row[
"def"])
245 $set = $ilDB->query(
"SELECT MAX(pos) pos".
247 " WHERE parent = ".$ilDB->quote($this->getParent(),
"integer"));
248 $row = $ilDB->fetchAssoc($set);
249 return (
int)
$row[
"pos"];
261 $this->
id = $ilDB->nextId(
"exc_crit");
265 $fields[
"id"] =
array(
"integer", $this->
id);
270 $ilDB->insert(
"exc_crit", $fields);
279 return $this->
save();
282 $primary =
array(
"id"=>
array(
"integer", $this->
id));
286 public function delete()
295 $ilDB->manipulate(
"DELETE FROM exc_crit".
296 " WHERE id = ".$ilDB->quote($this->id,
"integer"));
303 if(!(
int)$a_parent_id)
308 $ilDB->manipulate(
"DELETE FROM exc_crit".
309 " WHERE parent = ".$ilDB->quote($a_parent_id,
"integer"));
315 $new_obj->setParent($a_target_parent_id);
316 $new_obj->setTitle($this->
getTitle());
323 return $new_obj->getId();
351 $this->form = $a_form;
353 $this->giver_id = $a_giver_id;
354 $this->peer_id = $a_peer_id;
371 abstract public function hasValue($a_value);
373 abstract public function getHTML($a_value);
static getInstanceByType($a_type)
importCustomForm(ilPropertyFormGUI $a_form)
static getInstanceById($a_id)
importFromPeerReviewForm()
static deleteByParent($a_parent_id)
setDefinition(array $a_value=null)
exportCustomForm(ilPropertyFormGUI $a_form)
cloneObject($a_target_parent_id)
static getInstancesByParentId($a_parent_id)
importDefinition($a_def, $a_def_json)
Create styles array
The data for the language used.
importFromDB(array $a_row)
initCustomForm(ilPropertyFormGUI $a_form)
setPeerReviewContext(ilExAssignment $a_ass, $a_giver_id, $a_peer_id, ilPropertyFormGUI $a_form=null)
addToPeerReviewForm($a_value=null)