ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilExAssTypeTextGUI 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 ilExAssTypeTextGUI:
+ Collaboration diagram for ilExAssTypeTextGUI:

Public Member Functions

 addEditFormCustomProperties (ilPropertyFormGUI $form)
 Add custom form properties to edit form. More...
 
 importFormToAssignment (ilExAssignment $ass, ilPropertyFormGUI $form)
 Get values from form and put them into assignment. More...
 
 getFormValuesArray (ilExAssignment $ass)
 Get form values array from assignment.
Returns
array
More...
 
 getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 Add overview content of submission to info screen object. More...
 
 buildSubmissionPropertiesAndActions (\ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI $builder)
 
- Public Member Functions inherited from ilExAssignmentTypeGUIInterface
 setSubmission (ilExSubmission $a_submission)
 Set submission. More...
 
 setExercise (ilObjExercise $a_exercise)
 Set exercise. More...
 

Protected Attributes

 $lng
 
int $requested_min_char_limit = 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 Text type gui implementations

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

Definition at line 24 of file class.ilExAssTypeTextGUI.php.

Member Function Documentation

◆ addEditFormCustomProperties()

ilExAssTypeTextGUI::addEditFormCustomProperties ( ilPropertyFormGUI  $form)

Add custom form properties to edit form.

Implements ilExAssignmentTypeGUIInterface.

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

References $lng, and ilPropertyFormGUI\addItem().

50  : void
51  {
52  $lng = $this->lng;
53 
54  $rb_limit_chars = new ilCheckboxInputGUI($lng->txt("exc_limit_characters"), "limit_characters");
55 
56  $min_char_limit = new ilNumberInputGUI($lng->txt("exc_min_char_limit"), "min_char_limit");
57  $min_char_limit->allowDecimals(false);
58  $min_char_limit->setMinValue(0);
59  $min_char_limit->setSize(3);
60 
61  $max_char_limit = new ilNumberInputGUI($lng->txt("exc_max_char_limit"), "max_char_limit");
62  $max_char_limit->allowDecimals(false);
63  $max_char_limit->setMinValue($this->requested_min_char_limit + 1);
64 
65  $max_char_limit->setSize(3);
66 
67  $rb_limit_chars->addSubItem($min_char_limit);
68  $rb_limit_chars->addSubItem($max_char_limit);
69 
70  $form->addItem($rb_limit_chars);
71  }
+ Here is the call graph for this function:

◆ buildSubmissionPropertiesAndActions()

ilExAssTypeTextGUI::buildSubmissionPropertiesAndActions ( \ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI  $builder)

Implements ilExAssignmentTypeGUIInterface.

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

References $DIC, Vendor\Package\$f, $lng, $service, $url, getSubmission(), and ILIAS\Repository\lng().

107  : void
108  {
109  global $DIC;
110 
111  $service = $DIC->exercise()->internal();
112  $gui = $service->gui();
113  $f = $gui->ui()->factory();
114  $lng = $DIC->language();
115  $ilCtrl = $DIC->ctrl();
116  $submission = $this->getSubmission();
117 
118  if ($submission->canSubmit()) {
119  $url = $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTextGUI"), "editAssignmentText");
120  $button = $f->button()->primary(
121  $this->lng->txt("exc_text_assignment_edit"),
122  $url
123  );
124  $builder->setMainAction(
125  $builder::SEC_SUBMISSION,
126  $button
127  );
128  $builder->addView(
129  "submission",
130  $lng->txt("exc_submission"),
131  $url
132  );
133  } else {
134  if ($submission->hasSubmitted()) {
135  $url = $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
136  "ilExSubmissionGUI",
137  "ilExSubmissionTextGUI"
138  ), "showAssignmentText");
139  $link = $f->link()->standard(
140  $this->lng->txt("exc_text_assignment_show"),
141  $url
142  );
143  $builder->addAction(
144  $builder::SEC_SUBMISSION,
145  $link
146  );
147  $builder->addView(
148  "submission",
149  $lng->txt("exc_submission"),
150  $url
151  );
152  }
153  }
154 
155  //$a_info->addProperty($lng->txt("exc_files_returned_text"), $files_str);
156 
157  }
getSubmission()
Get submission.
global $DIC
Definition: feed.php:28
$url
Definition: ltiregstart.php:35
$service
Definition: ltiservices.php:43
+ Here is the call graph for this function:

◆ getFormValuesArray()

ilExAssTypeTextGUI::getFormValuesArray ( ilExAssignment  $ass)

Get form values array from assignment.

Returns
array

Implements ilExAssignmentTypeGUIInterface.

Definition at line 88 of file class.ilExAssTypeTextGUI.php.

References ilExAssignment\getMaxCharLimit(), and ilExAssignment\getMinCharLimit().

88  : array
89  {
90  $values = [];
91  if ($ass->getMinCharLimit() !== 0) {
92  $values['limit_characters'] = 1;
93  $values['min_char_limit'] = $ass->getMinCharLimit();
94  }
95  if ($ass->getMaxCharLimit() !== 0) {
96  $values['limit_characters'] = 1;
97  $values['max_char_limit'] = $ass->getMaxCharLimit();
98  }
99 
100  return $values;
101  }
+ Here is the call graph for this function:

◆ getOverviewContent()

ilExAssTypeTextGUI::getOverviewContent ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)

Add overview content of submission to info screen object.

Implements ilExAssignmentTypeGUIInterface.

Definition at line 103 of file class.ilExAssTypeTextGUI.php.

103  : void
104  {
105  }

◆ importFormToAssignment()

ilExAssTypeTextGUI::importFormToAssignment ( ilExAssignment  $ass,
ilPropertyFormGUI  $form 
)

Get values from form and put them into assignment.

Implements ilExAssignmentTypeGUIInterface.

Definition at line 73 of file class.ilExAssTypeTextGUI.php.

References ilPropertyFormGUI\getInput(), ilExAssignment\setMaxCharLimit(), and ilExAssignment\setMinCharLimit().

73  : void
74  {
75  $ass->setMaxCharLimit(0);
76  $ass->setMinCharLimit(0);
77  if ($form->getInput("limit_characters") && $form->getInput("max_char_limit")) {
78  $ass->setMaxCharLimit($form->getInput("max_char_limit"));
79  }
80  if ($form->getInput("limit_characters") && $form->getInput("min_char_limit")) {
81  $ass->setMinCharLimit($form->getInput("min_char_limit"));
82  }
83  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilExAssTypeTextGUI::$lng
protected

◆ $requested_min_char_limit

int ilExAssTypeTextGUI::$requested_min_char_limit = 0
protected

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


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