4 include_once
'classes/class.ilSaxParser.php';
5 include_once
'Services/Tracking/classes/class.ilChangeEvent.php';
6 include_once
'Modules/Exercise/classes/class.ilExerciseException.php';
7 include_once
'Modules/Exercise/classes/class.ilExerciseXMLWriter.php';
84 if (count ($assignments) > 0) {
88 $this->assignment->setExerciseId(
$exercise->getId());
89 $this->assignment->save();
92 include_once (
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
93 $this->storage =
new ilFSStorageExercise ( $this->exercise->getId(), $this->assignment->getId());
95 $this->storage->init();
99 $this->result =
false;
111 xml_set_object($a_xml_parser,$this);
112 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
113 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
131 if (isset($a_attribs[
"obj_id"]))
134 if ($this->obj_id != -1 && (
int) $read_obj_id != -1 && (
int) $this->obj_id != (
int) $read_obj_id)
141 $this->usr_action = $a_attribs[
"action"];
146 $this->file_action = $a_attribs[
"action"];
150 if ($a_attribs[
"mode"] ==
"GZIP")
152 if (!function_exists(
"gzdecode"))
156 } elseif ($a_attribs[
"mode"] ==
"ZLIB")
158 if (!function_exists(
"gzuncompress"))
165 $this->status = $a_attribs[
"status"];
167 $this->status =
"notgraded";
169 $this->status =
"passed";
171 $this->status =
"failed";
190 $this->result =
true;
193 $this->exercise->setTitle(trim($this->cdata));
194 $this->assignment->setTitle(trim($this->cdata));
197 $this->exercise->setDescription(trim($this->cdata));
200 $this->assignment->setInstruction(trim($this->cdata));
203 $this->assignment->setDeadLine(trim($this->cdata));
211 $this->file_name = trim($this->cdata);
214 $this->file_content = trim($this->cdata);
217 $this->
updateFile($this->file_name, $this->file_content, $this->file_action);
220 $this->comment = trim($this->cdata);
223 $this->notice = trim($this->cdata);
226 $this->mark = trim($this->cdata);
248 $this->cdata .= $a_data;
260 if (!is_int($user_id) || $user_id <= 0) {
265 if ($action ==
"Attach" && !$memberObject->isAssigned($user_id))
267 $memberObject->assignMember ($user_id);
270 if ($action ==
"Detach" && $memberObject->isAssigned($user_id))
272 $memberObject->deassignMember ($user_id);
290 if ($action ==
"Attach")
292 $content = base64_decode((
string) $b64encodedContent);
294 $content = gzdecode($content);
296 $content = gzuncompress($content);
300 $this->storage->writeToFile($content,
$filename);
303 if ($action ==
"Detach")
318 return $this->result > 0;
327 if (isset($this->mark))
331 if (isset($this->comment))
338 if (isset ( $this->status )){
342 if (isset($this->notice)){
347 $this->status = null;
348 $this->notice = null;
349 $this->comment = null;