4 include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
5 include_once
"./Modules/Exercise/classes/class.ilExAssignment.php";
62 parent::ilXmlWriter ();
96 $attribs = array (
"obj_id" =>
"il_" . IL_INST_ID .
"_exc_" . $this->exercise->getId () );
98 if ($this->exercise->getOwner ())
99 $attribs [
"owner"] =
"il_" . IL_INST_ID .
"_usr_" . $this->exercise->getOwner ();
104 $this->
xmlElement(
"Title", null,$this->exercise->getTitle());
105 $this->
xmlElement(
"Description", null,$this->exercise->getDescription());
113 if (count ( $assignments ) > 0) {
114 foreach ( $assignments as $assignment ) {
116 $this->
xmlElement (
"Instruction", null, $assignment [
"instruction"] );
117 $this->
xmlElement (
"DueDate", null, $assignment [
"deadline"] );
120 if ($this->attachMembers)
140 $this->
xmlSetDtdDef (
"<!DOCTYPE Exercise PUBLIC \"-//ILIAS//DTD ExerciseAdministration//EN\" \"" . ILIAS_HTTP_PATH .
"/xml/ilias_exercise_4_4.dtd\">" );
157 $this->attachMembers = $value ? true :
false;
174 if ($astatus ==
"notgraded") {
176 } elseif ($astatus ==
"failed") {
182 $this->
xmlStartTag (
"Marking", array (
"status" => $status ) );
184 $this->
xmlElement (
"Notice", null, $anotice );
185 $this->
xmlElement (
"Comment", null, $acomment );
191 include_once (
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
193 $files = $storage->getFiles ();
195 if (count ( $files )) {
196 foreach ( $files as
$file ) {
197 $this->
xmlStartTag (
"File", array (
"size" => $file [
"size"] ) );
198 $this->
xmlElement (
"Filename", null, $file [
"name"] );
199 if ($this->attachFileContents) {
202 $content = @file_get_contents (
$filename );
203 $attribs = array (
"mode" =>
"PLAIN" );
205 $attribs = array (
"mode" =>
"ZLIB" );
206 $content = gzcompress ( $content, 9 );
208 $attribs = array (
"mode" =>
"GZIP" );
209 $content = gzencode ( $content, 9 );
211 $content = base64_encode ( $content );
212 $this->
xmlElement (
"Content", $attribs, $content );
229 include_once (
"./Modules/Exercise/classes/class.ilExerciseMembers.php");
231 if (count ( $members )) {
232 foreach ( $members as $member_id ) {
233 $this->
xmlStartTag (
"Member", array (
"usr_id" =>
"il_" . IL_INST_ID .
"_usr_" . $member_id ) );
static $CONTENT_ATTACH_ENCODED
lookupCommentForUser($a_ass_id, $a_user_id)
Lookup comment for the user.
xmlSetGenCmt($genCmt)
Sets generated comment.
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
lookupStatusOfUser($a_ass_id, $a_user_id)
was: getStatusByMember
setAttachMembers($value)
write access to property attchMarkings
handleAssignmentMembers($ex_id, $assignment_id)
create xml for files per assignment
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
ilExerciseXMLWriter()
constructor
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
lookupMarkOfUser($a_ass_id, $a_user_id)
Lookup user mark.
static $CONTENT_ATTACH_GZIP_ENCODED
static $STATUS_NOT_GRADED
handleAssignmentFiles($ex_id, $as_id)
xmlEndTag($tag)
Writes an endtag.
static $CONTENT_ATTACH_ZLIB_ENCODED
static $ID_DEFLATE_METHOD_MISMATCH
lookupNoticeOfUser($a_ass_id, $a_user_id)
was: getNoticeByMember($a_member_id)
setExercise(& $exercise)
set exercise object
attachMarking($user_id, $assignment_id)
attach marking tag to member for given assignment
xmlHeader()
Writes xml header public.
setAttachFileContents($attachFileContents)
set attachment content mode
static $CONTENT_ATTACH_NO
xmlDumpMem($format=TRUE)
Returns xml document from memory.
Class to report exception.