ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjPoll Class Reference

Class ilObjPoll. More...

+ Inheritance diagram for ilObjPoll:
+ Collaboration diagram for ilObjPoll:

Public Member Functions

 __construct (int $a_id=0, bool $a_reference=true)
 
 setAccessType (int $a_value)
 
 getAccessType ()
 
 setAccessBegin (int $a_value)
 
 getAccessBegin ()
 
 setAccessEnd (int $a_value)
 
 getAccessEnd ()
 
 setAccessVisibility (bool $a_value)
 
 getAccessVisibility ()
 
 setQuestion (string $a_value)
 
 getQuestion ()
 
 setImage (string $a_value)
 
 getImage ()
 
 setViewResults (int $a_value)
 
 getViewResults ()
 
 setVotingPeriod (bool $a_value)
 
 getVotingPeriod ()
 
 setVotingPeriodBegin (int $a_value)
 
 getVotingPeriodBegin ()
 
 setVotingPeriodEnd (int $a_value)
 
 getVotingPeriodEnd ()
 
 setMaxNumberOfAnswers (int $a_value)
 
 getMaxNumberOfAnswers ()
 
 setSortResultByVotes (bool $a_value)
 
 getSortResultByVotes ()
 
 setNonAnonymous (bool $a_value)
 
 getNonAnonymous ()
 
 setShowComments (bool $a_value)
 
 getShowComments ()
 
 setShowResultsAs (int $a_value)
 
 getShowResultsAs ()
 
 getImageFullPath (bool $a_as_thumb=false)
 
 deleteImage ()
 
 uploadImage (array $a_upload, bool $a_clone=false)
 
 getAnswers ()
 
 getAnswer (int $a_id)
 
 saveAnswer (string $a_text, ?int $a_pos=null)
 
 updateAnswer (int $a_id, string $a_text)
 
 rebuildAnswerPositions ()
 
 updateAnswerPositions (array $a_pos)
 
 deleteAnswer (int $a_id)
 
 deleteAllVotes ()
 
 saveAnswers (array $a_answers)
 
 saveVote (int $a_user_id, array $a_answers)
 
 hasUserVoted (int $a_user_id)
 
 countVotes ()
 
 getVotePercentages ()
 
 getVotesByUsers ()
 
- Public Member Functions inherited from ilObject2
 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 read ()
 
 create (bool $a_clone_mode=false)
 
 update ()
 
 delete ()
 
 cloneMetaData (ilObject $target_obj)
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static initStorage (int $a_id, ?string $a_subdir=null)
 
static getImageSize ()
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

Data Fields

const VIEW_RESULTS_ALWAYS = 1
 
const VIEW_RESULTS_NEVER = 2
 
const VIEW_RESULTS_AFTER_VOTE = 3
 
const VIEW_RESULTS_AFTER_PERIOD = 4
 
const SHOW_RESULTS_AS_BARCHART = 1
 
const SHOW_RESULTS_AS_PIECHART = 2
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Protected Member Functions

 initType ()
 
 doRead ()
 
 propertiesToDB ()
 
 doCreate (bool $clone_mode=false)
 
 doUpdate ()
 
 doDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=0)
 
 deleteAllAnswers ()
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 beforeCreate ()
 If overwritten this method should return true, there is currently no "abort" handling for cases where "false" is returned. More...
 
 doUpdate ()
 
 beforeUpdate ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 beforeCloneObject ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

ILIAS Notes Service $notes
 
int $access_type = 0
 
int $access_begin = 0
 
int $access_end = 0
 
bool $access_visibility = false
 
string $question = ""
 
string $image = ""
 
int $view_results = 0
 
bool $period = false
 
int $period_begin = 0
 
int $period_end = 0
 
int $max_number_answers = 0
 
bool $result_sort_by_votes = false
 
bool $mode_non_anonymous = false
 
bool $show_comments = false
 
int $show_results_as = 1
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Private Attributes

ILIAS Filesystem Util Convert LegacyImages $image_converter
 

Detailed Description

Class ilObjPoll.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Constructor & Destructor Documentation

◆ __construct()

ilObjPoll::__construct ( int  $a_id = 0,
bool  $a_reference = true 
)

Definition at line 57 of file class.ilObjPoll.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), setAccessType(), setViewResults(), setVotingPeriod(), and ilObjectActivation\TIMINGS_DEACTIVATED.

58  {
59  global $DIC;
60 
61  $this->db = $DIC->database();
62  $this->image_converter = $DIC->fileConverters()->legacyImages();
63  // default
64  $this->setViewResults(self::VIEW_RESULTS_AFTER_VOTE);
66  $this->setVotingPeriod(false);
67  $this->notes = $DIC->notes();
68 
69  parent::__construct($a_id, $a_reference);
70  }
setAccessType(int $a_value)
global $DIC
Definition: feed.php:28
setVotingPeriod(bool $a_value)
__construct(VocabulariesInterface $vocabularies)
setViewResults(int $a_value)
+ Here is the call graph for this function:

Member Function Documentation

◆ countVotes()

ilObjPoll::countVotes ( )

Definition at line 710 of file class.ilObjPoll.php.

References ilObject\getId().

Referenced by getVotePercentages().

