ILIAS  release_8 Revision v8.24
ilObjPoll Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 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 ()
 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...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 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 $desc)
 
 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 = 1
 
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
 
int $id
 
bool $referenced
 
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 = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 26 of file class.ilObjPoll.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
int$a_idreference_id or object_id
bool$a_referencetreat the id as reference_id (true) or object_id (false)

Reimplemented from ilObject2.

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

56 {
57 global $DIC;
58
59 $this->db = $DIC->database();
60 // default
61 $this->setViewResults(self::VIEW_RESULTS_AFTER_VOTE);
63 $this->setVotingPeriod(false);
64 $this->notes = $DIC->notes();
65
66 parent::__construct($a_id, $a_reference);
67 }
setViewResults(int $a_value)
setAccessType(int $a_value)
setVotingPeriod(bool $a_value)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), setAccessType(), setViewResults(), setVotingPeriod(), and ilObjectActivation\TIMINGS_DEACTIVATED.

+ Here is the call graph for this function:

Member Function Documentation

◆ countVotes()

ilObjPoll::countVotes ( )

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

697 : int
698 {
699 $sql = "SELECT COUNT(DISTINCT(user_id)) cnt" .
700 " FROM il_poll_vote" .
701 " WHERE poll_id = " . $this->db->quote($this->getId(), "integer");
702 $set = $this->db->query($sql);
703 $row = $this->db->fetchAssoc($set);
704 return (int) $row["cnt"];
705 }

References ilObject\getId().

Referenced by getVotePercentages().

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

◆ deleteAllAnswers()

ilObjPoll::deleteAllAnswers ( )
protected

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

596 : void
597 {
599
600 if ($this->getId()) {
601 $this->deleteAllVotes();
602
603 $ilDB->manipulate("DELETE FROM il_poll_answer" .
604 " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer"));
605 }
606 }
ilDBInterface $db

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

Referenced by doDelete().

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

◆ deleteAllVotes()

ilObjPoll::deleteAllVotes ( )

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

608 : void
609 {
611
612 if ($this->getId()) {
613 $ilDB->manipulate("DELETE FROM il_poll_vote" .
614 " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer"));
615 }
616 }

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

Referenced by deleteAllAnswers().

+ 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 583 of file class.ilObjPoll.php.

583 : void
584 {
586
587 if ($a_id) {
588 $ilDB->manipulate("DELETE FROM il_poll_vote" .
589 " WHERE answer_id = " . $ilDB->quote($this->getId(), "integer"));
590
591 $ilDB->manipulate("DELETE FROM il_poll_answer" .
592 " WHERE id = " . $ilDB->quote($a_id, "integer"));
593 }
594 }

References ilObject\$db, and $ilDB.

Referenced by saveAnswers().

+ Here is the caller graph for this function:

◆ deleteImage()

ilObjPoll::deleteImage ( )

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

