57 if (count($assignments) > 0) {
61 $this->assignment->setExerciseId($exercise->
getId());
62 $this->assignment->save();
67 $this->result =
false;
73 xml_set_object($a_xml_parser, $this);
74 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
75 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
86 public function handlerBeginTag($a_xml_parser,
string $a_name, array $a_attribs): void
91 if (isset($a_attribs[
"obj_id"])) {
93 if ($this->obj_id != -1 && (
int) $read_obj_id != -1 && $this->obj_id !== (
int) $read_obj_id) {
99 $this->usr_action = $a_attribs[
"action"];
104 $this->file_action = $a_attribs[
"action"];
108 if ($a_attribs[
"mode"] ==
"GZIP") {
109 if (!function_exists(
"gzdecode")) {
114 } elseif ($a_attribs[
"mode"] ==
"ZLIB") {
115 if (!function_exists(
"gzuncompress")) {
123 $this->status = $a_attribs[
"status"];
125 $this->status =
"notgraded";
127 $this->status =
"passed";
129 $this->status =
"failed";
147 $this->result =
true;
150 $this->exercise->setTitle($this->
trimAndStrip((
string) $this->cdata));
151 $this->assignment->setTitle($this->
trimAndStrip((
string) $this->cdata));
154 $this->exercise->setDescription($this->
trimAndStrip((
string) $this->cdata));
157 $this->assignment->setInstruction($this->
trimAndStrip((
string) $this->cdata));
160 $this->assignment->setDeadLine($this->
trimAndStrip((
string) $this->cdata));
168 $this->file_name = $this->
trimAndStrip((
string) $this->cdata);
171 $this->file_content = $this->
trimAndStrip((
string) $this->cdata);
177 $this->notice = $this->
trimAndStrip((
string) $this->cdata);
180 $this->mark = $this->
trimAndStrip((
string) $this->cdata);
197 if ($a_data !=
"\n") {
198 $this->cdata .= $a_data;
208 if (!is_int($user_id) || $user_id <= 0) {
213 if ($action ==
"Attach" && !$memberObject->isAssigned($user_id)) {
214 $memberObject->assignMember($user_id);
217 if ($action ==
"Detach" && $memberObject->isAssigned($user_id)) {
218 $memberObject->deassignMember($user_id);
232 return $this->result > 0;
242 $member_status = $this->assignment->getMemberStatus($usr_id);
243 if (isset($this->mark)) {
249 if (isset($this->status)) {
252 if (isset($this->notice)) {
255 $member_status->update();
259 $this->status = null;
260 $this->notice = null;
272 foreach ($attribs as $k => $v) {
__construct(ilObjExercise $exercise, string $a_xml_data, int $obj_id=-1)
static string $STATUS_NOT_GRADED
startParsing()
stores xml data in array
handlerEndTag($a_xml_parser, string $a_name)
handler for end of element
static int $CONTENT_GZ_COMPRESSED
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static int $ID_DEFLATE_METHOD_MISMATCH
trimAndStrip(string $input)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
handler for begin of element
static getAssignmentDataOfExercise(int $a_exc_id)
handlerCharacterData($a_xml_parser, string $a_data)
handler for character data
updateMember(int $user_id, string $action)
update member object according to given action
static string $STATUS_PASSED
setHandlers($a_xml_parser)
static int $CONTENT_NOT_COMPRESSED
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
trimAndStripAttribs(array $attribs)
__construct(Container $dic, ilPlugin $plugin)
ilExAssignment $assignment
static int $CONTENT_ZLIB_COMPRESSED
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateMarking(int $usr_id)
update marking of member
start()
starts parsing an changes object by side effect.
setXMLContent(string $a_xml_content)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...