710  : int
711  {
712  $sql = "SELECT COUNT(DISTINCT(user_id)) cnt" .
713  " FROM il_poll_vote" .
714  " WHERE poll_id = " . $this->db->quote($this->getId(), "integer");
715  $set = $this->db->query($sql);
716  $row = $this->db->fetchAssoc($set);
717  return (int) $row["cnt"];
718  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAllAnswers()

ilObjPoll::deleteAllAnswers ( )
protected

Definition at line 609 of file class.ilObjPoll.php.

References ilObject\$db, $ilDB, deleteAllVotes(), and ilObject\getId().

Referenced by doDelete().

609  : void
610  {
611  $ilDB = $this->db;
612 
613  if ($this->getId()) {
614  $this->deleteAllVotes();
615 
616  $ilDB->manipulate("DELETE FROM il_poll_answer" .
617  " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer"));
618  }
619  }
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAllVotes()

ilObjPoll::deleteAllVotes ( )

Definition at line 621 of file class.ilObjPoll.php.

References ilObject\$db, $ilDB, and ilObject\getId().

Referenced by deleteAllAnswers().

621  : void
622  {
623  $ilDB = $this->db;
624 
625  if ($this->getId()) {
626  $ilDB->manipulate("DELETE FROM il_poll_vote" .
627  " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer"));
628  }
629  }
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAnswer()

ilObjPoll::deleteAnswer ( int  $a_id)

Definition at line 596 of file class.ilObjPoll.php.

References ilObject\$db, and $ilDB.

Referenced by saveAnswers().

596  : void
597  {
598  $ilDB = $this->db;
599 
600  if ($a_id) {
601  $ilDB->manipulate("DELETE FROM il_poll_vote" .
602  " WHERE answer_id = " . $ilDB->quote($this->getId(), "integer"));
603 
604  $ilDB->manipulate("DELETE FROM il_poll_answer" .
605  " WHERE id = " . $ilDB->quote($a_id, "integer"));
606  }
607  }
ilDBInterface $db
+ Here is the caller graph for this function:

◆ deleteImage()

ilObjPoll::deleteImage ( )

Definition at line 406 of file class.ilObjPoll.php.

References setImage().

Referenced by doDelete(), and uploadImage().

406  : void
407  {
408  if ($this->id) {
409  $storage = new ilFSStoragePoll($this->id);
410  $storage->delete();
411 
412  $this->setImage("");
413  }
414  }
setImage(string $a_value)
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:

◆ doCloneObject()

ilObjPoll::doCloneObject ( ilObject2  $new_obj,
int  $a_target_id,
?int  $a_copy_id = 0 
)
protected

Definition at line 343 of file class.ilObjPoll.php.

References ilCopyWizardOptions\_getInstance(), getAnswers(), getImage(), getImageFullPath(), getMaxNumberOfAnswers(), getNonAnonymous(), getQuestion(), getShowComments(), getShowResultsAs(), getSortResultByVotes(), getViewResults(), ilObject\setOfflineStatus(), ilObject2\update(), VIEW_RESULTS_AFTER_PERIOD, and VIEW_RESULTS_ALWAYS.

343  : void
344  {
345  assert($new_obj instanceof ilObjPoll);
346 
347  // question/image
348  $new_obj->setQuestion($this->getQuestion());
349  $image = $this->getImageFullPath();
350  if ($image) {
351  $image = array("tmp_name" => $image,
352  "name" => $this->getImage());
353  $new_obj->uploadImage($image, true);
354  }
355 
356  //copy online status if object is not the root copy object
357  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
358 
359  if ($cp_options->isRootNode($this->getRefId())) {
360  $new_obj->setOfflineStatus(true);
361  }
362 
363  $view_results = $this->getViewResults();
365  // default view results setting to always, since
366  // voting period is not copied.
368  }
369  $new_obj->setViewResults($view_results);
370  $new_obj->setShowComments($this->getShowComments());
371  $new_obj->setShowResultsAs($this->getShowResultsAs());
372  $new_obj->setMaxNumberOfAnswers($this->getMaxNumberOfAnswers());
373  $new_obj->setSortResultByVotes($this->getSortResultByVotes());
374  $new_obj->setNonAnonymous($this->getNonAnonymous());
375  $new_obj->update();
376 
377  // answers
378  $answers = $this->getAnswers();
379  if ($answers) {
380  foreach ($answers as $item) {
381  $new_obj->saveAnswer($item["answer"]);
382  }
383  }
384  }
const VIEW_RESULTS_AFTER_PERIOD
const VIEW_RESULTS_ALWAYS
setOfflineStatus(bool $status)
Class ilObjPoll.
static _getInstance(int $a_copy_id)
getImageFullPath(bool $a_as_thumb=false)
+ Here is the call graph for this function:

◆ doCreate()

ilObjPoll::doCreate ( bool  $clone_mode = false)
protected

Definition at line 276 of file class.ilObjPoll.php.

References ilObject\$db, $ilDB, ilObject\getId(), and propertiesToDB().

276  : void
277  {
278  $ilDB = $this->db;
279 
280  if ($this->getId()) {
281  $fields = $this->propertiesToDB();
282  $fields["id"] = array("integer", $this->getId());
283 
284  $ilDB->insert("il_poll", $fields);
285 
286 
287  // object activation default entry will be created on demand
288 
289 
290  // block handling
291  $block = new ilPollBlock();
292  $block->setType("poll");
293  $block->setContextObjId($this->getId());
294  $block->setContextObjType("poll");
295  $block->create();
296  }
297  }
ilDBInterface $db
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:

◆ doDelete()

ilObjPoll::doDelete ( )
protected

Definition at line 326 of file class.ilObjPoll.php.

References ilObject\$db, $ilDB, deleteAllAnswers(), ilObjectActivation\deleteAllEntries(), deleteImage(), and ilObject\getId().

326  : void
327  {
328  $ilDB = $this->db;
329 
330  if ($this->getId()) {
331  $this->deleteImage();
332  $this->deleteAllAnswers();
333 
334  if ($this->ref_id) {
336  }
337 
338  $ilDB->manipulate("DELETE FROM il_poll" .
339  " WHERE id = " . $ilDB->quote($this->id, "integer"));
340  }
341  }
static deleteAllEntries(int $ref_id)
Delete all db entries for ref id.
ilDBInterface $db
+ Here is the call graph for this function:

◆ doRead()

ilObjPoll::doRead ( )
protected

Definition at line 227 of file class.ilObjPoll.php.

References ilObject\$db, $ilDB, getAccessType(), ilObject\getId(), ilObjectActivation\getItem(), setAccessBegin(), setAccessEnd(), setAccessType(), setAccessVisibility(), setImage(), setMaxNumberOfAnswers(), setNonAnonymous(), setQuestion(), setShowComments(), setShowResultsAs(), setSortResultByVotes(), setViewResults(), setVotingPeriod(), setVotingPeriodBegin(), setVotingPeriodEnd(), ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

227  : void
228  {
229  $ilDB = $this->db;
230 
231  $set = $ilDB->query("SELECT * FROM il_poll" .
232  " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
233  $row = $ilDB->fetchAssoc($set);
234  $this->setQuestion((string) ($row["question"] ?? ''));
235  $this->setImage((string) ($row["image"] ?? ''));
236  $this->setViewResults((int) ($row["view_results"] ?? self::VIEW_RESULTS_AFTER_VOTE));
237  $this->setVotingPeriod((bool) ($row["period"] ?? 0));
238  $this->setVotingPeriodBegin((int) ($row["period_begin"] ?? 0));
239  $this->setVotingPeriodEnd((int) ($row["period_end"] ?? 0));
240  $this->setMaxNumberOfAnswers((int) ($row["max_answers"] ?? 0));
241  $this->setSortResultByVotes((bool) ($row["result_sort"] ?? 0));
242  $this->setNonAnonymous((bool) ($row["non_anon"] ?? 0));
243  $this->setShowResultsAs((int) ($row["show_results_as"] ?? self::SHOW_RESULTS_AS_BARCHART));
244 
245  // #14661
246  $this->setShowComments($this->notes->domain()->commentsActive($this->getId()));
247 
248  if ($this->ref_id) {
249  $activation = ilObjectActivation::getItem($this->ref_id);
250  $this->setAccessType((int) ($activation["timing_type"] ?? ilObjectActivation::TIMINGS_DEACTIVATED));
252  // default entry values should not be loaded if not activated
253  $this->setAccessBegin((int) ($activation["timing_start"] ?? time()));
254  $this->setAccessEnd((int) ($activation["timing_end"] ?? time()));
255  $this->setAccessVisibility((bool) ($activation["visible"] ?? false));
256  }
257  }
258  }
setAccessBegin(int $a_value)
setSortResultByVotes(bool $a_value)
setImage(string $a_value)
setAccessType(int $a_value)
setAccessEnd(int $a_value)
setQuestion(string $a_value)
setShowComments(bool $a_value)
setVotingPeriod(bool $a_value)
setMaxNumberOfAnswers(int $a_value)
setShowResultsAs(int $a_value)
setNonAnonymous(bool $a_value)
setViewResults(int $a_value)
ilDBInterface $db
setVotingPeriodBegin(int $a_value)
setAccessVisibility(bool $a_value)
static getItem(int $ref_id)
setVotingPeriodEnd(int $a_value)
+ Here is the call graph for this function:

◆ doUpdate()

ilObjPoll::doUpdate ( )
protected

Definition at line 299 of file class.ilObjPoll.php.

References ilObject\$db, $ilDB, getAccessBegin(), getAccessEnd(), getAccessType(), getAccessVisibility(), ilObject\getId(), ilObject\getRefId(), getShowComments(), and propertiesToDB().

299  : void
300  {
301  $ilDB = $this->db;
302 
303  if ($this->getId()) {
304  $fields = $this->propertiesToDB();
305 
306  $ilDB->update(
307  "il_poll",
308  $fields,
309  array("id" => array("integer", $this->getId()))
310  );
311 
312  // #14661
313  $this->notes->domain()->activateComments($this->getId(), $this->getShowComments());
314 
315  if ($this->getRefId()) {
316  $activation = new ilObjectActivation();
317  $activation->setTimingType($this->getAccessType());
318  $activation->setTimingStart($this->getAccessBegin());
319  $activation->setTimingEnd($this->getAccessEnd());
320  $activation->toggleVisible($this->getAccessVisibility());
321  $activation->update($this->ref_id);
322  }
323  }
324  }
ilDBInterface $db
Class ilObjectActivation.
+ Here is the call graph for this function:

◆ getAccessBegin()

ilObjPoll::getAccessBegin ( )

Definition at line 92 of file class.ilObjPoll.php.

References $access_begin.

Referenced by doUpdate(), and ilPollStateInfo\isOfflineOrUnavailable().

92  : int
93  {
94  return $this->access_begin;
95  }
+ Here is the caller graph for this function:

◆ getAccessEnd()

ilObjPoll::getAccessEnd ( )

Definition at line 102 of file class.ilObjPoll.php.

References $access_end.

Referenced by doUpdate(), and ilPollStateInfo\isOfflineOrUnavailable().

102  : int
103  {
104  return $this->access_end;
105  }
+ Here is the caller graph for this function:

◆ getAccessType()

ilObjPoll::getAccessType ( )

Definition at line 82 of file class.ilObjPoll.php.

References $access_type.

Referenced by doRead(), doUpdate(), and ilPollStateInfo\isOfflineOrUnavailable().

82  : int
83  {
84  return $this->access_type;
85  }
+ Here is the caller graph for this function:

◆ getAccessVisibility()

ilObjPoll::getAccessVisibility ( )

Definition at line 112 of file class.ilObjPoll.php.

References $access_visibility.

Referenced by doUpdate().

112  : bool
113  {
115  }
bool $access_visibility
+ Here is the caller graph for this function:

◆ getAnswer()

ilObjPoll::getAnswer ( int  $a_id)

Definition at line 513 of file class.ilObjPoll.php.

References ilObject\$db, and $ilDB.

513  : array
514  {
515  $ilDB = $this->db;
516 
517  $sql = "SELECT * FROM il_poll_answer" .
518  " WHERE id = " . $ilDB->quote($a_id, "integer");
519  $set = $ilDB->query($sql);
520  return (array) $ilDB->fetchAssoc($set);
521  }
ilDBInterface $db

◆ getAnswers()

ilObjPoll::getAnswers ( )

Definition at line 497 of file class.ilObjPoll.php.

References ilObject\$db, $ilDB, $res, and ilObject\getId().

Referenced by ilPollAnswersHandler\__construct(), doCloneObject(), ilPollStateInfo\hasQuestion(), rebuildAnswerPositions(), and saveAnswers().

497  : array
498  {
499  $ilDB = $this->db;
500 
501  $res = [];
502 
503  $sql = "SELECT * FROM il_poll_answer" .
504  " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer") .
505  " ORDER BY pos ASC";
506  $set = $ilDB->query($sql);
507  while ($row = $ilDB->fetchAssoc($set)) {
508  $res[] = $row;
509  }
510  return $res;
511  }
$res
Definition: ltiservices.php:69
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImage()

ilObjPoll::getImage ( )

Definition at line 132 of file class.ilObjPoll.php.

References $image.

Referenced by doCloneObject(), getImageFullPath(), and propertiesToDB().

132  : string
133  {
134  return $this->image;
135  }
+ Here is the caller graph for this function:

◆ getImageFullPath()

ilObjPoll::getImageFullPath ( bool  $a_as_thumb = false)

Definition at line 391 of file class.ilObjPoll.php.

References $path, and getImage().

Referenced by doCloneObject(), and ilPollContentRenderer\render().

391  : ?string
392  {
393  $img = $this->getImage();
394  if ($img) {
395  $path = self::initStorage($this->id);
396  if (!$a_as_thumb) {
397  return $path . $img;
398  } else {
399  return $path . "thb_" . $img;
400  }
401  }
402 
403  return null;
404  }
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageSize()

static ilObjPoll::getImageSize ( )
static

Definition at line 486 of file class.ilObjPoll.php.

Referenced by ilObjPollGUI\initQuestionForm().

486  : string
487  {
488  // :TODO:
489  return "600x600";
490  }
+ Here is the caller graph for this function:

◆ getMaxNumberOfAnswers()

ilObjPoll::getMaxNumberOfAnswers ( )

Definition at line 182 of file class.ilObjPoll.php.

References $max_number_answers.

Referenced by ilPollAnswersHandler\__construct(), doCloneObject(), and propertiesToDB().

182  : int
183  {
185  }
int $max_number_answers
+ Here is the caller graph for this function:

◆ getNonAnonymous()

ilObjPoll::getNonAnonymous ( )

Definition at line 202 of file class.ilObjPoll.php.

References $mode_non_anonymous.

Referenced by doCloneObject(), propertiesToDB(), and ilPollContentRenderer\renderAnswers().

202  : bool
203  {
205  }
bool $mode_non_anonymous
+ Here is the caller graph for this function:

◆ getQuestion()

ilObjPoll::getQuestion ( )

Definition at line 122 of file class.ilObjPoll.php.

References $question.

Referenced by doCloneObject(), propertiesToDB(), and ilPollContentRenderer\render().

122  : string
123  {
124  return $this->question;
125  }
string $question
+ Here is the caller graph for this function:

◆ getShowComments()

ilObjPoll::getShowComments ( )

Definition at line 212 of file class.ilObjPoll.php.

References $show_comments.

Referenced by doCloneObject(), doUpdate(), and ilPollContentRenderer\render().

212  : bool
213  {
214  return $this->show_comments;
215  }
bool $show_comments
+ Here is the caller graph for this function:

◆ getShowResultsAs()

ilObjPoll::getShowResultsAs ( )

Definition at line 222 of file class.ilObjPoll.php.

References $show_results_as.

Referenced by doCloneObject(), propertiesToDB(), and ilPollContentRenderer\renderResults().

222  : int
223  {
224  return $this->show_results_as;
225  }
int $show_results_as
+ Here is the caller graph for this function:

◆ getSortResultByVotes()

ilObjPoll::getSortResultByVotes ( )

Definition at line 192 of file class.ilObjPoll.php.

References $result_sort_by_votes.

Referenced by ilPollResultsHandler\__construct(), doCloneObject(), and propertiesToDB().

192  : bool
193  {
195  }
bool $result_sort_by_votes
+ Here is the caller graph for this function:

