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 $a_def = @unserialize($a_def);
199 $this->
setId($a_row[
"id"]);
206 ? unserialize($a_row[
"def"])
213 "type" => array(
"text", $this->
getType())
214 ,
"title" => array(
"text", $this->
getTitle())
216 ,
"required" => array(
"integer", $this->
isRequired())
232 $set = $ilDB->query(
"SELECT MAX(pos) pos".
234 " WHERE parent = ".$ilDB->quote($this->getParent(),
"integer"));
235 $row = $ilDB->fetchAssoc($set);
236 return (
int)
$row[
"pos"];
248 $this->
id = $ilDB->nextId(
"exc_crit");
252 $fields[
"id"] = array(
"integer", $this->
id);
253 $fields[
"type"] = array(
"text", $this->
getType());
254 $fields[
"parent"] = array(
"integer", $this->
getParent());
257 $ilDB->insert(
"exc_crit", $fields);
266 return $this->
save();
269 $primary = array(
"id"=>array(
"integer", $this->
id));
273 public function delete()
282 $ilDB->manipulate(
"DELETE FROM exc_crit".
283 " WHERE id = ".$ilDB->quote($this->id,
"integer"));
290 if(!(
int)$a_parent_id)
295 $ilDB->manipulate(
"DELETE FROM exc_crit".
296 " WHERE parent = ".$ilDB->quote($a_parent_id,
"integer"));
302 $new_obj->setParent($a_target_parent_id);
303 $new_obj->setTitle($this->
getTitle());
310 return $new_obj->getId();
338 $this->form = $a_form;
340 $this->giver_id = $a_giver_id;
341 $this->peer_id = $a_peer_id;
358 abstract public function hasValue($a_value);
360 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)
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)