4 include_once
'Services/Tracking/classes/class.ilChangeEvent.php';
5 include_once
'Modules/Exercise/classes/class.ilExerciseXMLWriter.php';
6 include_once
'./Services/Xml/classes/class.ilSaxParser.php';
79 parent::__construct();
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');
129 if (isset($a_attribs[
"obj_id"]))
132 if ($this->obj_id != -1 && (
int) $read_obj_id != -1 && (
int) $this->obj_id != (
int) $read_obj_id)
139 $this->usr_action = $a_attribs[
"action"];
144 $this->file_action = $a_attribs[
"action"];
148 if ($a_attribs[
"mode"] ==
"GZIP")
150 if (!function_exists(
"gzdecode"))
154 } elseif ($a_attribs[
"mode"] ==
"ZLIB")
156 if (!function_exists(
"gzuncompress"))
163 $this->status = $a_attribs[
"status"];
165 $this->status =
"notgraded";
167 $this->status =
"passed";
169 $this->status =
"failed";
188 $this->result =
true;
191 $this->exercise->setTitle(trim($this->cdata));
192 $this->assignment->setTitle(trim($this->cdata));
195 $this->exercise->setDescription(trim($this->cdata));
198 $this->assignment->setInstruction(trim($this->cdata));
201 $this->assignment->setDeadLine(trim($this->cdata));
209 $this->file_name = trim($this->cdata);
212 $this->file_content = trim($this->cdata);
215 $this->
updateFile($this->file_name, $this->file_content, $this->file_action);
218 $this->
comment = trim($this->cdata);
221 $this->notice = trim($this->cdata);
224 $this->mark = trim($this->cdata);
246 $this->cdata .= $a_data;
258 if (!is_int($user_id) || $user_id <= 0) {
263 if ($action ==
"Attach" && !$memberObject->isAssigned($user_id))
265 $memberObject->assignMember ($user_id);
268 if ($action ==
"Detach" && $memberObject->isAssigned($user_id))
270 $memberObject->deassignMember ($user_id);
288 if ($action ==
"Attach")
290 $content = base64_decode((
string) $b64encodedContent);
292 $content = gzdecode($content);
294 $content = gzuncompress($content);
298 $this->storage->writeToFile($content,
$filename);
301 if ($action ==
"Detach")
316 return $this->result > 0;
326 $member_status = $this->assignment->getMemberStatus($usr_id);
327 if (isset($this->mark))
335 if (isset($this->status))
339 if (isset($this->notice))
343 $member_status->update();
347 $this->status = null;
348 $this->notice = null;
updateMarking($usr_id)
update marking of member
static $ID_DEFLATE_METHOD_MISMATCH
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
startParsing()
stores xml data in array
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
static $CONTENT_NOT_COMPRESSED
static $CONTENT_ZLIB_COMPRESSED
static $STATUS_NOT_GRADED
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
updateFile($filename, $b64encodedContent, $action)
update file according to filename
__construct($exercise, $a_xml_data, $obj_id=-1)
Constructor.
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
handlerEndTag($a_xml_parser, $a_name)
handler for end of element
static $CONTENT_GZ_COMPRESSED
setHandlers($a_xml_parser)
set event handlers
create()
Create directory.
updateMember($user_id, $action)
update member object according to given action
Exercise XML Parser which completes/updates a given exercise by an xml string.
setXMLContent($a_xml_content)
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
start()
starts parsing an changes object by side effect.
Class to report exception.