Ejemplo n.º 1
0
 function start()
 {
     $this->__buildHeader();
     $attribs = array("obj_id" => "il_" . IL_INST_ID . "_exc_" . $this->exercise->getId());
     if ($this->exercise->getOwner()) {
         $attribs["owner"] = "il_" . IL_INST_ID . "_usr_" . $this->exercise->getOwner();
     }
     $this->xmlStartTag("Exercise", $attribs);
     //todo: create new dtd for new assignment structure
     $this->xmlElement("Title", null, $this->exercise->getTitle());
     $this->xmlElement("Description", null, $this->exercise->getDescription());
     //$this->xmlElement("Instruction",  null,$this->exercise->getInstruction());
     //$this->xmlElement("DueDate",  null,$this->exercise->getTimestamp());
     //todo: as a workaround use first assignment for compatibility with old exercise dtd
     $assignments = ilExAssignment::getAssignmentDataOfExercise($this->exercise->getId());
     if (count($assignments) > 0) {
         foreach ($assignments as $assignment) {
             $this->xmlStartTag("Assignment");
             $this->xmlElement("Instruction", null, $assignment["instruction"]);
             $this->xmlElement("DueDate", null, $assignment["deadline"]);
             $this->handleAssignmentFiles($this->exercise->getId(), $assignment["id"]);
             if ($this->attachMembers) {
                 $this->handleAssignmentMembers($this->exercise->getId(), $assignment["id"]);
             }
             $this->xmlEndTag("Assignment");
         }
     }
     $this->xmlEndTag("Exercise");
     $this->__buildFooter();
     return true;
 }