58 if (count($assignments) > 0) {
63 $this->assignment->save();
66 $this->storage =
new ilFSStorageExercise($this->exercise->getId(), $this->assignment->getId());
67 $this->storage->create();
68 $this->storage->init();
72 $this->result =
false;
78 xml_set_object($a_xml_parser, $this);
79 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
80 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
91 public function handlerBeginTag($a_xml_parser,
string $a_name, array $a_attribs): void
96 if (isset($a_attribs[
"obj_id"])) {
98 if ($this->obj_id != -1 && (
int) $read_obj_id != -1 && $this->obj_id !== (
int) $read_obj_id) {
104 $this->usr_action = $a_attribs[
"action"];
109 $this->file_action = $a_attribs[
"action"];
113 if ($a_attribs[
"mode"] ==
"GZIP") {
114 if (!function_exists(
"gzdecode")) {
119 } elseif ($a_attribs[
"mode"] ==
"ZLIB") {
120 if (!function_exists(
"gzuncompress")) {
128 $this->status = $a_attribs[
"status"];
130 $this->status =
"notgraded";
132 $this->status =
"passed";
134 $this->status =
"failed";
153 $this->result =
true;
156 $this->exercise->setTitle($this->
trimAndStrip((
string) $this->cdata));
157 $this->assignment->setTitle($this->
trimAndStrip((
string) $this->cdata));
160 $this->exercise->setDescription($this->
trimAndStrip((
string) $this->cdata));
163 $this->assignment->setInstruction($this->
trimAndStrip((
string) $this->cdata));
166 $this->assignment->setDeadLine($this->
trimAndStrip((
string) $this->cdata));
174 $this->file_name = $this->
trimAndStrip((
string) $this->cdata);
177 $this->file_content = $this->
trimAndStrip((
string) $this->cdata);
180 $this->
updateFile($this->file_name, $this->file_content, $this->file_action);
186 $this->notice = $this->
trimAndStrip((
string) $this->cdata);
189 $this->mark = $this->
trimAndStrip((
string) $this->cdata);
206 if ($a_data !=
"\n") {
207 $this->cdata .= $a_data;
217 if (!is_int($user_id) || $user_id <= 0) {
222 if ($action ==
"Attach" && !$memberObject->isAssigned($user_id)) {
223 $memberObject->assignMember($user_id);
226 if ($action ==
"Detach" && $memberObject->isAssigned($user_id)) {
227 $memberObject->deassignMember($user_id);
240 string $b64encodedContent,
248 if ($action ==
"Attach") {
249 $content = base64_decode($b64encodedContent);
251 $content = gzdecode($content);
253 $content = gzuncompress($content);
259 if ($action ==
"Detach") {
273 $this->startParsing();
274 return $this->result > 0;
284 $member_status = $this->assignment->getMemberStatus($usr_id);
285 if (isset($this->mark)) {
291 if (isset($this->status)) {
294 if (isset($this->notice)) {
297 $member_status->update();
301 $this->status =
null;
302 $this->notice =
null;
308 return $this->assignment;
314 foreach ($attribs as $k => $v) {
315 $ret[$k] = $this->trimAndStrip((
string) $v);
static getAssignmentDataOfExercise(int $a_exc_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static int $ID_DEFLATE_METHOD_MISMATCH
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilExAssignment $assignment
updateFile(string $filename, string $b64encodedContent, string $action)
update file according to filename
static int $CONTENT_GZ_COMPRESSED
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
handler for begin of element
trimAndStrip(string $input)
handlerEndTag($a_xml_parser, string $a_name)
handler for end of element
__construct(ilObjExercise $exercise, string $a_xml_data, int $obj_id=-1)
start()
starts parsing an changes object by side effect.
static int $CONTENT_ZLIB_COMPRESSED
handlerCharacterData($a_xml_parser, string $a_data)
handler for character data
trimAndStripAttribs(array $attribs)
updateMarking(int $usr_id)
update marking of member
static int $CONTENT_NOT_COMPRESSED
updateMember(int $user_id, string $action)
update member object according to given action
ilFSStorageExercise $storage
setHandlers($a_xml_parser)
static string $STATUS_PASSED
static string $STATUS_NOT_GRADED
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setXMLContent(string $a_xml_content)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc