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';
78 parent::__construct();
83 if (count($assignments) > 0) {
87 $this->assignment->setExerciseId(
$exercise->getId());
88 $this->assignment->save();
91 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
92 $this->storage =
new ilFSStorageExercise($this->exercise->getId(), $this->assignment->getId());
94 $this->storage->init();
98 $this->result =
false;
110 xml_set_object($a_xml_parser, $this);
111 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
112 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
127 if (isset($a_attribs[
"obj_id"])) {
129 if ($this->obj_id != -1 && (
int) $read_obj_id != -1 && (
int) $this->obj_id != (
int) $read_obj_id) {
135 $this->usr_action = $a_attribs[
"action"];
140 $this->file_action = $a_attribs[
"action"];
144 if ($a_attribs[
"mode"] ==
"GZIP") {
145 if (!function_exists(
"gzdecode")) {
150 } elseif ($a_attribs[
"mode"] ==
"ZLIB") {
151 if (!function_exists(
"gzuncompress")) {
159 $this->status = $a_attribs[
"status"];
161 $this->status =
"notgraded";
163 $this->status =
"passed";
165 $this->status =
"failed";
184 $this->result =
true;
187 $this->exercise->setTitle(trim($this->cdata));
188 $this->assignment->setTitle(trim($this->cdata));
191 $this->exercise->setDescription(trim($this->cdata));
194 $this->assignment->setInstruction(trim($this->cdata));
197 $this->assignment->setDeadLine(trim($this->cdata));
205 $this->file_name = trim($this->cdata);
208 $this->file_content = trim($this->cdata);
211 $this->
updateFile($this->file_name, $this->file_content, $this->file_action);
214 $this->
comment = trim($this->cdata);
217 $this->notice = trim($this->cdata);
220 $this->mark = trim($this->cdata);
240 if ($a_data !=
"\n") {
241 $this->cdata .= $a_data;
254 if (!is_int($user_id) || $user_id <= 0) {
259 if (
$action ==
"Attach" && !$memberObject->isAssigned($user_id)) {
260 $memberObject->assignMember($user_id);
263 if (
$action ==
"Detach" && $memberObject->isAssigned($user_id)) {
264 $memberObject->deassignMember($user_id);
283 $content = base64_decode((
string) $b64encodedContent);
285 $content = gzdecode($content);
287 $content = gzuncompress($content);
291 $this->storage->writeToFile($content,
$filename);
308 return $this->result > 0;
318 $member_status = $this->assignment->getMemberStatus($usr_id);
319 if (isset($this->mark)) {
325 if (isset($this->status)) {
328 if (isset($this->notice)) {
331 $member_status->update();
335 $this->status = null;
336 $this->notice = null;
updateMarking($usr_id)
update marking of member
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 $ID_DEFLATE_METHOD_MISMATCH
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.
Exercise exceptions class.