3 declare(strict_types=0);
46 $this->
lng = $DIC->language();
47 $this->
ctrl = $DIC->ctrl();
48 $this->tree = $DIC->repositoryTree();
50 $this->container = $a_container_obj;
52 $this->type = $a_type;
78 $form->setTitle($this->
lng->txt(
'crs_loc_tst_assignment'));
79 $form->setFormAction($this->
ctrl->getFormAction($this->getGUI()));
81 if ($a_as_multi_assignment) {
82 $form->addCommandButton(
'saveMultiTestAssignment', $this->
lng->txt(
'save'));
84 $form->addCommandButton(
'saveTest', $this->
lng->txt(
'save'));
89 $form->setTitle($this->
lng->txt(
'crs_loc_settings_itest_tbl'));
93 $form->setTitle($this->
lng->txt(
'crs_loc_settings_qtest_tbl'));
102 $cr_mode->setValue((
string) self::TEST_NEW);
104 $new =
new ilRadioOption($this->
lng->txt(
'crs_loc_form_tst_new'), (string) self::TEST_NEW);
108 $new->setInfo($this->
lng->txt(
"crs_loc_form_tst_new_initial_info"));
112 $new->setInfo($this->
lng->txt(
"crs_loc_form_tst_new_qualified_info"));
118 $ti->setMaxLength(128);
120 $ti->setRequired(
true);
121 $new->addSubItem($ti);
127 $new->addSubItem($ta);
130 $this->
lng->loadLanguageModule(
'assessment');
135 $this->
lng->txt(
'tst_question_set_type_random'),
138 $qst->addOption($random);
141 $this->
lng->txt(
'tst_question_set_type_fixed'),
144 $qst->addOption($fixed);
146 $cr_mode->addOption($new);
149 $existing =
new ilRadioOption($this->
lng->txt(
'crs_loc_form_assign'), (string) self::TEST_ASSIGN);
153 $existing->setInfo($this->
lng->txt(
"crs_loc_form_assign_initial_info"));
157 $existing->setInfo($this->
lng->txt(
"crs_loc_form_assign_qualified_info"));
161 if ($assignable === []) {
162 $existing->setDisabled(
true);
164 $cr_mode->addOption($existing);
167 $options[
''] = $this->
lng->txt(
'select_one');
168 foreach ($assignable as $tst_ref_id) {
173 $selectable->setRequired(
true);
174 $selectable->setOptions($options);
175 $existing->addSubItem($selectable);
176 $form->addItem($cr_mode);
177 if ($a_as_multi_assignment) {
183 $options[
''] = $this->
lng->txt(
'select_one');
184 foreach ($objective_ids as $oid) {
185 $already_assigned_tst = $assignments->getTestByObjective($oid, $this->
getTestType());
186 if (!$already_assigned_tst) {
192 $objective->setRequired(
true);
193 $objective->setOptions($options);
194 $form->addItem($objective);
204 foreach ($this->tree->getChildsByType($this->getContainer()->getRefId(),
'tst') as $tree_node) {
205 if (!in_array($tree_node[
'child'], $assignments->getTests())) {
206 $tests[] = $tree_node[
'child'];
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const QUESTION_SET_TYPE_RANDOM
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
static getInstanceByObjId(int $a_obj_id)
This class represents a text area property in a property form.
const QUESTION_SET_TYPE_FIXED
static getInstance(int $a_container_id)
const TYPE_TEST_QUALIFIED