394 : void
395 {
396 if ($this->id) {
397 $storage = new ilFSStoragePoll($this->id);
398 $storage->delete();
399
400 $this->setImage("");
401 }
402 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setImage(string $a_value)

References setImage().

Referenced by doDelete(), and uploadImage().

+ 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

Reimplemented from ilObject2.

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

340 : void
341 {
342 assert($new_obj instanceof ilObjPoll);
343
344 // question/image
345 $new_obj->setQuestion($this->getQuestion());
346 $image = $this->getImageFullPath();
347 if ($image) {
348 $image = array("tmp_name" => $image,
349 "name" => $this->getImage());
350 $new_obj->uploadImage($image, true);
351 }
352
353 //copy online status if object is not the root copy object
354 $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
355
356 if ($cp_options->isRootNode($this->getRefId())) {
357 $new_obj->setOfflineStatus(true);
358 }
359
360 $new_obj->setViewResults($this->getViewResults());
361 $new_obj->setShowComments($this->getShowComments());
362 $new_obj->setShowResultsAs($this->getShowResultsAs());
363 $new_obj->update();
364
365 // answers
366 $answers = $this->getAnswers();
367 if ($answers) {
368 foreach ($answers as $item) {
369 $new_obj->saveAnswer($item["answer"]);
370 }
371 }
372 }
static _getInstance(int $a_copy_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getImageFullPath(bool $a_as_thumb=false)
setOfflineStatus(bool $status)

References $image, ilCopyWizardOptions\_getInstance(), getAnswers(), getImage(), getImageFullPath(), getQuestion(), getShowComments(), getShowResultsAs(), getViewResults(), ilObject\setOfflineStatus(), and ilObject2\update().

+ Here is the call graph for this function:

◆ doCreate()

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

Reimplemented from ilObject2.

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

273 : void
274 {
276
277 if ($this->getId()) {
278 $fields = $this->propertiesToDB();
279 $fields["id"] = array("integer", $this->getId());
280
281 $ilDB->insert("il_poll", $fields);
282
283
284 // object activation default entry will be created on demand
285
286
287 // block handling
288 $block = new ilPollBlock();
289 $block->setType("poll");
290 $block->setContextObjId($this->getId());
291 $block->setContextObjType("poll");
292 $block->create();
293 }
294 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the call graph for this function:

◆ doDelete()

ilObjPoll::doDelete ( )
protected

Reimplemented from ilObject2.

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

323 : void
324 {
326
327 if ($this->getId()) {
328 $this->deleteImage();
329 $this->deleteAllAnswers();
330
331 if ($this->ref_id) {
333 }
334
335 $ilDB->manipulate("DELETE FROM il_poll" .
336 " WHERE id = " . $ilDB->quote($this->id, "integer"));
337 }
338 }
static deleteAllEntries(int $ref_id)
Delete all db entries for ref id.

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

+ Here is the call graph for this function:

◆ doRead()

ilObjPoll::doRead ( )
protected

Reimplemented from ilObject2.

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

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

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

+ Here is the call graph for this function:

◆ doUpdate()

ilObjPoll::doUpdate ( )
protected

Reimplemented from ilObject2.

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

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

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

+ Here is the call graph for this function:

◆ getAccessBegin()

ilObjPoll::getAccessBegin ( )

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

89 : int
90 {
92 }

References $access_begin.

Referenced by doUpdate().

+ Here is the caller graph for this function:

◆ getAccessEnd()

ilObjPoll::getAccessEnd ( )

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

99 : int
100 {
101 return $this->access_end;
102 }

References $access_end.

Referenced by doUpdate().

+ Here is the caller graph for this function:

◆ getAccessType()

ilObjPoll::getAccessType ( )

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

79 : int
80 {
81 return $this->access_type;
82 }

References $access_type.

Referenced by doRead(), and doUpdate().

+ Here is the caller graph for this function:

◆ getAccessVisibility()

ilObjPoll::getAccessVisibility ( )

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

109 : bool
110 {
112 }
bool $access_visibility

References $access_visibility.

Referenced by doUpdate().

+ Here is the caller graph for this function:

◆ getAnswer()

ilObjPoll::getAnswer ( int  $a_id)

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

500 : array
501 {
503
504 $sql = "SELECT * FROM il_poll_answer" .
505 " WHERE id = " . $ilDB->quote($a_id, "integer");
506 $set = $ilDB->query($sql);
507 return (array) $ilDB->fetchAssoc($set);
508 }

References ilObject\$db, and $ilDB.

◆ getAnswers()

ilObjPoll::getAnswers ( )

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

484 : array
485 {
487
488 $res = [];
489
490 $sql = "SELECT * FROM il_poll_answer" .
491 " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer") .
492 " ORDER BY pos ASC";
493 $set = $ilDB->query($sql);
494 while ($row = $ilDB->fetchAssoc($set)) {
495 $res[] = $row;
496 }
497 return $res;
498 }
$res
Definition: ltiservices.php:69

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

Referenced by doCloneObject(), rebuildAnswerPositions(), and saveAnswers().

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

◆ getImage()

ilObjPoll::getImage ( )

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

129 : string
130 {
131 return $this->image;
132 }

References $image.

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

+ Here is the caller graph for this function:

◆ getImageFullPath()

ilObjPoll::getImageFullPath ( bool  $a_as_thumb = false)

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

379 : ?string
380 {
381 $img = $this->getImage();
382 if ($img) {
383 $path = self::initStorage($this->id);
384 if (!$a_as_thumb) {
385 return $path . $img;
386 } else {
387 return $path . "thb_" . $img;
388 }
389 }
390
391 return null;
392 }
static initStorage(int $a_id, ?string $a_subdir=null)
$img
Definition: imgupload.php:83
$path
Definition: ltiservices.php:32

References $img, $path, getImage(), and initStorage().

Referenced by doCloneObject().

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

◆ getImageSize()

static ilObjPoll::getImageSize ( )
static

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

473 : string
474 {
475 // :TODO:
476 return "300x300";
477 }

Referenced by ilObjPollGUI\initQuestionForm(), and uploadImage().

+ Here is the caller graph for this function:

◆ getMaxNumberOfAnswers()

ilObjPoll::getMaxNumberOfAnswers ( )

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

179 : int
180 {
182 }
int $max_number_answers

References $max_number_answers.

Referenced by propertiesToDB().

+ Here is the caller graph for this function:

◆ getNonAnonymous()

ilObjPoll::getNonAnonymous ( )

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

199 : bool
200 {
202 }
bool $mode_non_anonymous

References $mode_non_anonymous.

Referenced by propertiesToDB().

+ Here is the caller graph for this function:

◆ getQuestion()

ilObjPoll::getQuestion ( )

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

119 : string
120 {
121 return $this->question;
122 }
string $question

References $question.

Referenced by doCloneObject(), and propertiesToDB().

+ Here is the caller graph for this function:

◆ getShowComments()

ilObjPoll::getShowComments ( )

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

209 : bool
210 {
212 }
bool $show_comments

References $show_comments.

Referenced by doCloneObject(), and doUpdate().

+ Here is the caller graph for this function:

◆ getShowResultsAs()

ilObjPoll::getShowResultsAs ( )

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

219 : int
220 {
222 }
int $show_results_as

References $show_results_as.

Referenced by doCloneObject(), and propertiesToDB().

+ Here is the caller graph for this function:

◆ getSortResultByVotes()

ilObjPoll::getSortResultByVotes ( )

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

189 : bool
190 {
192 }
bool $result_sort_by_votes

References $result_sort_by_votes.

Referenced by propertiesToDB().

+ Here is the caller graph for this function:

◆ getViewResults()

ilObjPoll::getViewResults ( )

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

139 : int
140 {
141 return $this->view_results;
142 }

References $view_results.

Referenced by doCloneObject(), and propertiesToDB().

+ Here is the caller graph for this function:

◆ getVotePercentages()

ilObjPoll::getVotePercentages ( )

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

707 : array
708 {
709 $res = [];
710 $cnt = 0;
711
712 $sql = "SELECT answer_id, count(*) cnt" .
713 " FROM il_poll_vote" .
714 " WHERE poll_id = " . $this->db->quote($this->getId(), "integer") .
715 " GROUP BY answer_id";
716 $set = $this->db->query($sql);
717 while ($row = $this->db->fetchAssoc($set)) {
718 $cnt += (int) $row["cnt"];
719 $res[(int) $row["answer_id"]] = array("abs" => (int) $row["cnt"], "perc" => 0);
720 }
721
722 foreach ($res as $id => $item) {
723 $abs = (int) ($item['abs'] ?? 0);
724 $id = (int) ($id ?? 0);
725 if ($cnt === 0) {
726 $res[$id]["perc"] = 0;
727 } else {
728 $res[$id]["perc"] = $abs / $cnt * 100;
729 }
730 }
731
732 return array("perc" => $res, "total" => $this->countVotes());
733 }

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

+ Here is the call graph for this function:

◆ getVotesByUsers()

ilObjPoll::getVotesByUsers ( )

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

735 : array
736 {
738
739 $res = [];
740
741 $sql = "SELECT answer_id, user_id, firstname, lastname, login" .
742 " FROM il_poll_vote" .
743 " JOIN usr_data ON (usr_data.usr_id = il_poll_vote.user_id)" .
744 " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer");
745 $set = $ilDB->query($sql);
746 while ($row = $ilDB->fetchAssoc($set)) {
747 $user_id = (int) ($row["user_id"] ?? 0);
748 if (!isset($res[$user_id])) {
749 $res[$user_id] = $row;
750 }
751 $res[$user_id]["answers"][] = (int) ($row["answer_id"] ?? 0);
752 }
753
754 return $res;
755 }

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

+ Here is the call graph for this function:

◆ getVotingPeriod()

ilObjPoll::getVotingPeriod ( )

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

149 : bool
150 {
151 return $this->period;
152 }

References $period.

Referenced by propertiesToDB().

+ Here is the caller graph for this function:

◆ getVotingPeriodBegin()

ilObjPoll::getVotingPeriodBegin ( )

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

159 : int
160 {
161 return $this->period_begin;
162 }

References $period_begin.

Referenced by propertiesToDB().

+ Here is the caller graph for this function:

◆ getVotingPeriodEnd()

ilObjPoll::getVotingPeriodEnd ( )

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

169 : int
170 {
171 return $this->period_end;
172 }

References $period_end.

Referenced by propertiesToDB().

+ Here is the caller graph for this function:

◆ hasUserVoted()

ilObjPoll::hasUserVoted ( int  $a_user_id)

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

686 : bool
687 {
688 $sql = "SELECT user_id" .
689 " FROM il_poll_vote" .
690 " WHERE poll_id = " . $this->db->quote($this->getId(), "integer") .
691 " AND user_id = " . $this->db->quote($a_user_id, "integer");
692 $this->db->setLimit(1, 0);
693 $set = $this->db->query($sql);
694 return (bool) $this->db->numRows($set);
695 }

References ilObject\getId().

Referenced by saveVote().

+ 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 404 of file class.ilObjPoll.php.

404 : string
405 {
406 $storage = new ilFSStoragePoll($a_id);
407 $storage->create();
408
409 $path = $storage->getAbsolutePath() . "/";
410
411 if ($a_subdir) {
412 $path .= $a_subdir . "/";
413
414 if (!is_dir($path)) {
415 mkdir($path);
416 }
417 }
418
419 return $path;
420 }

References $path.

Referenced by getImageFullPath(), ilPollDataSet\getXmlRecord(), and uploadImage().

+ Here is the caller graph for this function:

◆ initType()

ilObjPoll::initType ( )
protected

Reimplemented from ilObject2.

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

69 : void
70 {
71 $this->type = "poll";
72 }

◆ propertiesToDB()

ilObjPoll::propertiesToDB ( )
protected

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

257 : array
258 {
259 return array(
260 "question" => array("text", $this->getQuestion()),
261 "image" => array("text", $this->getImage()),
262 "view_results" => array("integer", $this->getViewResults()),
263 "period" => array("integer", $this->getVotingPeriod()),
264 "period_begin" => array("integer", $this->getVotingPeriodBegin()),
265 "period_end" => array("integer", $this->getVotingPeriodEnd()),
266 "max_answers" => array("integer", $this->getMaxNumberOfAnswers()),
267 "result_sort" => array("integer", $this->getSortResultByVotes()),
268 "non_anon" => array("integer", $this->getNonAnonymous()),
269 "show_results_as" => array("integer", $this->getShowResultsAs()),
270 );
271 }

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

Referenced by doCreate(), and doUpdate().

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

◆ rebuildAnswerPositions()

ilObjPoll::rebuildAnswerPositions ( )

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

552 : void
553 {
554 $answers = $this->getAnswers();
555
556 $pos = [];
557 foreach ($answers as $item) {
558 $id = (int) ($item['id'] ?? 0);
559 $pos[$id] = (int) ($item["pos"] ?? 10);
560 }
561
562 $this->updateAnswerPositions($pos);
563 }
updateAnswerPositions(array $a_pos)

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

+ Here is the call graph for this function:

◆ saveAnswer()

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

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

510 : ?int
511 {
513
514 if (!trim($a_text)) {
515 return null;
516 }
517
518 $id = $ilDB->nextId("il_poll_answer");
519
520 if (!$a_pos) {
521 // append
522 $sql = "SELECT max(pos) pos" .
523 " FROM il_poll_answer" .
524 " WHERE poll_id = " . $ilDB->quote($this->getId(), "integer");
525 $set = $ilDB->query($sql);
526 $a_pos = $ilDB->fetchAssoc($set);
527 $a_pos = (int) ($a_pos["pos"] ?? 0) + 10;
528 }
529
530 $fields = array(
531 "id" => array("integer", $id),
532 "poll_id" => array("integer", $this->getId()),
533 "answer" => array("text", trim($a_text)),
534 "pos" => array("integer", $a_pos)
535 );
536 $ilDB->insert("il_poll_answer", $fields);
537
538 return $id;
539 }

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

Referenced by saveAnswers().

+ 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 618 of file class.ilObjPoll.php.

618 : int
619 {
620 $existing = $this->getAnswers();
621
622 $ids = [];
623 $pos = 0;
624 $id = null;
625 foreach ($a_answers as $answer) {
626 if (trim($answer)) {
627 // existing answer?
628 $found = false;
629 foreach ($existing as $idx => $item) {
630 if (trim($answer) === (string) ($item["answer"] ?? '')) {
631 $found = true;
632 unset($existing[$idx]);
633
634 $id = (int) ($item["id"] ?? 0);
635 }
636 }
637
638 // create new answer
639 if (!$found) {
640 $id = $this->saveAnswer($answer);
641 }
642
643 // add existing answer id to order
644 if (isset($id) && is_int($id)) {
645 $ids[$id] = ++$pos;
646 }
647 }
648 }
649
650 // remove obsolete answers
651 if (count($existing)) {
652 foreach ($existing as $item) {
653 if (isset($item["id"])) {
654 $this->deleteAnswer((int) $item["id"]);
655 }
656 }
657 }
658
659 // save current order
660 if (count($ids)) {
661 $this->updateAnswerPositions($ids);
662 }
663
664 return count($ids);
665 }
deleteAnswer(int $a_id)
saveAnswer(string $a_text, ?int $a_pos=null)

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

+ Here is the call graph for this function:

◆ saveVote()

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

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

672 : void
673 {
674 if ($this->hasUserVoted($a_user_id)) {
675 return;
676 }
677
678 foreach ($a_answers as $answer_id) {
679 $fields = array("user_id" => array("integer", $a_user_id),
680 "poll_id" => array("integer", $this->getId()),
681 "answer_id" => array("integer", $answer_id));
682 $this->db->insert("il_poll_vote", $fields);
683 }
684 }
hasUserVoted(int $a_user_id)

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

+ Here is the call graph for this function:

◆ setAccessBegin()

ilObjPoll::setAccessBegin ( int  $a_value)

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

84 : void
85 {
86 $this->access_begin = $a_value;
87 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setAccessEnd()

ilObjPoll::setAccessEnd ( int  $a_value)

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

94 : void
95 {
96 $this->access_end = $a_value;
97 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setAccessType()

ilObjPoll::setAccessType ( int  $a_value)

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

74 : void
75 {
76 $this->access_type = $a_value;
77 }

Referenced by __construct(), and doRead().

+ Here is the caller graph for this function:

◆ setAccessVisibility()

ilObjPoll::setAccessVisibility ( bool  $a_value)

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

104 : void
105 {
106 $this->access_visibility = $a_value;
107 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setImage()

ilObjPoll::setImage ( string  $a_value)

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

124 : void
125 {
126 $this->image = $a_value;
127 }

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

+ Here is the caller graph for this function:

◆ setMaxNumberOfAnswers()

ilObjPoll::setMaxNumberOfAnswers ( int  $a_value)

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

174 : void
175 {
176 $this->max_number_answers = $a_value;
177 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setNonAnonymous()

ilObjPoll::setNonAnonymous ( bool  $a_value)

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

194 : void
195 {
196 $this->mode_non_anonymous = $a_value;
197 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setQuestion()

ilObjPoll::setQuestion ( string  $a_value)

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

114 : void
115 {
116 $this->question = $a_value;
117 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setShowComments()

ilObjPoll::setShowComments ( bool  $a_value)

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

204 : void
205 {
206 $this->show_comments = $a_value;
207 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setShowResultsAs()

ilObjPoll::setShowResultsAs ( int  $a_value)

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

214 : void
215 {
216 $this->show_results_as = $a_value;
217 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setSortResultByVotes()

ilObjPoll::setSortResultByVotes ( bool  $a_value)

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

184 : void
185 {
186 $this->result_sort_by_votes = $a_value;
187 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setViewResults()

ilObjPoll::setViewResults ( int  $a_value)

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

134 : void
135 {
136 $this->view_results = $a_value;
137 }

Referenced by __construct(), and doRead().

+ Here is the caller graph for this function:

◆ setVotingPeriod()

ilObjPoll::setVotingPeriod ( bool  $a_value)

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

144 : void
145 {
146 $this->period = $a_value;
147 }

Referenced by __construct(), and doRead().

+ Here is the caller graph for this function:

◆ setVotingPeriodBegin()

ilObjPoll::setVotingPeriodBegin ( int  $a_value)

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

154 : void
155 {
156 $this->period_begin = $a_value;
157 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setVotingPeriodEnd()

ilObjPoll::setVotingPeriodEnd ( int  $a_value)

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

164 : void
165 {
166 $this->period_end = $a_value;
167 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ updateAnswer()

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

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

541 : void
542 {
544
545 $ilDB->update(
546 "il_poll_answer",
547 array("answer" => array("text", $a_text)),
548 array("id" => array("integer", $a_id))
549 );
550 }

References ilObject\$db, and $ilDB.

◆ updateAnswerPositions()

ilObjPoll::updateAnswerPositions ( array  $a_pos)

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

565 : void
566 {
568
569 asort($a_pos);
570
571 $pos = 0;
572 foreach (array_keys($a_pos) as $id) {
573 $pos += 10;
574
575 $ilDB->update(
576 "il_poll_answer",
577 array("pos" => array("integer", $pos)),
578 array("id" => array("integer", $id))
579 );
580 }
581 }

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

Referenced by rebuildAnswerPositions(), and saveAnswers().

+ Here is the caller graph for this function:

◆ uploadImage()

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

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

422 : bool
423 {
424 if (!$this->id) {
425 return false;
426 }
427
428 $this->deleteImage();
429
430 // #10074
431 $name = (string) ($a_upload['name'] ?? '');
432 $tmp_name = (string) ($a_upload['tmp_name'] ?? '');
433 $clean_name = preg_replace("/[^a-zA-Z0-9\_\.\-]/", "", $name);
434
435 $path = self::initStorage($this->id);
436 $original = "org_" . $this->id . "_" . $clean_name;
437 $thumb = "thb_" . $this->id . "_" . $clean_name;
438 $processed = $this->id . "_" . $clean_name;
439
440 $success = false;
441 if (!$a_clone) {
442 $success = ilFileUtils::moveUploadedFile($tmp_name, $original, $path . $original);
443 } else {
444 $success = copy($tmp_name, $path . $original);
445 }
446 if ($success) {
447 chmod($path . $original, 0770);
448
449 // take quality 100 to avoid jpeg artefacts when uploading jpeg files
450 // taking only frame [0] to avoid problems with animated gifs
451 $original_file = ilShellUtil::escapeShellArg($path . $original);
452 $thumb_file = ilShellUtil::escapeShellArg($path . $thumb);
453 $processed_file = ilShellUtil::escapeShellArg($path . $processed);
454
455 // -geometry "100x100>" is escaped by -geometry "100x100>"
456 // re-replace ">" with ">"
457 $convert_100 = $original_file . "[0] -geometry \"100x100>\" -quality 100 PNG:" . $thumb_file;
458 $escaped_convert_100 = ilShellUtil::escapeShellCmd($convert_100);
459 $escaped_convert_100 = str_replace('-geometry "100x100>', '-geometry "100x100>', $escaped_convert_100);
460 ilShellUtil::execQuoted(PATH_TO_CONVERT, $escaped_convert_100);
461
462 $convert_300 = $original_file . "[0] -geometry \"" . self::getImageSize() . ">\" -quality 100 PNG:" . $processed_file;
463 $escaped_convert_300 = ilShellUtil::escapeShellCmd($convert_300);
464 $escaped_convert_300 = str_replace('-geometry "' . self::getImageSize() . '>"', '-geometry "' . self::getImageSize() . '>"', $escaped_convert_300);
465 ilShellUtil::execQuoted(PATH_TO_CONVERT, $escaped_convert_300);
466
467 $this->setImage($processed);
468 return true;
469 }
470 return false;
471 }
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static getImageSize()
static escapeShellArg(string $a_arg)
static escapeShellCmd(string $a_arg)
static execQuoted(string $cmd, ?string $args=null)
if($format !==null) $name
Definition: metadata.php:247

References $name, $path, deleteImage(), ilShellUtil\escapeShellArg(), ilShellUtil\escapeShellCmd(), ilShellUtil\execQuoted(), getImageSize(), initStorage(), ilFileUtils\moveUploadedFile(), and setImage().

+ Here is the call graph for this function:

Field Documentation

◆ $access_begin

int ilObjPoll::$access_begin = 0
protected

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

Referenced by getAccessBegin().

◆ $access_end

int ilObjPoll::$access_end = 0
protected

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

Referenced by getAccessEnd().

◆ $access_type

int ilObjPoll::$access_type = 0
protected

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

Referenced by getAccessType().

◆ $access_visibility

bool ilObjPoll::$access_visibility = false
protected

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

Referenced by getAccessVisibility().

◆ $image

string ilObjPoll::$image = ""
protected

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

Referenced by doCloneObject(), and getImage().

◆ $max_number_answers

int ilObjPoll::$max_number_answers = 1
protected

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

Referenced by getMaxNumberOfAnswers().

◆ $mode_non_anonymous

bool ilObjPoll::$mode_non_anonymous = false
protected

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

Referenced by getNonAnonymous().

◆ $notes

ILIAS Notes Service ilObjPoll::$notes
protected

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

◆ $period

bool ilObjPoll::$period = false
protected

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

Referenced by getVotingPeriod().

◆ $period_begin

int ilObjPoll::$period_begin = 0
protected

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

Referenced by getVotingPeriodBegin().

◆ $period_end

int ilObjPoll::$period_end = 0
protected

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

Referenced by getVotingPeriodEnd().

◆ $question

string ilObjPoll::$question = ""
protected

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

Referenced by getQuestion().

◆ $result_sort_by_votes

bool ilObjPoll::$result_sort_by_votes = false
protected

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

Referenced by getSortResultByVotes().

◆ $show_comments

bool ilObjPoll::$show_comments = false
protected

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

Referenced by getShowComments().

◆ $show_results_as

int ilObjPoll::$show_results_as = 1
protected

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

Referenced by getShowResultsAs().

◆ $view_results

int ilObjPoll::$view_results = 0
protected

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

Referenced by getViewResults().

◆ SHOW_RESULTS_AS_BARCHART

const ilObjPoll::SHOW_RESULTS_AS_BARCHART = 1

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

Referenced by ilObjPollGUI\initEditCustomForm().

◆ SHOW_RESULTS_AS_PIECHART

const ilObjPoll::SHOW_RESULTS_AS_PIECHART = 2

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

Referenced by ilPollBlockGUI\fillRow(), and ilObjPollGUI\initEditCustomForm().

◆ VIEW_RESULTS_AFTER_PERIOD

const ilObjPoll::VIEW_RESULTS_AFTER_PERIOD = 4

◆ 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: