本文整理汇总了PHP中ilObjTest::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::setDescription方法的具体用法?PHP ilObjTest::setDescription怎么用?PHP ilObjTest::setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::setDescription方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: performSaveForm
private function performSaveForm(ilPropertyFormGUI $form)
{
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj =& new ilMD($this->testOBJ->getId(), 0, "tst");
$md_section = $md_obj->getGeneral();
// title
$md_section->setTitle(ilUtil::stripSlashes($form->getItemByPostVar('title')->getValue()));
$md_section->update();
// Description
$md_desc_ids = $md_section->getDescriptionIds();
if ($md_desc_ids) {
$md_desc = $md_section->getDescription(array_pop($md_desc_ids));
$md_desc->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
$md_desc->update();
} else {
$md_desc = $md_section->addDescription();
$md_desc->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
$md_desc->save();
}
$this->testOBJ->setTitle(ilUtil::stripSlashes($form->getItemByPostVar('title')->getValue()));
$this->testOBJ->setDescription(ilUtil::stripSlashes($form->getItemByPostVar('description')->getValue()));
$this->testOBJ->update();
// pool usage setting
if ($form->getItemByPostVar('use_pool') instanceof ilFormPropertyGUI) {
$this->testOBJ->setPoolUsage($form->getItemByPostVar('use_pool')->getChecked());
}
// Archiving
$this->testOBJ->setEnableArchiving($form->getItemByPostVar('enable_archiving')->getChecked());
// Examview
$this->testOBJ->setEnableExamview($form->getItemByPostVar('enable_examview')->getChecked());
$this->testOBJ->setShowExamviewHtml($form->getItemByPostVar('show_examview_html')->getChecked());
$this->testOBJ->setShowExamviewPdf($form->getItemByPostVar('show_examview_pdf')->getChecked());
// online status
$this->testOBJ->setOnline($form->getItemByPostVar('online')->getChecked());
// activation
if ($form->getItemByPostVar('activation_type')->getValue() == ilObjectActivation::TIMINGS_ACTIVATION) {
$this->testOBJ->setActivationLimited(true);
$this->testOBJ->setActivationVisibility($form->getItemByPostVar('activation_visibility')->getChecked());
$period = $form->getItemByPostVar("access_period");
$this->testOBJ->setActivationStartingTime($period->getStart()->get(IL_CAL_UNIX));
$this->testOBJ->setActivationEndingTime($period->getEnd()->get(IL_CAL_UNIX));
} else {
$this->testOBJ->setActivationLimited(false);
}
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$this->testOBJ->setIntroduction($form->getItemByPostVar('introduction')->getValue(), false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
$this->testOBJ->setShowInfo($form->getItemByPostVar('showinfo')->getChecked());
$this->testOBJ->setFinalStatement($form->getItemByPostVar('finalstatement')->getValue(), false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
$this->testOBJ->setShowFinalStatement($form->getItemByPostVar('showfinalstatement')->getChecked());
if ($form->getItemByPostVar('chb_postpone') instanceof ilFormPropertyGUI) {
$this->testOBJ->setSequenceSettings($form->getItemByPostVar('chb_postpone')->getChecked());
}
$this->testOBJ->setShuffleQuestions($form->getItemByPostVar('chb_shuffle_questions')->getChecked());
$this->testOBJ->setListOfQuestions($form->getItemByPostVar('list_of_questions')->getChecked());
$listOfQuestionsOptions = $form->getItemByPostVar('list_of_questions_options')->getValue();
if (is_array($listOfQuestionsOptions)) {
$this->testOBJ->setListOfQuestionsStart(in_array('chb_list_of_questions_start', $listOfQuestionsOptions));
$this->testOBJ->setListOfQuestionsEnd(in_array('chb_list_of_questions_end', $listOfQuestionsOptions));
$this->testOBJ->setListOfQuestionsDescription(in_array('chb_list_of_questions_with_description', $listOfQuestionsOptions));
} else {
$this->testOBJ->setListOfQuestionsStart(0);
$this->testOBJ->setListOfQuestionsEnd(0);
$this->testOBJ->setListOfQuestionsDescription(0);
}
if ($form->getItemByPostVar('mailnotification') instanceof ilFormPropertyGUI) {
$this->testOBJ->setMailNotification($form->getItemByPostVar('mailnotification')->getValue());
}
if ($form->getItemByPostVar('mailnottype') instanceof ilFormPropertyGUI) {
$this->testOBJ->setMailNotificationType($form->getItemByPostVar('mailnottype')->getChecked());
}
if ($form->getItemByPostVar('chb_show_marker') instanceof ilFormPropertyGUI) {
$this->testOBJ->setShowMarker($form->getItemByPostVar('chb_show_marker')->getChecked());
}
if ($form->getItemByPostVar('chb_show_cancel') instanceof ilFormPropertyGUI) {
$this->testOBJ->setShowCancel($form->getItemByPostVar('chb_show_cancel')->getChecked());
}
if ($form->getItemByPostVar('kiosk') instanceof ilFormPropertyGUI) {
$this->testOBJ->setKioskMode($form->getItemByPostVar('kiosk')->getChecked());
$kioskOptions = $form->getItemByPostVar('kiosk_options')->getValue();
if (is_array($kioskOptions)) {
$this->testOBJ->setShowKioskModeTitle(in_array('kiosk_title', $kioskOptions));
$this->testOBJ->setShowKioskModeParticipant(in_array('kiosk_participant', $kioskOptions));
$this->testOBJ->setExamidInKiosk(in_array('examid_in_kiosk', $_POST["kiosk_options"]));
}
}
// redirect after test
if ($form->getItemByPostVar('redirection_enabled')->getChecked()) {
$this->testOBJ->setRedirectionMode($form->getItemByPostVar('redirection_mode')->getValue());
} else {
$this->testOBJ->setRedirectionMode(REDIRECT_NONE);
}
if (strlen($form->getItemByPostVar('redirection_url')->getValue())) {
$this->testOBJ->setRedirectionUrl($form->getItemByPostVar('redirection_url')->getValue());
} else {
$this->testOBJ->setRedirectionUrl(null);
}
if ($form->getItemByPostVar('sign_submission')->getChecked()) {
$this->testOBJ->setSignSubmission(true);
} else {
$this->testOBJ->setSignSubmission(false);
//.........这里部分代码省略.........
示例2: saveTest
/**
* Save Test
*/
protected function saveTest()
{
$this->ctrl->setParameter($this, 'tt', (int) $_REQUEST['tt']);
$this->setTestType((int) $_REQUEST['tt']);
$settings = ilLOSettings::getInstanceByObjId($this->getParentObject()->getId());
include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
$form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
$form = $form_helper->initForm(FALSE);
if ($form->checkInput()) {
$mode = $form->getInput('mode');
if ($mode == self::TEST_NEW) {
$tst = new ilObjTest();
$tst->setType('tst');
$tst->setTitle($form->getInput('title'));
$tst->setDescription($form->getInput('desc'));
$tst->create();
$tst->createReference();
$tst->putInTree($this->getParentObject()->getRefId());
$tst->setPermissions($this->getParentObject()->getRefId());
// apply settings template
$this->applySettingsTemplate($tst);
$tst->setQuestionSetType($form->getInput('qtype'));
$tst->saveToDb();
if ($this->getTestType() == self::TEST_TYPE_IT) {
$this->getSettings()->setInitialTest($tst->getRefId());
} else {
$this->getSettings()->setQualifiedTest($tst->getRefId());
}
$this->getSettings()->update();
} else {
if ($this->getTestType() == self::TEST_TYPE_IT) {
$this->getSettings()->setInitialTest($form->getInput('tst'));
} else {
$this->getSettings()->setQualifiedTest($form->getInput('tst'));
}
$this->getSettings()->update();
$tst = new ilObjTest($settings->getTestByType($this->getTestType()), true);
$this->applySettingsTemplate($tst);
$tst->saveToDb();
}
$this->updateStartObjects();
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->ctrl->redirect($this, 'testOverview');
}
// Error
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$form->setValuesByPost();
$this->testSettings($form);
}
示例3: importVerifiedFileObject
/**
* imports question(s) into the questionpool (after verification)
*/
function importVerifiedFileObject()
{
include_once "./Modules/Test/classes/class.ilObjTest.php";
// create new questionpool object
$newObj = new ilObjTest(0, true);
// set type of questionpool object
$newObj->setType($_GET["new_type"]);
// set title of questionpool object to "dummy"
$newObj->setTitle("dummy");
// set description of questionpool object
$newObj->setDescription("test import");
// create the questionpool class in the ILIAS database (object_data table)
$newObj->create(true);
// create a reference for the questionpool object in the ILIAS database (object_reference table)
$newObj->createReference();
// put the questionpool object in the administration tree
$newObj->putInTree($_GET["ref_id"]);
// get default permissions and set the permissions for the questionpool object
$newObj->setPermissions($_GET["ref_id"]);
// notify the questionpool object and all its parent objects that a "new" object was created
$newObj->notify("new", $_GET["ref_id"], $_GET["parent_non_rbac_id"], $_GET["ref_id"], $newObj->getRefId());
// empty mark schema
$newObj->mark_schema->flush();
// start parsing of QTI files
include_once "./Services/QTI/classes/class.ilQTIParser.php";
// Handle selection of "no questionpool" as qpl_id = -1 -> use test object id instead.
// TODO: chek if empty strings in $_POST["qpl_id"] relates to a bug or not
if ($_POST["qpl_id"] == "-1") {
$qpl_id = $newObj->id;
} else {
$qpl_id = $_POST["qpl_id"];
}
$qtiParser = new ilQTIParser($_SESSION["tst_import_qti_file"], IL_MO_PARSE_QTI, $qpl_id, $_POST["ident"]);
$qtiParser->setTestObject($newObj);
$result = $qtiParser->startParsing();
$newObj->saveToDb();
// import page data
include_once "./Modules/LearningModule/classes/class.ilContObjParser.php";
$contParser = new ilContObjParser($newObj, $_SESSION["tst_import_xml_file"], $_SESSION["tst_import_subdir"]);
$contParser->setQuestionMapping($qtiParser->getImportMapping());
$contParser->startParsing();
// import test results
if (@file_exists($_SESSION["tst_import_results_file"])) {
include_once "./Modules/Test/classes/class.ilTestResultsImportParser.php";
$results = new ilTestResultsImportParser($_SESSION["tst_import_results_file"], $newObj);
$results->startParsing();
}
// delete import directory
ilUtil::delDir(ilObjTest::_getImportDirectory());
ilUtil::sendSuccess($this->lng->txt("object_imported"), true);
$newObj->updateMetaData();
ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() . "&baseClass=ilObjTestGUI");
}
示例4: savePropertiesObject
/**
* Save the form input of the properties form
*
* @access public
*/
function savePropertiesObject()
{
if (!array_key_exists("tst_properties_confirmation", $_POST)) {
$hasErrors = $this->propertiesObject(true);
} else {
$hasErrors = false;
}
if (!$hasErrors) {
$template_settings = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
$template_settings = $template->getSettings();
}
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj =& new ilMD($this->object->getId(), 0, "tst");
$md_section = $md_obj->getGeneral();
// title
$md_section->setTitle(ilUtil::stripSlashes($_POST['title']));
$md_section->update();
// Description
$md_desc_ids = $md_section->getDescriptionIds();
if ($md_desc_ids) {
$md_desc = $md_section->getDescription(array_pop($md_desc_ids));
$md_desc->setDescription(ilUtil::stripSlashes($_POST['description']));
$md_desc->update();
} else {
$md_desc = $md_section->addDescription();
$md_desc->setDescription(ilUtil::stripSlashes($_POST['description']));
$md_desc->save();
}
$this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
$this->object->setDescription(ilUtil::stripSlashes($_POST['description']));
$this->object->update();
$total = $this->object->evalTotalPersons();
$randomtest_switch = false;
// Check the values the user entered in the form
if (!$total) {
if (!strlen($_POST["random_test"])) {
$random_test = 0;
} else {
$random_test = $_POST["random_test"];
}
if (!array_key_exists("tst_properties_confirmation", $_POST)) {
if (!$random_test && $this->object->areRandomTestQuestionpoolsConfigured()) {
// user tries to change from a random test with existing random question pools to a non random test
$this->confirmChangeProperties(self::SWITCH_RANDOM_TEST_SETTING_TO_DISABLED);
return;
} elseif ($random_test && $this->object->doesNonRandomTestQuestionsExist()) {
// user tries to change from a non random test with existing questions to a random test
$this->confirmChangeProperties(self::SWITCH_RANDOM_TEST_SETTING_TO_ENABLED);
return;
}
}
} else {
$random_test = $this->object->isRandomTest();
}
// buffer online status sent by form in local variable and store
// it to model after the following if block, because the new status
// gets reset when random test setting is switched
$online = $_POST["online"];
$randomtest_switch = $this->isRandomTestSettingSwitched($random_test);
if (!$total) {
if ($randomtest_switch && $this->object->isOnline() && $online) {
// reset online status that is stored to model later on
// due to fact that the random test setting has been changed
$online = false;
$info = $this->lng->txt("tst_set_offline_due_to_switched_random_test_setting");
ilUtil::sendInfo($info, true);
}
$this->object->setAnonymity($_POST["anonymity"]);
$this->object->setRandomTest($random_test);
$this->object->setNrOfTries($_POST["nr_of_tries"]);
}
// store effective online status to model
$this->object->setOnline($online);
// activation
if ($_POST["activation_type"] == ilObjectActivation::TIMINGS_ACTIVATION) {
$this->object->setActivationLimited(true);
$this->object->setActivationVisibility($_POST["activation_visibility"]);
$date = new ilDateTime($_POST['act_starting_time']['date'] . ' ' . $_POST['act_starting_time']['time'], IL_CAL_DATETIME);
$this->object->setActivationStartingTime($date->get(IL_CAL_UNIX));
$date = new ilDateTime($_POST['act_ending_time']['date'] . ' ' . $_POST['act_ending_time']['time'], IL_CAL_DATETIME);
$this->object->setActivationEndingTime($date->get(IL_CAL_UNIX));
} else {
$this->object->setActivationLimited(false);
}
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$this->object->setIntroduction($_POST["introduction"], false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
$this->object->setShowInfo($_POST["showinfo"] ? 1 : 0);
$this->object->setFinalStatement($_POST["finalstatement"], false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
$this->object->setShowFinalStatement($_POST["showfinalstatement"] ? 1 : 0);
$this->object->setSequenceSettings($_POST["chb_postpone"] ? 1 : 0);
$this->object->setShuffleQuestions($_POST["chb_shuffle_questions"] ? 1 : 0);
//.........这里部分代码省略.........