◆ getViewResults()

ilObjPoll::getViewResults ( )

Definition at line 142 of file class.ilObjPoll.php.

References $view_results.

Referenced by ilPollStateInfo\areResultsVisible(), doCloneObject(), propertiesToDB(), and ilPollStateInfo\willResultsBeShown().

142  : int
143  {
144  return $this->view_results;
145  }
+ Here is the caller graph for this function:

◆ getVotePercentages()

ilObjPoll::getVotePercentages ( )

Definition at line 720 of file class.ilObjPoll.php.

References $id, $res, countVotes(), ilObject\getId(), and ILIAS\Repository\int().

Referenced by ilPollResultsHandler\__construct().

720  : array
721  {
722  $res = [];
723  $cnt = 0;
724 
725  $sql = "SELECT answer_id, count(*) cnt" .
726  " FROM il_poll_vote" .
727  " WHERE poll_id = " . $this->db->quote($this->getId(), "integer") .
728  " GROUP BY answer_id";
729  $set = $this->db->query($sql);
730  while ($row = $this->db->fetchAssoc($set)) {
731  $cnt += (int) $row["cnt"];
732  $res[(int) $row["answer_id"]] = array("abs" => (int) $row["cnt"], "perc" => 0);
733  }
734 
735  foreach ($res as $id => $item) {
736  $abs = (int) ($item['abs'] ?? 0);
737  $id = (int) ($id ?? 0);
738  if ($cnt === 0) {
739  $res[$id]["perc"] = 0;
740  } else {
741  $res[$id]["perc"] = $abs / $cnt * 100;
742  }
743  }
744 
745  return array("perc" => $res, "total" => $this->countVotes());
746  }
$res
Definition: ltiservices.php:69
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getVotesByUsers()

ilObjPoll::getVotesByUsers ( )

Definition at line 748 of file class.ilObjPoll.php.

References ilObject\$db, $ilDB, $res, ilObject\getId(), and ILIAS\Repository\int().

748  : array
749  {
750  $ilDB = $this->db;
751 
752  $res = [];
753 
754  $sql = "SELECT answer_id, user_id, firstname, lastname, login" .
755  " FROM il_poll_vote" .
756  " JOIN usr_data ON (usr_data.usr_id = il_poll_vote.user_id)" .
757  " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer");
758  $set = $ilDB->query($sql);
759  while ($row = $ilDB->fetchAssoc($set)) {
760  $user_id = (int) ($row["user_id"] ?? 0);
761  if (!isset($res[$user_id])) {
762  $res[$user_id] = $row;
763  }
764  $res[$user_id]["answers"][] = (int) ($row["answer_id"] ?? 0);
765  }
766 
767  return $res;
768  }
$res
Definition: ltiservices.php:69
ilDBInterface $db
+ Here is the call graph for this function:

◆ getVotingPeriod()

ilObjPoll::getVotingPeriod ( )

Definition at line 152 of file class.ilObjPoll.php.

References $period.

Referenced by ilPollStateInfo\hasVotingPeriodEnded(), ilPollStateInfo\hasVotingPeriodNotStarted(), and propertiesToDB().

152  : bool
153  {
154  return $this->period;
155  }
+ Here is the caller graph for this function:

◆ getVotingPeriodBegin()

ilObjPoll::getVotingPeriodBegin ( )

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

References $period_begin.

Referenced by ilPollStateInfo\hasVotingPeriodNotStarted(), propertiesToDB(), and ilPollContentRenderer\render().

162  : int
163  {
164  return $this->period_begin;
165  }
+ Here is the caller graph for this function:

◆ getVotingPeriodEnd()

ilObjPoll::getVotingPeriodEnd ( )

Definition at line 172 of file class.ilObjPoll.php.

References $period_end.

Referenced by ilPollStateInfo\hasVotingPeriodEnded(), propertiesToDB(), ilPollContentRenderer\render(), ilPollContentRenderer\renderAnswers(), and ilPollContentRenderer\renderAnswersAndResults().

172  : int
173  {
174  return $this->period_end;
175  }
+ Here is the caller graph for this function:

◆ hasUserVoted()

ilObjPoll::hasUserVoted ( int  $a_user_id)

Definition at line 699 of file class.ilObjPoll.php.

References ilObject\getId().

Referenced by ilPollStateInfo\hasUserAlreadyVoted(), and saveVote().

