本文整理汇总了PHP中ilRadioOption::setDisabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ilRadioOption::setDisabled方法的具体用法?PHP ilRadioOption::setDisabled怎么用?PHP ilRadioOption::setDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilRadioOption
的用法示例。
在下文中一共展示了ilRadioOption::setDisabled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initForm
public function initForm($a_as_multi_assignment = FALSE)
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('crs_loc_tst_assignment'));
$form->setFormAction($this->ctrl->getFormAction($this->getGUI()));
if ($a_as_multi_assignment) {
$form->addCommandButton('saveMultiTestAssignment', $this->lng->txt('save'));
} else {
$form->addCommandButton('saveTest', $this->lng->txt('save'));
}
switch ($this->getTestType()) {
case ilLOSettings::TYPE_TEST_INITIAL:
$form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl'));
break;
case ilLOSettings::TYPE_TEST_QUALIFIED:
$form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl'));
break;
}
$assignable = $this->getAssignableTests();
$cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'), 'mode');
$cr_mode->setRequired(true);
$cr_mode->setValue(self::TEST_NEW);
$new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'), self::TEST_NEW);
switch ($this->getTestType()) {
case ilLOSettings::TYPE_TEST_INITIAL:
$new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info"));
break;
case ilLOSettings::TYPE_TEST_QUALIFIED:
$new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info"));
break;
}
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setMaxLength(128);
$ti->setSize(40);
$ti->setRequired(true);
$new->addSubItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
$ta->setCols(40);
$ta->setRows(2);
$new->addSubItem($ta);
// Question assignment type
include_once './Modules/Test/classes/class.ilObjTest.php';
$this->lng->loadLanguageModule('assessment');
$qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'), 'qtype');
$qst->setRequired(true);
$random = new ilRadioOption($this->lng->txt('tst_question_set_type_random'), ilObjTest::QUESTION_SET_TYPE_RANDOM);
$qst->addOption($random);
$fixed = new ilRadioOption($this->lng->txt('tst_question_set_type_fixed'), ilObjTest::QUESTION_SET_TYPE_FIXED);
$qst->addOption($fixed);
$new->addSubItem($qst);
$cr_mode->addOption($new);
// assign existing
$existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'), self::TEST_ASSIGN);
switch ($this->getTestType()) {
case ilLOSettings::TYPE_TEST_INITIAL:
$existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info"));
break;
case ilLOSettings::TYPE_TEST_QUALIFIED:
$existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info"));
break;
}
if (!$assignable) {
$existing->setDisabled(true);
}
$cr_mode->addOption($existing);
$options = array();
$options[''] = $this->lng->txt('select_one');
foreach ((array) $assignable as $tst_ref_id) {
$tst_obj_id = ilObject::_lookupObjId($tst_ref_id);
$options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id);
}
$selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'), 'tst');
$selectable->setRequired(true);
$selectable->setOptions($options);
$existing->addSubItem($selectable);
$form->addItem($cr_mode);
if ($a_as_multi_assignment) {
include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
$assignments = ilLOTestAssignments::getInstance($this->getContainer()->getId());
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainer()->getId(), FALSE);
$options = array();
$options[''] = $this->lng->txt('select_one');
foreach ($objective_ids as $oid) {
$already_assigned_tst = $assignments->getTestByObjective($oid, $this->getTestType());
if (!$already_assigned_tst) {
$options[$oid] = ilCourseObjective::lookupObjectiveTitle($oid);
}
}
$objective = new ilSelectInputGUI($this->lng->txt('crs_objectives'), 'objective');
$objective->setRequired(TRUE);
$objective->setOptions($options);
$form->addItem($objective);
}
return $form;
}
示例2: createTeamObject
public function createTeamObject()
{
global $ilCtrl, $ilUser, $ilTabs, $lng, $tpl;
$this->checkPermission("read");
if ($this->ass->getDeadline() == 0 || mktime() < $this->ass->getDeadline()) {
$options = ilExAssignment::getAdoptableTeamAssignments($this->ass->getExerciseId(), $this->ass->getId(), $ilUser->getId());
if (sizeof($options)) {
$ilTabs->activateTab("content");
$this->addContentSubTabs("content");
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setTitle($lng->txt("exc_team_assignment_adopt_user"));
$form->setFormAction($ilCtrl->getFormAction($this, "createAdoptedTeam"));
$teams = new ilRadioGroupInputGUI($lng->txt("exc_assignment"), "ass_adpt");
$teams->setValue(-1);
$teams->addOption(new ilRadioOption($lng->txt("exc_team_assignment_adopt_none_user"), -1));
$current_map = ilExAssignment::getAssignmentTeamMap($this->ass->getId());
include_once "Services/User/classes/class.ilUserUtil.php";
foreach ($options as $id => $item) {
$members = array();
$free = false;
foreach ($item["user_team"] as $user_id) {
$members[$user_id] = ilUserUtil::getNamePresentation($user_id);
if (array_key_exists($user_id, $current_map)) {
$members[$user_id] .= " (" . $lng->txt("exc_team_assignment_adopt_already_assigned") . ")";
} else {
$free = true;
}
}
asort($members);
$members = implode("<br />", $members);
$option = new ilRadioOption($item["title"], $id);
$option->setInfo($members);
if (!$free) {
$option->setDisabled(true);
}
$teams->addOption($option);
}
$form->addItem($teams);
$form->addCommandButton("createAdoptedTeam", $lng->txt("save"));
$form->addCommandButton("showOverview", $lng->txt("cancel"));
$tpl->setContent($form->getHTML());
return;
}
$this->ass->getTeamId($ilUser->getId(), true);
ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
}
$ilCtrl->redirect($this, "showOverview");
}
示例3: getApacheAuthSettingsForm
public function getApacheAuthSettingsForm()
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('apache_settings'));
$chb_enabled = new ilCheckboxInputGUI($this->lng->txt('apache_enable_auth'), 'apache_enable_auth');
$form->addItem($chb_enabled);
$chb_local_create_account = new ilCheckboxInputGUI($this->lng->txt('apache_autocreate'), 'apache_local_autocreate');
$chb_enabled->addSubitem($chb_local_create_account);
global $rbacreview;
$roles = $rbacreview->getGlobalRolesArray();
$select = new ilSelectInputGUI($this->lng->txt('apache_default_role'), 'apache_default_role');
$roleOptions = array();
foreach ($roles as $role) {
$roleOptions[$role['obj_id']] = ilObject::_lookupTitle($role['obj_id']);
}
$select->setOptions($roleOptions);
$select->setValue(4);
$chb_local_create_account->addSubitem($select);
$chb_local = new ilCheckboxInputGUI($this->lng->txt('apache_enable_local'), 'apache_enable_local');
$form->addItem($chb_local);
$chb_ldap = new ilCheckboxInputGUI($this->lng->txt('apache_enable_ldap'), 'apache_enable_ldap');
$chb_ldap->setInfo($this->lng->txt('apache_ldap_hint_ldap_must_be_configured'));
$form->addItem($chb_ldap);
$txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_name'), 'apache_auth_indicator_name');
$txt->setRequired(true);
$form->addItem($txt);
$txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_value'), 'apache_auth_indicator_value');
$txt->setRequired(true);
$form->addItem($txt);
$chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_enable_override_login'), 'apache_auth_enable_override_login_page');
$form->addItem($chb);
$txt = new ilTextInputGUI($this->lng->txt('apache_auth_target_override_login'), 'apache_auth_target_override_login_page');
$txt->setRequired(true);
$chb->addSubItem($txt);
$chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_authenticate_on_login_page'), 'apache_auth_authenticate_on_login_page');
$form->addItem($chb);
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($this->lng->txt('apache_auth_username_config'));
$form->addItem($sec);
$rag = new ilRadioGroupInputGUI($this->lng->txt('apache_auth_username_config_type'), 'apache_auth_username_config_type');
$form->addItem($rag);
$rao = new ilRadioOption($this->lng->txt('apache_auth_username_direct_mapping'), 1);
$rag->addOption($rao);
$txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_direct_mapping_fieldname'), 'apache_auth_username_direct_mapping_fieldname');
//$txt->setRequired(true);
$rao->addSubItem($txt);
$rao = new ilRadioOption($this->lng->txt('apache_auth_username_extended_mapping'), 2);
$rao->setDisabled(true);
$rag->addOption($rao);
$rao = new ilRadioOption($this->lng->txt('apache_auth_username_by_function'), 3);
$rag->addOption($rao);
/* $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_by_function_functionname'), 'apache_auth_username_by_function_functionname');
$rao->addSubItem($txt);*/
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($this->lng->txt('apache_auth_security'));
$form->addItem($sec);
$txt = new ilTextAreaInputGUI($this->lng->txt('apache_auth_domains'), 'apache_auth_domains');
$txt->setInfo($this->lng->txt('apache_auth_domains_description'));
$form->addItem($txt);
$form->addCommandButton('saveApacheSettings', $this->lng->txt('save'));
$form->addCommandButton('cancel', $this->lng->txt('cancel'));
return $form;
}
示例4: initFormRoleAssignments
/**
* Init form table for new role assignments
*
* @param string mode edit | create
* @param object object of ilLDAPRoleAsssignmentRule
* @access protected
*
*/
protected function initFormRoleAssignments($a_mode)
{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
include_once 'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
switch ($a_mode) {
case 'edit':
$this->form->setTitle($this->lng->txt('ldap_edit_role_ass_rule'));
$this->form->addCommandButton('updateRoleAssignment', $this->lng->txt('save'));
$this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel'));
break;
case 'create':
$this->form->setTitle($this->lng->txt('ldap_add_role_ass_rule'));
$this->form->addCommandButton('addRoleAssignment', $this->lng->txt('ldap_btn_add_role_ass'));
$this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel'));
break;
}
// Role Selection
$role = new ilRadioGroupInputGUI($this->lng->txt('ldap_ilias_role'), 'role_name');
$role->setRequired(true);
$global = new ilRadioOption($this->lng->txt('ldap_global_role'), 0);
$role->addOption($global);
$role_select = new ilSelectInputGUI('', 'role_id');
$role_select->setOptions($this->prepareGlobalRoleSelection());
$global->addSubItem($role_select);
$local = new ilRadioOption($this->lng->txt('ldap_local_role'), 1);
$role->addOption($local);
include_once './Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php';
$role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject');
$role_search->setSize(40);
$local->addSubItem($role_search);
$role->setInfo($this->lng->txt('ldap_role_name_info'));
$this->form->addItem($role);
// Update options
$update = new ilNonEditableValueGUI($this->lng->txt('ldap_update_roles'), 'update_roles');
$update->setValue($this->lng->txt('ldap_check_role_assignment'));
$add = new ilCheckboxInputGUI('', 'add_missing');
$add->setOptionTitle($this->lng->txt('ldap_add_missing'));
$update->addSubItem($add);
$remove = new ilCheckboxInputGUI('', 'remove_deprecated');
$remove->setOptionTitle($this->lng->txt('ldap_remove_deprecated'));
$update->addSubItem($remove);
$this->form->addItem($update);
// Assignment Type
$group = new ilRadioGroupInputGUI($this->lng->txt('ldap_assignment_type'), 'type');
#$group->setValue($current_rule->getType());
$group->setRequired(true);
// Option by group
$radio_group = new ilRadioOption($this->lng->txt('ldap_role_by_group'), ilLDAPRoleAssignmentRule::TYPE_GROUP);
$dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'), 'dn');
#$dn->setValue($current_rule->getDN());
$dn->setSize(32);
$dn->setMaxLength(512);
$dn->setInfo($this->lng->txt('ldap_role_grp_dn_info'));
$radio_group->addSubItem($dn);
$at = new ilTextInputGUI($this->lng->txt('ldap_role_grp_at'), 'at');
#$at->setValue($current_rule->getMemberAttribute());
$at->setSize(16);
$at->setMaxLength(128);
$radio_group->addSubItem($at);
$isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_role_grp_isdn'), 'isdn');
#$isdn->setChecked($current_rule->isMemberAttributeDN());
$isdn->setInfo($this->lng->txt('ldap_group_member_info'));
$radio_group->addSubItem($isdn);
$radio_group->setInfo($this->lng->txt('ldap_role_grp_info'));
$group->addOption($radio_group);
// Option by Attribute
$radio_attribute = new ilRadioOption($this->lng->txt('ldap_role_by_attribute'), ilLDAPRoleAssignmentRule::TYPE_ATTRIBUTE);
$name = new ilTextInputGUI($this->lng->txt('ldap_role_at_name'), 'name');
#$name->setValue($current_rule->getAttributeName());
$name->setSize(32);
$name->setMaxLength(128);
#$name->setInfo($this->lng->txt('ldap_role_at_name_info'));
$radio_attribute->addSubItem($name);
// Radio Attribute
$val = new ilTextInputGUI($this->lng->txt('ldap_role_at_value'), 'value');
#$val->setValue($current_rule->getAttributeValue());
$val->setSize(32);
$val->setMaxLength(128);
#$val->setInfo($this->lng->txt('ldap_role_at_value_info'));
$radio_attribute->addSubItem($val);
$radio_attribute->setInfo($this->lng->txt('ldap_role_at_info'));
$group->addOption($radio_attribute);
// Option by Plugin
$pl_active = (bool) $this->hasActiveRoleAssignmentPlugins();
$pl = new ilRadioOption($this->lng->txt('ldap_plugin'), 3);
$pl->setInfo($this->lng->txt('ldap_plugin_info'));
$pl->setDisabled(!$pl_active);
$id = new ilNumberInputGUI($this->lng->txt('ldap_plugin_id'), 'plugin_id');
$id->setDisabled(!$pl_active);
$id->setSize(3);
//.........这里部分代码省略.........
示例5: displayCache
public function displayCache()
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
require_once 'Services/GlobalCache/classes/class.ilGlobalCache.php';
$this->checkDisplayMode('setup_cache');
/**
* @var $ini ilIniFile
*/
$ini = $this->setup->getClient()->ini;
$cache_form = new ilPropertyFormGUI();
$cache_form->setTitle($this->lng->txt('global_cache_configuration'));
$cache_form->addCommandButton('saveCache', $this->lng->txt('save'));
$cache_form->setFormAction('setup.php?cmd=gateway');
$activate_global_cache = 'activate_global_cache';
$global_cache_service_type = 'global_cache_service_type';
$activate_cache = new ilCheckboxInputGUI($this->lng->txt($activate_global_cache), $activate_global_cache);
$activate_cache->setChecked($ini->readVariable('cache', $activate_global_cache));
$service_type = new ilRadioGroupInputGUI($this->lng->txt($global_cache_service_type), $global_cache_service_type);
$some_inactive = false;
$message = '';
foreach (ilGlobalCache::getAllTypes() as $type) {
$option = new ilRadioOption($this->lng->txt($global_cache_service_type . '_' . $type->getServiceType()), $type->getServiceType());
$option->setInfo($this->lng->txt('global_cache_install_info_' . $type->getServiceType()));
if (!$type->isCacheServiceInstallable()) {
$option->setDisabled(true);
$message .= $this->lng->txt($global_cache_service_type . '_' . $type->getServiceType()) . ': ' . $type->getInstallationFailureReason() . '; ';
$some_inactive = true;
}
$service_type->addOption($option);
}
if ($some_inactive) {
$service_type->setAlert($message);
ilUtil::sendInfo($this->lng->txt('global_cache_supported_services'));
}
$service_type->setValue($ini->readVariable('cache', $global_cache_service_type));
$activate_cache->addSubItem($service_type);
$cache_form->addItem($activate_cache);
$this->tpl->setVariable('SETUP_CONTENT', $cache_form->getHTML());
}
示例6: initFormRoleAssignment
protected function initFormRoleAssignment($a_mode = 'default')
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel'));
$this->form->setTitle($this->lng->txt('shib_role_ass_table'));
if ($a_mode == 'default') {
$this->form->setTitle($this->lng->txt('shib_role_ass_table'));
$this->form->addCommandButton('addRoleAssignmentRule', $this->lng->txt('shib_new_rule'));
$this->form->addCommandButton('settings', $this->lng->txt('cancel'));
} else {
$this->form->setTitle($this->lng->txt('shib_update_role_ass_table'));
$this->form->addCommandButton('updateRoleAssignmentRule', $this->lng->txt('save'));
$this->form->addCommandButton('roleAssignment', $this->lng->txt('cancel'));
}
// Role selection
$role = new ilRadioGroupInputGUI($this->lng->txt('shib_role_name'), 'role_name');
$role->setRequired(true);
$global = new ilRadioOption($this->lng->txt('shib_global_role'), 0);
$role->addOption($global);
$role_select = new ilSelectInputGUI('', 'role_id');
$role_select->setOptions($this->prepareRoleSelect());
$global->addSubItem($role_select);
$local = new ilRadioOption($this->lng->txt('shib_local_role'), 1);
$role->addOption($local);
include_once './Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php';
$role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject');
$role_search->setSize(40);
$local->addSubItem($role_search);
include_once './Services/AccessControl/classes/class.ilRoleAutoComplete.php';
$role->setInfo($this->lng->txt('shib_role_name_info'));
$this->form->addItem($role);
// Update options
$update = new ilNonEditableValueGUI($this->lng->txt('shib_update_roles'), 'update_roles');
$update->setValue($this->lng->txt('shib_check_role_assignment'));
$add = new ilCheckboxInputGUI('', 'add_missing');
$add->setOptionTitle($this->lng->txt('shib_add_missing'));
$add->setValue(1);
$update->addSubItem($add);
$remove = new ilCheckboxInputGUI('', 'remove_deprecated');
$remove->setOptionTitle($this->lng->txt('shib_remove_deprecated'));
$remove->setValue(1);
$update->addSubItem($remove);
$this->form->addItem($update);
// Assignment type
$kind = new ilRadioGroupInputGUI($this->lng->txt('shib_assignment_type'), 'kind');
$kind->setValue(1);
$kind->setRequired(true);
$attr = new ilRadioOption($this->lng->txt('shib_attribute'), 1);
$attr->setInfo($this->lng->txt('shib_attr_info'));
$name = new ilTextInputGUI($this->lng->txt('shib_attribute_name'), 'attr_name');
$name->setSize(32);
$attr->addSubItem($name);
$value = new ilTextInputGUI($this->lng->txt('shib_attribute_value'), 'attr_value');
$value->setSize(32);
$attr->addSubItem($value);
$kind->addOption($attr);
$pl_active = (bool) $this->hasActiveRoleAssignmentPlugins();
$pl = new ilRadioOption($this->lng->txt('shib_plugin'), 2);
$pl->setInfo($this->lng->txt('shib_plugin_info'));
$pl->setDisabled(!$pl_active);
$id = new ilNumberInputGUI($this->lng->txt('shib_plugin_id'), 'plugin_id');
$id->setDisabled(!$pl_active);
$id->setSize(3);
$id->setMaxLength(3);
$id->setMaxValue(999);
$id->setMinValue(1);
$pl->addSubItem($id);
$kind->addOption($pl);
$this->form->addItem($kind);
}
示例7: initTestForm
/**
* Show test config form
* @return \ilPropertyFormGUI
*/
protected function initTestForm()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton('saveTest', $this->lng->txt('save'));
switch ($this->getTestType()) {
case self::TEST_TYPE_IT:
$form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl'));
break;
case self::TEST_TYPE_QT:
$form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl'));
break;
}
$assignable = $this->getAssignableTests();
$cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'), 'mode');
$cr_mode->setRequired(true);
$cr_mode->setValue(self::TEST_NEW);
$new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'), self::TEST_NEW);
switch ($this->getTestType()) {
case ilLOSettings::TYPE_TEST_INITIAL:
$new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info"));
break;
case ilLOSettings::TYPE_TEST_QUALIFIED:
$new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info"));
break;
}
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setValue(ilObject::_lookupTitle(ilObject::_lookupObjId($this->getSettings()->getTestByType($this->getTestType()))));
$ti->setMaxLength(128);
$ti->setSize(40);
$ti->setRequired(true);
$new->addSubItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
$ta->setValue(ilObject::_lookupDescription(ilObject::_lookupObjId($this->getSettings()->getTestByType($this->getTestType()))));
$ta->setCols(40);
$ta->setRows(2);
$new->addSubItem($ta);
// Question assignment type
include_once './Modules/Test/classes/class.ilObjTest.php';
$this->lng->loadLanguageModule('assessment');
$qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'), 'qtype');
$qst->setRequired(true);
$qst->setValue($this->getSettings()->isRandomTestType($this->getTestType()) ? ilObjTest::QUESTION_SET_TYPE_RANDOM : ilObjTest::QUESTION_SET_TYPE_FIXED);
$random = new ilRadioOption($this->lng->txt('tst_question_set_type_random'), ilObjTest::QUESTION_SET_TYPE_RANDOM);
$qst->addOption($random);
$fixed = new ilRadioOption($this->lng->txt('tst_question_set_type_fixed'), ilObjTest::QUESTION_SET_TYPE_FIXED);
$qst->addOption($fixed);
$new->addSubItem($qst);
$cr_mode->addOption($new);
// assign existing
$existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'), self::TEST_ASSIGN);
switch ($this->getTestType()) {
case ilLOSettings::TYPE_TEST_INITIAL:
$existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info"));
break;
case ilLOSettings::TYPE_TEST_QUALIFIED:
$existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info"));
break;
}
if (!$assignable) {
$existing->setDisabled(true);
}
$cr_mode->addOption($existing);
$options = array();
$options[0] = $this->lng->txt('select_one');
foreach ((array) $assignable as $tst_ref_id) {
$tst_obj_id = ilObject::_lookupObjId($tst_ref_id);
$options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id);
}
$selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'), 'tst');
$selectable->setRequired(true);
$selectable->setOptions($options);
$existing->addSubItem($selectable);
$form->addItem($cr_mode);
return $form;
}