ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExcCriteriaBool 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 ilExcCriteriaBool:
+ Collaboration diagram for ilExcCriteriaBool:

Public Member Functions

 getType ()
 
 addToPeerReviewForm ($a_value=null)
 
 importFromPeerReviewForm ()
 
 hasValue ($a_value)
 
 getHTML ($a_value)
 
- Public Member Functions inherited from ilExcCriteria
 __construct ()
 
 getTranslatedType ()
 
 getId ()
 
 getType ()
 
 setParent (?int $a_value)
 
 getParent ()
 
 setTitle (?string $a_value)
 
 getTitle ()
 
 setDescription (?string $a_value)
 
 getDescription ()
 
 setRequired (bool $a_value)
 
 isRequired ()
 
 setPosition (int $a_value)
 
 getPosition ()
 
 importDefinition (string $a_def, string $a_def_json)
 
 save ()
 
 update ()
 
 delete ()
 
 cloneObject (int $a_target_parent_id)
 
 initCustomForm (ilPropertyFormGUI $a_form)
 
 exportCustomForm (ilPropertyFormGUI $a_form)
 
 importCustomForm (ilPropertyFormGUI $a_form)
 
 setPeerReviewContext (ilExAssignment $a_ass, int $a_giver_id, int $a_peer_id, ?ilPropertyFormGUI $a_form=null)
 
 addToPeerReviewForm ($a_value=null)
 
 importFromPeerReviewForm ()
 
 updateFromAjax ()
 
 validate ($a_value)
 
 hasValue ($a_value)
 
 getHTML ($a_value)
 
 resetReview ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExcCriteria
static getInstanceById (int $a_id)
 
static getInstancesByParentId (int $a_parent_id)
 
static getTypesMap ()
 
static getInstanceByType (string $a_type)
 
static deleteByParent (int $a_parent_id)
 
- Protected Member Functions inherited from ilExcCriteria
 setId (?int $a_id)
 
 setDefinition (?array $a_value=null)
 
 getDefinition ()
 
 importFromDB (array $a_row)
 
 getDBProperties ()
 
 getLastPosition ()
 
- Protected Attributes inherited from ilExcCriteria
ILIAS Exercise InternalGUIService $gui
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilDBInterface $db
 
int $id = null
 
int $parent = null
 
string $title = ""
 
string $desc = ""
 
bool $required = false
 
int $pos = 0
 
array $def = null
 
ilPropertyFormGUI $form = null
 
ilExAssignment $ass
 
int $giver_id = 0
 
int $peer_id = 0
 

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 ilExcCriteriaBool

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilExcCriteriaBool.php.

Member Function Documentation

◆ addToPeerReviewForm()

ilExcCriteriaBool::addToPeerReviewForm (   $a_value = null)

Reimplemented from ilExcCriteria.

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

35 : void
36 {
38
39 if (!$this->isRequired()) {
40 $input = new ilCheckboxInputGUI($this->getTitle(), "prccc_bool_" . $this->getId());
41 $input->setInfo($this->getDescription());
42 $input->setRequired($this->isRequired());
43 $input->setChecked($a_value > 0);
44 } else {
45 $input = new ilSelectInputGUI($this->getTitle(), "prccc_bool_" . $this->getId());
46 $input->setInfo($this->getDescription());
47 $input->setRequired($this->isRequired());
48 $input->setValue($a_value);
49 $options = array();
50 if (!$a_value) {
51 $options[""] = $lng->txt("please_select");
52 }
53 $options[1] = $lng->txt("yes");
54 $options[-1] = $lng->txt("no");
55 $input->setOptions($options);
56 }
57 $this->form->addItem($input);
58 }
This class represents a checkbox property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a selection list property in a property form.
form( $class_path, string $cmd, string $submit_caption="")

References ilExcCriteria\$lng, ILIAS\Repository\form(), ilExcCriteria\getDescription(), ilExcCriteria\getId(), ilExcCriteria\getTitle(), ilExcCriteria\isRequired(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getHTML()

ilExcCriteriaBool::getHTML (   $a_value)

Reimplemented from ilExcCriteria.

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

74 : string
75 {
77
78 $caption = "";
79 // see #35694, a non required un-checked checkbox is treated as a "no"
80 if (!$this->isRequired()) {
81 $caption = $lng->txt("no");
82 }
83 if ($this->isRequired() && $a_value < 0) {
84 $caption = $lng->txt("no");
85 } elseif ($a_value == 1) {
86 $caption = $lng->txt("yes");
87 }
88 return $caption;
89 }

References ilExcCriteria\$lng, ilExcCriteria\isRequired(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getType()

ilExcCriteriaBool::getType ( )

Reimplemented from ilExcCriteria.

Definition at line 27 of file class.ilExcCriteriaBool.php.

27 : string
28 {
29 return "bool";
30 }

◆ hasValue()

ilExcCriteriaBool::hasValue (   $a_value)

Reimplemented from ilExcCriteria.

Definition at line 65 of file class.ilExcCriteriaBool.php.

65 : int
66 {
67 // see #35695, a non required un-checked checkbox is treated as a value
68 if (!is_null($a_value) && !$this->isRequired()) {
69 return 1;
70 }
71 return (int) $a_value;
72 }

References ilExcCriteria\isRequired().

+ Here is the call graph for this function:

◆ importFromPeerReviewForm()

ilExcCriteriaBool::importFromPeerReviewForm ( )

Reimplemented from ilExcCriteria.

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

60 : int
61 {
62 return (int) $this->form->getInput("prccc_bool_" . $this->getId());
63 }

References ILIAS\Repository\form(), and ilExcCriteria\getId().

+ Here is the call graph for this function:

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