4 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
36 $this->container = $a_container_obj;
69 public function initForm($a_as_multi_assignment =
false)
71 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
73 $form->setTitle($this->lng->txt(
'crs_loc_tst_assignment'));
74 $form->setFormAction($this->ctrl->getFormAction($this->getGUI()));
76 if ($a_as_multi_assignment) {
77 $form->addCommandButton(
'saveMultiTestAssignment', $this->lng->txt(
'save'));
79 $form->addCommandButton(
'saveTest', $this->lng->txt(
'save'));
84 $form->setTitle($this->lng->txt(
'crs_loc_settings_itest_tbl'));
88 $form->setTitle($this->lng->txt(
'crs_loc_settings_qtest_tbl'));
97 $cr_mode->setValue(self::TEST_NEW);
99 $new =
new ilRadioOption($this->lng->txt(
'crs_loc_form_tst_new'), self::TEST_NEW);
103 $new->setInfo($this->lng->txt(
"crs_loc_form_tst_new_initial_info"));
107 $new->setInfo($this->lng->txt(
"crs_loc_form_tst_new_qualified_info"));
115 $ti->setRequired(
true);
116 $new->addSubItem($ti);
122 $new->addSubItem($ta);
125 include_once
'./Modules/Test/classes/class.ilObjTest.php';
126 $this->lng->loadLanguageModule(
'assessment');
131 $this->lng->txt(
'tst_question_set_type_random'),
134 $qst->addOption($random);
137 $this->lng->txt(
'tst_question_set_type_fixed'),
140 $qst->addOption($fixed);
141 $new->addSubItem($qst);
142 $cr_mode->addOption(
$new);
145 $existing =
new ilRadioOption($this->lng->txt(
'crs_loc_form_assign'), self::TEST_ASSIGN);
149 $existing->setInfo($this->lng->txt(
"crs_loc_form_assign_initial_info"));
153 $existing->setInfo($this->lng->txt(
"crs_loc_form_assign_qualified_info"));
158 $existing->setDisabled(
true);
160 $cr_mode->addOption($existing);
163 $options[
''] = $this->lng->txt(
'select_one');
164 foreach ((
array) $assignable as $tst_ref_id) {
168 $selectable =
new ilSelectInputGUI($this->lng->txt(
'crs_loc_form_available_tsts'),
'tst');
171 $existing->addSubItem($selectable);
173 $form->addItem($cr_mode);
176 if ($a_as_multi_assignment) {
177 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
180 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
184 $options[
''] = $this->lng->txt(
'select_one');
185 foreach ($objective_ids as $oid) {
186 $already_assigned_tst = $assignments->getTestByObjective($oid, $this->
getTestType());
187 if (!$already_assigned_tst) {
192 $objective =
new ilSelectInputGUI($this->lng->txt(
'crs_objectives'),
'objective');
195 $form->addItem($objective);
207 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
211 foreach (
$GLOBALS[
'tree']->getChildsByType($this->
getContainer()->getRefId(),
'tst') as $tree_node) {
212 if (!in_array($tree_node[
'child'], $assignments->getTests())) {
213 $tests[] = $tree_node[
'child'];
static getInstanceByObjId($a_obj_id)
get singleton instance
This class represents an option in a radio group.
static getInstance($a_container_id)
Get instance by container id.
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getObjectiveIds($course_id, $a_activated_only=false)
static _lookupTitle($a_id)
lookup object title
if(isset($_POST['submit'])) $form
static _lookupObjId($a_id)
This class represents a text property in a property form.
setCols($a_cols)
Set Cols.
setMaxLength($a_maxlength)
Set Max Length.
Create styles array
The data for the language used.
This class represents a text area property in a property form.
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
const TYPE_TEST_QUALIFIED
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options