4 include_once
'classes/class.ilSaxParser.php';
5 include_once
'Modules/Exercise/classes/class.ilExerciseException.php';
6 include_once
'Modules/Exercise/classes/class.ilExerciseXMLWriter.php';
69 $this->result =
false;
81 xml_set_object($a_xml_parser,$this);
82 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
83 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
101 if (isset($a_attribs[
"obj_id"]))
104 if ($this->obj_id != -1 && (
int) $read_obj_id != -1 && (
int) $this->obj_id != (
int) $read_obj_id)
111 $this->usr_action = $a_attribs[
"action"];
116 $this->file_action = $a_attribs[
"action"];
120 if ($a_attribs[
"mode"] ==
"GZIP")
122 if (!function_exists(
"gzdecode"))
126 }
elseif ($a_attribs[
"mode"] ==
"ZLIB")
128 if (!function_exists(
"gzuncompress"))
135 $this->status = $a_attribs[
"status"];
137 $this->status =
"notgraded";
139 $this->status =
"passed";
141 $this->status =
"failed";
160 $this->result =
true;
163 $this->exercise->setTitle(trim($this->cdata));
166 $this->exercise->setDescription(trim($this->cdata));
169 $this->exercise->setInstruction(trim($this->cdata));
172 $this->exercise->setTimestamp(trim($this->cdata));
180 $this->file_name = trim($this->cdata);
183 $this->file_content = trim($this->cdata);
186 $this->
updateFile($this->file_name, $this->file_content, $this->file_action);
189 $this->comment = trim($this->cdata);
192 $this->notice = trim($this->cdata);
195 $this->mark = trim($this->cdata);
217 $this->cdata .= $a_data;
229 if (!is_int($user_id) || $user_id <= 0) {
232 $memberObject = $this->exercise->members_obj;
234 if ($action ==
"Attach" && !$memberObject->isAssigned($user_id))
236 $memberObject->assignMember ($user_id);
239 if ($action ==
"Detach" && $memberObject->isAssigned($user_id))
241 $memberObject->deassignMember ($user_id);
258 $fileObject = $this->exercise->file_obj;
259 if ($action ==
"Attach")
261 $content = base64_decode((
string) $b64encodedContent);
263 $content = gzdecode($content);
265 $content = gzuncompress($content);
267 $fileObject->storeContentAsFile (
$filename, $content);
269 if ($action ==
"Detach")
284 return $this->result > 0;
293 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
296 if (isset($this->mark))
301 if (isset($this->mark))
308 $marks_obj->update();
311 $memberObject = $this->exercise->members_obj;
312 if (isset($this->status))
313 $memberObject ->setStatusForMember(
$usr_id, $this->status);
315 if (isset($this->notice))
320 $this->status = null;
321 $this->notice = null;
322 $this->comment = null;