699  : bool
700  {
701  $sql = "SELECT user_id" .
702  " FROM il_poll_vote" .
703  " WHERE poll_id = " . $this->db->quote($this->getId(), "integer") .
704  " AND user_id = " . $this->db->quote($a_user_id, "integer");
705  $this->db->setLimit(1, 0);
706  $set = $this->db->query($sql);
707  return (bool) $this->db->numRows($set);
708  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initStorage()

static ilObjPoll::initStorage ( int  $a_id,
?string  $a_subdir = null 
)
static

Definition at line 416 of file class.ilObjPoll.php.

References $path.

Referenced by ilPollDataSet\getXmlRecord().

416  : string
417  {
418  $storage = new ilFSStoragePoll($a_id);
419  $storage->create();
420 
421  $path = $storage->getAbsolutePath() . "/";
422 
423  if ($a_subdir) {
424  $path .= $a_subdir . "/";
425 
426  if (!is_dir($path)) {
427  mkdir($path);
428  }
429  }
430 
431  return $path;
432  }
$path
Definition: ltiservices.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ initType()

ilObjPoll::initType ( )
protected

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

72  : void
73  {
74  $this->type = "poll";
75  }

◆ propertiesToDB()

ilObjPoll::propertiesToDB ( )
protected

Definition at line 260 of file class.ilObjPoll.php.

References getImage(), getMaxNumberOfAnswers(), getNonAnonymous(), getQuestion(), getShowResultsAs(), getSortResultByVotes(), getViewResults(), getVotingPeriod(), getVotingPeriodBegin(), and getVotingPeriodEnd().

Referenced by doCreate(), and doUpdate().

260  : array
261  {
262  return array(
263  "question" => array("text", $this->getQuestion()),
264  "image" => array("text", $this->getImage()),
265  "view_results" => array("integer", $this->getViewResults()),
266  "period" => array("integer", $this->getVotingPeriod()),
267  "period_begin" => array("integer", $this->getVotingPeriodBegin()),
268  "period_end" => array("integer", $this->getVotingPeriodEnd()),
269  "max_answers" => array("integer", $this->getMaxNumberOfAnswers()),
270  "result_sort" => array("integer", $this->getSortResultByVotes()),
271  "non_anon" => array("integer", $this->getNonAnonymous()),
272  "show_results_as" => array("integer", $this->getShowResultsAs()),
273  );
274  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rebuildAnswerPositions()

ilObjPoll::rebuildAnswerPositions ( )

Definition at line 565 of file class.ilObjPoll.php.

References $id, getAnswers(), ILIAS\Repository\int(), and updateAnswerPositions().

565  : void
566  {
567  $answers = $this->getAnswers();
568 
569  $pos = [];
570  foreach ($answers as $item) {
571  $id = (int) ($item['id'] ?? 0);
572  $pos[$id] = (int) ($item["pos"] ?? 10);
573  }
574 
575  $this->updateAnswerPositions($pos);
576  }
updateAnswerPositions(array $a_pos)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ saveAnswer()

ilObjPoll::saveAnswer ( string  $a_text,
?int  $a_pos = null 
)

Definition at line 523 of file class.ilObjPoll.php.

References ilObject\$db, $id, $ilDB, ilObject\getId(), and ILIAS\Repository\int().

Referenced by saveAnswers().

523  : ?int
524  {
525  $ilDB = $this->db;
526 
527  if (!trim($a_text)) {
528  return null;
529  }
530 
531  $id = $ilDB->nextId("il_poll_answer");
532 
533  if (!$a_pos) {
534  // append
535  $sql = "SELECT max(pos) pos" .
536  " FROM il_poll_answer" .
537  " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer");
538  $set = $ilDB->query($sql);
539  $a_pos = $ilDB->fetchAssoc($set);
540  $a_pos = (int) ($a_pos["pos"] ?? 0) + 10;
541  }
542 
543  $fields = array(
544  "id" => array("integer", $id),
545  "poll_id" => array("integer", $this->getId()),
546  "answer" => array("text", trim($a_text)),
547  "pos" => array("integer", $a_pos)
548  );
549  $ilDB->insert("il_poll_answer", $fields);
550 
551  return $id;
552  }
ilDBInterface $db
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAnswers()

ilObjPoll::saveAnswers ( array  $a_answers)

Definition at line 631 of file class.ilObjPoll.php.

References $id, deleteAnswer(), getAnswers(), ILIAS\Repository\int(), saveAnswer(), and updateAnswerPositions().

631  : int
632  {
633  $existing = $this->getAnswers();
634 
635  $ids = [];
636  $pos = 0;
637  $id = null;
638  foreach ($a_answers as $answer) {
639  if (trim($answer)) {
640  // existing answer?
641  $found = false;
642  foreach ($existing as $idx => $item) {
643  if (trim($answer) === (string) ($item["answer"] ?? '')) {
644  $found = true;
645  unset($existing[$idx]);
646 
647  $id = (int) ($item["id"] ?? 0);
648  }
649  }
650 
651  // create new answer
652  if (!$found) {
653  $id = $this->saveAnswer($answer);
654  }
655 
656  // add existing answer id to order
657  if (isset($id) && is_int($id)) {
658  $ids[$id] = ++$pos;
659  }
660  }
661  }
662 
663  // remove obsolete answers
664  if (count($existing)) {
665  foreach ($existing as $item) {
666  if (isset($item["id"])) {
667  $this->deleteAnswer((int) $item["id"]);
668  }
669  }
670  }
671 
672  // save current order
673  if (count($ids)) {
674  $this->updateAnswerPositions($ids);
675  }
676 
677  return count($ids);
678  }
updateAnswerPositions(array $a_pos)
deleteAnswer(int $a_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
saveAnswer(string $a_text, ?int $a_pos=null)
+ Here is the call graph for this function:

◆ saveVote()

ilObjPoll::saveVote ( int  $a_user_id,
array  $a_answers 
)

Definition at line 685 of file class.ilObjPoll.php.

References ilObject\getId(), and hasUserVoted().

685  : void
686  {
687  if ($this->hasUserVoted($a_user_id)) {
688  return;
689  }
690 
691  foreach ($a_answers as $answer_id) {
692  $fields = array("user_id" => array("integer", $a_user_id),
693  "poll_id" => array("integer", $this->getId()),
694  "answer_id" => array("integer", $answer_id));
695  $this->db->insert("il_poll_vote", $fields);
696  }
697  }
hasUserVoted(int $a_user_id)
+ Here is the call graph for this function:

◆ setAccessBegin()

ilObjPoll::setAccessBegin ( int  $a_value)

Definition at line 87 of file class.ilObjPoll.php.

Referenced by doRead().

87  : void
88  {
89  $this->access_begin = $a_value;
90  }
+ Here is the caller graph for this function:

◆ setAccessEnd()

ilObjPoll::setAccessEnd ( int  $a_value)

Definition at line 97 of file class.ilObjPoll.php.

Referenced by doRead().

97  : void
98  {
99  $this->access_end = $a_value;
100  }
+ Here is the caller graph for this function:

◆ setAccessType()

ilObjPoll::setAccessType ( int  $a_value)

Definition at line 77 of file class.ilObjPoll.php.

Referenced by __construct(), and doRead().

77  : void
78  {
79  $this->access_type = $a_value;
80  }
+ Here is the caller graph for this function:

◆ setAccessVisibility()

ilObjPoll::setAccessVisibility ( bool  $a_value)

Definition at line 107 of file class.ilObjPoll.php.

Referenced by doRead().

107  : void
108  {
109  $this->access_visibility = $a_value;
110  }
+ Here is the caller graph for this function:

◆ setImage()

ilObjPoll::setImage ( string  $a_value)

Definition at line 127 of file class.ilObjPoll.php.

Referenced by deleteImage(), doRead(), and uploadImage().

127  : void
128  {
129  $this->image = $a_value;
130  }
+ Here is the caller graph for this function:

◆ setMaxNumberOfAnswers()

ilObjPoll::setMaxNumberOfAnswers ( int  $a_value)

Definition at line 177 of file class.ilObjPoll.php.

Referenced by doRead().

177  : void
178  {
179  $this->max_number_answers = $a_value;
180  }
+ Here is the caller graph for this function:

◆ setNonAnonymous()

ilObjPoll::setNonAnonymous ( bool  $a_value)

Definition at line 197 of file class.ilObjPoll.php.

Referenced by doRead().

197  : void
198  {
199  $this->mode_non_anonymous = $a_value;
200  }
+ Here is the caller graph for this function:

◆ setQuestion()

ilObjPoll::setQuestion ( string  $a_value)

Definition at line 117 of file class.ilObjPoll.php.

Referenced by doRead().

117  : void
118  {
119  $this->question = $a_value;
120  }
+ Here is the caller graph for this function:

◆ setShowComments()

ilObjPoll::setShowComments ( bool  $a_value)

Definition at line 207 of file class.ilObjPoll.php.

Referenced by doRead().

207  : void
208  {
209  $this->show_comments = $a_value;
210  }
+ Here is the caller graph for this function:

◆ setShowResultsAs()

ilObjPoll::setShowResultsAs ( int  $a_value)

Definition at line 217 of file class.ilObjPoll.php.

Referenced by doRead().

217  : void
218  {
219  $this->show_results_as = $a_value;
220  }
+ Here is the caller graph for this function:

◆ setSortResultByVotes()

ilObjPoll::setSortResultByVotes ( bool  $a_value)

Definition at line 187 of file class.ilObjPoll.php.

Referenced by doRead().

187  : void
188  {
189  $this->result_sort_by_votes = $a_value;
190  }
+ Here is the caller graph for this function:

◆ setViewResults()

ilObjPoll::setViewResults ( int  $a_value)

Definition at line 137 of file class.ilObjPoll.php.

Referenced by __construct(), and doRead().

137  : void
138  {
139  $this->view_results = $a_value;
140  }
+ Here is the caller graph for this function:

◆ setVotingPeriod()

ilObjPoll::setVotingPeriod ( bool  $a_value)

Definition at line 147 of file class.ilObjPoll.php.

Referenced by __construct(), and doRead().

147  : void
148  {
149  $this->period = $a_value;
150  }
+ Here is the caller graph for this function:

◆ setVotingPeriodBegin()

ilObjPoll::setVotingPeriodBegin ( int  $a_value)

Definition at line 157 of file class.ilObjPoll.php.

Referenced by doRead().

157  : void
158  {
159  $this->period_begin = $a_value;
160  }
+ Here is the caller graph for this function:

◆ setVotingPeriodEnd()

ilObjPoll::setVotingPeriodEnd ( int  $a_value)

Definition at line 167 of file class.ilObjPoll.php.

Referenced by doRead().

167  : void
168  {
169  $this->period_end = $a_value;
170  }
+ Here is the caller graph for this function:

◆ updateAnswer()

ilObjPoll::updateAnswer ( int  $a_id,
string  $a_text 
)

Definition at line 554 of file class.ilObjPoll.php.

References ilObject\$db, and $ilDB.

554  : void
555  {
556  $ilDB = $this->db;
557 
558  $ilDB->update(
559  "il_poll_answer",
560  array("answer" => array("text", $a_text)),
561  array("id" => array("integer", $a_id))
562  );
563  }
ilDBInterface $db

◆ updateAnswerPositions()

ilObjPoll::updateAnswerPositions ( array  $a_pos)

Definition at line 578 of file class.ilObjPoll.php.

References ilObject\$db, $id, and $ilDB.

Referenced by rebuildAnswerPositions(), and saveAnswers().

578  : void
579  {
580  $ilDB = $this->db;
581 
582  asort($a_pos);
583 
584  $pos = 0;
585  foreach (array_keys($a_pos) as $id) {
586  $pos += 10;
587 
588  $ilDB->update(
589  "il_poll_answer",
590  array("pos" => array("integer", $pos)),
591  array("id" => array("integer", $id))
592  );
593  }
594  }
ilDBInterface $db
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the caller graph for this function:

◆ uploadImage()

ilObjPoll::uploadImage ( array  $a_upload,
bool  $a_clone = false 
)

Definition at line 434 of file class.ilObjPoll.php.

References $path, deleteImage(), ilFileUtils\moveUploadedFile(), and setImage().

434  : bool
435  {
436  if (!$this->id) {
437  return false;
438  }
439 
440  $this->deleteImage();
441 
442  // #10074
443  $name = (string) ($a_upload['name'] ?? '');
444  $tmp_name = (string) ($a_upload['tmp_name'] ?? '');
445  $clean_name = preg_replace("/[^a-zA-Z0-9\_\.\-]/", "", $name);
446 
447  $path = self::initStorage($this->id);
448  $original = "org_" . $this->id . "_" . $clean_name;
449  $thumb = "thb_" . $this->id . "_" . $clean_name;
450  $processed = $this->id . "_" . $clean_name;
451 
452  $success = false;
453  if (!$a_clone) {
454  $success = ilFileUtils::moveUploadedFile($tmp_name, $original, $path . $original);
455  } else {
456  $success = copy($tmp_name, $path . $original);
457  }
458  if ($success) {
459  chmod($path . $original, 0770);
460 
461  // take quality 100 to avoid jpeg artefacts when uploading jpeg files
462  $original_file = $path . $original;
463  $thumb_file = $path . $thumb;
464  $processed_file = $path . $processed;
465 
466  $this->image_converter->croppedSquare(
467  $original_file,
468  $thumb_file,
469  100,
470  ImageOutputOptions::FORMAT_PNG
471  );
472 
473  $this->image_converter->croppedSquare(
474  $original_file,
475  $processed_file,
476  300,
477  ImageOutputOptions::FORMAT_PNG
478  );
479 
480  $this->setImage($processed);
481  return true;
482  }
483  return false;
484  }
setImage(string $a_value)
$path
Definition: ltiservices.php:32
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
+ Here is the call graph for this function:

Field Documentation

◆ $access_begin

int ilObjPoll::$access_begin = 0
protected

Definition at line 32 of file class.ilObjPoll.php.

Referenced by getAccessBegin().

◆ $access_end

int ilObjPoll::$access_end = 0
protected

Definition at line 33 of file class.ilObjPoll.php.

Referenced by getAccessEnd().

◆ $access_type

int ilObjPoll::$access_type = 0
protected

Definition at line 31 of file class.ilObjPoll.php.

Referenced by getAccessType().

◆ $access_visibility

bool ilObjPoll::$access_visibility = false
protected

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

Referenced by getAccessVisibility().

◆ $image

string ilObjPoll::$image = ""
protected

Definition at line 36 of file class.ilObjPoll.php.

Referenced by getImage().

◆ $image_converter

ILIAS Filesystem Util Convert LegacyImages ilObjPoll::$image_converter
private

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

◆ $max_number_answers

int ilObjPoll::$max_number_answers = 0
protected

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

Referenced by getMaxNumberOfAnswers().

◆ $mode_non_anonymous

bool ilObjPoll::$mode_non_anonymous = false
protected

Definition at line 44 of file class.ilObjPoll.php.

Referenced by getNonAnonymous().

◆ $notes

ILIAS Notes Service ilObjPoll::$notes
protected

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

◆ $period

bool ilObjPoll::$period = false
protected

Definition at line 38 of file class.ilObjPoll.php.

Referenced by getVotingPeriod().

◆ $period_begin

int ilObjPoll::$period_begin = 0
protected

Definition at line 39 of file class.ilObjPoll.php.

Referenced by getVotingPeriodBegin().

◆ $period_end

int ilObjPoll::$period_end = 0
protected

Definition at line 40 of file class.ilObjPoll.php.

Referenced by getVotingPeriodEnd().

◆ $question

string ilObjPoll::$question = ""
protected

Definition at line 35 of file class.ilObjPoll.php.

Referenced by getQuestion().

◆ $result_sort_by_votes

bool ilObjPoll::$result_sort_by_votes = false
protected

Definition at line 43 of file class.ilObjPoll.php.

Referenced by getSortResultByVotes().

◆ $show_comments

bool ilObjPoll::$show_comments = false
protected

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

Referenced by getShowComments().

◆ $show_results_as

int ilObjPoll::$show_results_as = 1
protected

Definition at line 46 of file class.ilObjPoll.php.

Referenced by getShowResultsAs().

◆ $view_results

int ilObjPoll::$view_results = 0
protected

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

Referenced by getViewResults().

◆ SHOW_RESULTS_AS_BARCHART

const ilObjPoll::SHOW_RESULTS_AS_BARCHART = 1

Definition at line 53 of file class.ilObjPoll.php.

Referenced by ilObjPollGUI\initEditCustomForm().

◆ SHOW_RESULTS_AS_PIECHART

const ilObjPoll::SHOW_RESULTS_AS_PIECHART = 2

◆ VIEW_RESULTS_AFTER_PERIOD

◆ VIEW_RESULTS_AFTER_VOTE

const ilObjPoll::VIEW_RESULTS_AFTER_VOTE = 3

◆ VIEW_RESULTS_ALWAYS

const ilObjPoll::VIEW_RESULTS_ALWAYS = 1

◆ VIEW_RESULTS_NEVER

const ilObjPoll::VIEW_RESULTS_NEVER = 2

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