36 include_once
'classes/class.ilSaxParser.php';
37 include_once
'Modules/Exercise/classes/class.ilExerciseException.php';
38 include_once
'Modules/Exercise/classes/class.ilExerciseXMLWriter.php';
92 $this->result =
false;
104 xml_set_object($a_xml_parser,$this);
105 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
106 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
124 if (isset($a_attribs[
"obj_id"]))
127 if ($this->obj_id != -1 && (
int) $read_obj_id != -1 && (
int) $this->obj_id != (
int) $read_obj_id)
134 $this->usr_action = $a_attribs[
"action"];
139 $this->file_action = $a_attribs[
"action"];
143 if ($a_attribs[
"mode"] ==
"GZIP")
145 if (!function_exists(
"gzdecode"))
149 } elseif ($a_attribs[
"mode"] ==
"ZLIB")
151 if (!function_exists(
"gzuncompress"))
158 $this->status = $a_attribs[
"status"];
160 $this->status =
"notgraded";
162 $this->status =
"passed";
164 $this->status =
"failed";
183 $this->result =
true;
186 $this->exercise->setTitle(trim($this->cdata));
189 $this->exercise->setDescription(trim($this->cdata));
192 $this->exercise->setInstruction(trim($this->cdata));
195 $this->exercise->setTimestamp(trim($this->cdata));
203 $this->file_name = trim($this->cdata);
206 $this->file_content = trim($this->cdata);
209 $this->
updateFile($this->file_name, $this->file_content, $this->file_action);
212 $this->comment = trim($this->cdata);
215 $this->notice = trim($this->cdata);
218 $this->mark = trim($this->cdata);
240 $this->cdata .= $a_data;
252 if (!is_int($user_id) || $user_id <= 0) {
255 $memberObject = $this->exercise->members_obj;
257 if ($action ==
"Attach" && !$memberObject->isAssigned($user_id))
259 $memberObject->assignMember ($user_id);
262 if ($action ==
"Detach" && $memberObject->isAssigned($user_id))
264 $memberObject->deassignMember ($user_id);
281 $fileObject = $this->exercise->file_obj;
282 if ($action ==
"Attach")
284 $content = base64_decode((
string) $b64encodedContent);
286 $content = gzdecode($content);
288 $content = gzuncompress($content);
290 $fileObject->storeContentAsFile (
$filename, $content);
292 if ($action ==
"Detach")
307 return $this->result > 0;
316 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
317 $marks_obj =
new ilLPMarks($this->exercise->getId(), $usr_id);
319 if (isset($this->mark))
324 if (isset($this->mark))
331 $marks_obj->update();
334 $memberObject = $this->exercise->members_obj;
335 if (isset($this->status))
336 $memberObject ->setStatusForMember($usr_id, $this->status);
338 if (isset($this->notice))
343 $this->status = null;
344 $this->notice = null;
345 $this->comment = null;