78        if (count($assignments) > 0) {
 
   82            $this->assignment->setExerciseId(
$exercise->getId());
 
   83            $this->assignment->save();
 
   86        $this->storage = 
new ilFSStorageExercise($this->exercise->getId(), $this->assignment->getId());
 
   87        $this->storage->create();
 
   88        $this->storage->init();
 
   92        $this->result = 
false;
 
  104        xml_set_object($a_xml_parser, $this);
 
  105        xml_set_element_handler($a_xml_parser, 
'handlerBeginTag', 
'handlerEndTag');
 
  106        xml_set_character_data_handler($a_xml_parser, 
'handlerCharacterData');
 
  122                if (isset($a_attribs[
"obj_id"])) {
 
  124                    if ($this->obj_id != -1 && (
int) $read_obj_id != -1 && (
int) $this->obj_id != (
int) $read_obj_id) {
 
  130                $this->usr_action = $a_attribs[
"action"];
 
  135                $this->file_action = $a_attribs[
"action"];
 
  139                if ($a_attribs[
"mode"] == 
"GZIP") {
 
  140                    if (!function_exists(
"gzdecode")) {
 
  145                } elseif ($a_attribs[
"mode"] == 
"ZLIB") {
 
  146                    if (!function_exists(
"gzuncompress")) {
 
  154                 $this->status = $a_attribs[
"status"];
 
  156                     $this->status = 
"notgraded";
 
  158                     $this->status = 
"passed";
 
  160                     $this->status = 
"failed";
 
  179                $this->result = 
true;
 
  182                $this->exercise->setTitle($this->
trimAndStrip((
string) $this->cdata));
 
  183                $this->assignment->setTitle($this->
trimAndStrip((
string) $this->cdata));
 
  186                $this->exercise->setDescription($this->
trimAndStrip((
string) $this->cdata));
 
  189                $this->assignment->setInstruction($this->
trimAndStrip((
string) $this->cdata));
 
  192                $this->assignment->setDeadLine($this->
trimAndStrip((
string) $this->cdata));
 
  200                $this->file_name = $this->
trimAndStrip((
string) $this->cdata);
 
  203                $this->file_content = $this->
trimAndStrip((
string) $this->cdata);
 
  206                   $this->
updateFile($this->file_name, $this->file_content, $this->file_action);
 
  212                 $this->notice = $this->
trimAndStrip((
string) $this->cdata);
 
  215                 $this->mark = $this->
trimAndStrip((
string) $this->cdata);
 
  235        if ($a_data != 
"\n") {
 
  236            $this->cdata .= $a_data;
 
  249        if (!is_int($user_id) || $user_id <= 0) {
 
  254        if ($action == 
"Attach" && !$memberObject->isAssigned($user_id)) {
 
  255            $memberObject->assignMember($user_id);
 
  258        if ($action == 
"Detach" && $memberObject->isAssigned($user_id)) {
 
  259            $memberObject->deassignMember($user_id);
 
  277        if ($action == 
"Attach") {
 
  278            $content = base64_decode((
string) $b64encodedContent);
 
  280                $content = gzdecode($content);
 
  282                $content = gzuncompress($content);
 
  286            $this->storage->writeToFile($content, 
$filename);
 
  288        if ($action == 
"Detach") {
 
  303        return $this->result > 0;
 
  313        $member_status = $this->assignment->getMemberStatus($usr_id);
 
  314        if (isset($this->mark)) {
 
  320        if (isset($this->status)) {
 
  323        if (isset($this->notice)) {
 
  326        $member_status->update();
 
  330        $this->status = 
null;
 
  331        $this->notice = 
null;
 
  343        foreach ($attribs as $k => $v) {
 
An exception for terminatinating execution or to throw for unit testing.
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
Exercise exceptions class.
static $ID_DEFLATE_METHOD_MISMATCH
Exercise XML Parser which completes/updates a given exercise by an xml string.
static $CONTENT_ZLIB_COMPRESSED
static $CONTENT_GZ_COMPRESSED
trimAndStrip(string $input)
start()
starts parsing an changes object by side effect.
updateMember($user_id, $action)
update member object according to given action
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
__construct($exercise, $a_xml_data, $obj_id=-1)
Constructor.
updateMarking($usr_id)
update marking of member
handlerEndTag($a_xml_parser, $a_name)
handler for end of element
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
trimAndStripAttribs(array $attribs)
updateFile($filename, $b64encodedContent, $action)
update file according to filename
static $CONTENT_NOT_COMPRESSED
setHandlers($a_xml_parser)
set event handlers
static $STATUS_NOT_GRADED
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
setXMLContent($a_xml_content)
startParsing()
stores xml data in array
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc