ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilExAssTypeWikiTeam Class Reference

Team wiki type. More...

+ Inheritance diagram for ilExAssTypeWikiTeam:
+ Collaboration diagram for ilExAssTypeWikiTeam:

Public Member Functions

 __construct (ilLanguage $a_lng=null)
 Constructor. More...
 
 isActive ()
 Is assignment type active?
Returns
bool
More...
 
 usesTeams ()
 Uses teams.
Returns
bool
More...
 
 usesFileUpload ()
 Uses file upload.
Returns
bool
More...
 
 getTitle ()
 Get title of type.
Returns
string
More...
 
 getSubmissionType ()
 Get submission type.
Returns
string
More...
 
 isSubmissionAssignedToTeam ()
 Get submission type.
Returns
string
More...
 
 submitWiki (int $a_ass_id, int $a_user_id, int $a_wiki_ref_id)
 Submit wiki. More...
 
 cloneSpecificProperties (ilExAssignment $source, ilExAssignment $target)
 Clone type specific properties of an assignment.
Parameters
ilExAssignment$source
ilExAssignment$target
More...
 
 supportsWebDirAccess ()
 Returns if the submission has support to web access directory.
Returns
bool
More...
 
 getStringIdentifier ()
 Returns the short string identifier.
Returns
string
More...
 
 isActive ()
 Is assignment type active? More...
 
 usesTeams ()
 Uses teams. More...
 
 usesFileUpload ()
 Uses file upload. More...
 
 getTitle ()
 Get title of type. More...
 
 getSubmissionType ()
 Get submission type. More...
 
 isSubmissionAssignedToTeam ()
 Get submission type. More...
 
 cloneSpecificProperties (ilExAssignment $source, ilExAssignment $target)
 Clone type specific properties of an assignment. More...
 
 supportsWebDirAccess ()
 Returns if the submission has support to web access directory. More...
 
 getStringIdentifier ()
 Returns the short string identifier. More...
 

Protected Member Functions

 handleNewUpload (ilExAssignment $ass, ilExSubmission $submission, $a_no_notifications=false)
 

Protected Attributes

 $lng
 

Detailed Description

Team wiki type.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 10 of file class.ilExAssTypeWikiTeam.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssTypeWikiTeam::__construct ( ilLanguage  $a_lng = null)

Constructor.

Parameters
ilLanguage | null$a_lng

Definition at line 22 of file class.ilExAssTypeWikiTeam.php.

23 {
24 global $DIC;
25
26 $this->lng = ($a_lng)
27 ? $a_lng
28 : $DIC->language();
29 }
$DIC
Definition: xapitoken.php:46

References $DIC.

Member Function Documentation

◆ cloneSpecificProperties()

ilExAssTypeWikiTeam::cloneSpecificProperties ( ilExAssignment  $source,
ilExAssignment  $target 
)

Clone type specific properties of an assignment.

Parameters
ilExAssignment$source
ilExAssignment$target

Implements ilExAssignmentTypeInterface.

Definition at line 162 of file class.ilExAssTypeWikiTeam.php.

163 {
164 $source_ar = new ilExAssWikiTeamAR($source->getId());
165 $target_ar = new ilExAssWikiTeamAR();
166 $target_ar->setId($target->getId());
167 $target_ar->setTemplateRefId($source_ar->getTemplateRefId());
168 $target_ar->setContainerRefId($source_ar->getContainerRefId());
169 $target_ar->save();
170 }
Item group active record class.
getId()
Get assignment id.
$source
Definition: metadata.php:76

References $source, and ilExAssignment\getId().

+ Here is the call graph for this function:

◆ getStringIdentifier()

ilExAssTypeWikiTeam::getStringIdentifier ( )

Returns the short string identifier.

Returns
string

Implements ilExAssignmentTypeInterface.

Definition at line 183 of file class.ilExAssTypeWikiTeam.php.

183 : string
184 {
185 // TODO: Implement getSubmissionStringIdentifier() method.
186 }

◆ getSubmissionType()

ilExAssTypeWikiTeam::getSubmissionType ( )

Get submission type.

Returns
string

Implements ilExAssignmentTypeInterface.

Definition at line 68 of file class.ilExAssTypeWikiTeam.php.

References ilExSubmission\TYPE_REPO_OBJECT.

◆ getTitle()

ilExAssTypeWikiTeam::getTitle ( )

Get title of type.

Returns
string

Implements ilExAssignmentTypeInterface.

Definition at line 58 of file class.ilExAssTypeWikiTeam.php.

59 {
61 $lng->loadLanguageModule("wiki");
62 return $lng->txt("wiki_type_wiki_team");
63 }

References $lng.

◆ handleNewUpload()

ilExAssTypeWikiTeam::handleNewUpload ( ilExAssignment  $ass,
ilExSubmission  $submission,
  $a_no_notifications = false 
)
protected

