ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 usesTeams ()
 
 usesFileUpload ()
 
 getTitle ()
 
 getSubmissionType ()
 
 isSubmissionAssignedToTeam ()
 
 submitWiki (int $a_ass_id, int $a_user_id, int $a_wiki_ref_id)
 Submit wiki. More...
 
 cloneSpecificProperties (ilExAssignment $source, ilExAssignment $target)
 
 supportsWebDirAccess ()
 
 getStringIdentifier ()
 
 getExportObjIdForResourceId (int $resource_id)
 

Protected Member Functions

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

Protected Attributes

const STR_IDENTIFIER = "wiki"
 
ilLanguage $lng
 

Detailed Description

Team wiki type.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssTypeWikiTeam::__construct ( ilLanguage  $a_lng = null)

Constructor.

Parameters
ilLanguage | null$a_lng

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

References $DIC, and ILIAS\Repository\lng().

38  {
39  global $DIC;
40 
41  $this->lng = ($a_lng)
42  ?: $DIC->language();
43  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ cloneSpecificProperties()

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

Implements ilExAssignmentTypeInterface.

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

References ilExAssignment\getId(), ActiveRecord\save(), ilExAssWikiTeamAR\setContainerRefId(), ilExAssWikiTeamAR\setId(), and ilExAssWikiTeamAR\setTemplateRefId().

164  : void {
165  $source_ar = new ilExAssWikiTeamAR($source->getId());
166  $target_ar = new ilExAssWikiTeamAR();
167  $target_ar->setId($target->getId());
168  $target_ar->setTemplateRefId($source_ar->getTemplateRefId());
169  $target_ar->setContainerRefId($source_ar->getContainerRefId());
170  $target_ar->save();
171  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTemplateRefId(int $a_template_ref_id)
Set template ref id.
setContainerRefId(int $a_container_ref_id)
Set container ref id.
+ Here is the call graph for this function:

◆ getExportObjIdForResourceId()

ilExAssTypeWikiTeam::getExportObjIdForResourceId ( int  $resource_id)

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

References ilObject\_lookupObjectId().

184  : int
185  {
186  return ilObject::_lookupObjectId($resource_id);
187  }
static _lookupObjectId(int $ref_id)
+ Here is the call graph for this function:

◆ getStringIdentifier()

ilExAssTypeWikiTeam::getStringIdentifier ( )

Implements ilExAssignmentTypeInterface.

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

178  : string
179  {
180  return self::STR_IDENTIFIER;
181  }

◆ getSubmissionType()

ilExAssTypeWikiTeam::getSubmissionType ( )

Implements ilExAssignmentTypeInterface.

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

References ilExSubmission\TYPE_REPO_OBJECT.

67  : string
68  {
70  }

◆ getTitle()

ilExAssTypeWikiTeam::getTitle ( )

Implements ilExAssignmentTypeInterface.

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

References $lng, ilLanguage\loadLanguageModule(), and ilLanguage\txt().

60  : string
61  {
62  $lng = $this->lng;
63  $lng->loadLanguageModule("wiki");
64  return $lng->txt("wiki_type_wiki_team");
65  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:

◆ handleNewUpload()

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

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

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

Referenced by submitWiki().

129  : void {
130  $has_submitted = $submission->hasSubmitted();
131 
132  // we need one ref id here
133  $exc_ref_ids = ilObject::_getAllReferences($ass->getExerciseId());
134  $exc_ref_id = current($exc_ref_ids);
135 
136  $exc = new ilObjExercise($ass->getExerciseId(), false);
137 
138  $exc->processExerciseStatus(
139  $ass,
140  $submission->getUserIds(),
141  $has_submitted,
142  $submission->validatePeerReviews()
143  );
144 
145  if ($has_submitted &&
146  !$a_no_notifications) {
149  $exc->getId()
150  );
151 
152  $not = new ilExerciseMailNotification();
154  $not->setAssignmentId($ass->getId());
155  $not->setRefId($exc_ref_id);
156  $not->setRecipients($users);
157  $not->send();
158  }
159  }
static _getAllReferences(int $id)
get all reference ids for object ID
static getNotificationsForObject(int $type, int $id, ?int $page_id=null, bool $ignore_threshold=false)
Get all users/recipients for given object.
Class ilObjExercise.
processExerciseStatus(ilExAssignment $a_ass, array $a_user_ids, bool $a_has_submitted, array $a_valid_submissions=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActive()

ilExAssTypeWikiTeam::isActive ( )

Implements ilExAssignmentTypeInterface.

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

45  : bool
46  {
47  return true;
48  }

◆ isSubmissionAssignedToTeam()

ilExAssTypeWikiTeam::isSubmissionAssignedToTeam ( )

Implements ilExAssignmentTypeInterface.

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

72  : bool
73  {
74  return true;
75  }

◆ submitWiki()

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

Submit wiki.

Exceptions
ilTemplateException
ilWikiExportException

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

References handleNewUpload().

83  : void
84  {
85  $ass = new ilExAssignment($a_ass_id);
86  $submission = new ilExSubmission($ass, $a_user_id);
87 
88  if (!$submission->canSubmit()) {
89  return;
90  }
91 
92  $wiki = new ilObjWiki($a_wiki_ref_id);
93  $exp = new WikiHtmlExport($wiki);
94  //$exp->setMode(ilWikiHTMLExport::MODE_USER);
95  $file = $exp->buildExportFile();
96 
97  $size = filesize($file);
98  if ($size) {
99  $submission->deleteAllFiles();
100 
101  $meta = array(
102  "name" => $a_wiki_ref_id . ".zip",
103  "tmp_name" => $file,
104  "size" => $size
105  );
106  $submission->uploadFile($meta, true);
107 
108  // print version
109  $file = $file = $exp->buildExportFile(true);
110  $size = filesize($file);
111  if ($size) {
112  $meta = array(
113  "name" => $a_wiki_ref_id . "print.zip",
114  "tmp_name" => $file,
115  "size" => $size
116  );
117  $submission->uploadFile($meta, true);
118  }
119 
120  $this->handleNewUpload($ass, $submission);
121  }
122  }
Exercise assignment.
Wiki HTML exporter class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handleNewUpload(ilExAssignment $ass, ilExSubmission $submission, $a_no_notifications=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ supportsWebDirAccess()

ilExAssTypeWikiTeam::supportsWebDirAccess ( )

Implements ilExAssignmentTypeInterface.

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

173  : bool
174  {
175  return true;
176  }

◆ usesFileUpload()

ilExAssTypeWikiTeam::usesFileUpload ( )

Implements ilExAssignmentTypeInterface.

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

55  : bool
56  {
57  return false;
58  }

◆ usesTeams()

ilExAssTypeWikiTeam::usesTeams ( )

Implements ilExAssignmentTypeInterface.

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

50  : bool
51  {
52  return true;
53  }

Field Documentation

◆ $lng

ilLanguage ilExAssTypeWikiTeam::$lng
protected

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

Referenced by getTitle().

◆ STR_IDENTIFIER

const ilExAssTypeWikiTeam::STR_IDENTIFIER = "wiki"
protected

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


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