Definition at line 123 of file class.ilExAssTypeWikiTeam.php.

127 {
128 $has_submitted = $submission->hasSubmitted();
129
130 // we need one ref id here
131 $exc_ref_ids = ilObject::_getAllReferences($ass->getExerciseId());
132 $exc_ref_id = current($exc_ref_ids);
133
134 $exc = new ilObjExercise($ass->getExerciseId(), false);
135
136 $exc->processExerciseStatus(
137 $ass,
138 $submission->getUserIds(),
139 $has_submitted,
140 $submission->validatePeerReviews()
141 );
142
143 if ($has_submitted &&
144 !$a_no_notifications) {
147 $exc->getId()
148 );
149
150 $not = new ilExerciseMailNotification();
152 $not->setAssignmentId($ass->getId());
153 $not->setRefId($exc_ref_id);
154 $not->setRecipients($users);
155 $not->send();
156 }
157 }
getExerciseId()
Get exercise id.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
Class ilObjExercise.
static _getAllReferences($a_id)
get all reference ids of object

References ilObject\_getAllReferences(), ilExAssignment\getExerciseId(), ilExAssignment\getId(), ilNotification\getNotificationsForObject(), ilExSubmission\getUserIds(), ilExSubmission\hasSubmitted(), ilNotification\TYPE_EXERCISE_SUBMISSION, ilExerciseMailNotification\TYPE_SUBMISSION_UPLOAD, and ilExSubmission\validatePeerReviews().

Referenced by submitWiki().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActive()

ilExAssTypeWikiTeam::isActive ( )

Is assignment type active?

Returns
bool

Implements ilExAssignmentTypeInterface.

Definition at line 34 of file class.ilExAssTypeWikiTeam.php.

35 {
36 return true;
37 }

◆ isSubmissionAssignedToTeam()

ilExAssTypeWikiTeam::isSubmissionAssignedToTeam ( )

Get submission type.

Returns
string

Implements ilExAssignmentTypeInterface.

Definition at line 76 of file class.ilExAssTypeWikiTeam.php.

77 {
78 return true;
79 }

◆ submitWiki()

ilExAssTypeWikiTeam::submitWiki ( int  $a_ass_id,
int  $a_user_id,
int  $a_wiki_ref_id 
)

Submit wiki.

Parameters
int$a_ass_id
int$a_user_id
int$a_wiki_ref_id
Returns
bool|void
Exceptions
ilTemplateException
ilWikiExportException

Definition at line 91 of file class.ilExAssTypeWikiTeam.php.

92 {
93 $ass = new ilExAssignment($a_ass_id);
94 $submission = new ilExSubmission($ass, $a_user_id);
95
96 if (!$submission->canSubmit()) {
97 return;
98 }
99
100 $wiki = new ilObjWiki((int) $a_wiki_ref_id);
101 $exp = new \ILIAS\Wiki\Export\WikiHtmlExport($wiki);
102 //$exp->setMode(ilWikiHTMLExport::MODE_USER);
103 $file = $exp->buildExportFile();
104
105 $size = filesize($file);
106 if ($size) {
107 $submission->deleteAllFiles();
108
109 $meta = array(
110 "name" => $a_wiki_ref_id,
111 "tmp_name" => $file,
112 "size" => $size
113 );
114 $submission->uploadFile($meta, true);
115
116 $this->handleNewUpload($ass, $submission);
117 return true;
118 }
119 return false;
120 }
$size
Definition: RandomTest.php:84
handleNewUpload(ilExAssignment $ass, ilExSubmission $submission, $a_no_notifications=false)
Exercise assignment.
Exercise submission //TODO: This class has to much static methods related to delivered "files".
Class ilObjWiki.

References $size, and handleNewUpload().

+ Here is the call graph for this function:

◆ supportsWebDirAccess()

ilExAssTypeWikiTeam::supportsWebDirAccess ( )

Returns if the submission has support to web access directory.

Returns
bool

Implements ilExAssignmentTypeInterface.

Definition at line 175 of file class.ilExAssTypeWikiTeam.php.

175 : bool
176 {
177 return false;
178 }

◆ usesFileUpload()

ilExAssTypeWikiTeam::usesFileUpload ( )

Uses file upload.

Returns
bool

Implements ilExAssignmentTypeInterface.

Definition at line 50 of file class.ilExAssTypeWikiTeam.php.

51 {
52 return false;
53 }

◆ usesTeams()

ilExAssTypeWikiTeam::usesTeams ( )

Uses teams.

Returns
bool

Implements ilExAssignmentTypeInterface.

Definition at line 42 of file class.ilExAssTypeWikiTeam.php.

43 {
44 return true;
45 }

Field Documentation

◆ $lng

ilExAssTypeWikiTeam::$lng
protected

Definition at line 15 of file class.ilExAssTypeWikiTeam.php.

Referenced by getTitle().


The documentation for this class was generated from the following file: