本文整理汇总了PHP中ilObjTest::setAnonymity方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::setAnonymity方法的具体用法?PHP ilObjTest::setAnonymity怎么用?PHP ilObjTest::setAnonymity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::setAnonymity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveResultMiscOptionsSettings
/**
* @param ilPropertyFormGUI $form
*/
private function saveResultMiscOptionsSettings(ilPropertyFormGUI $form)
{
// result filter taxonomies
if ($this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported()) {
if (!$this->isHiddenFormItem('results_tax_filters') && count($this->getAvailableTaxonomyIds())) {
$this->testOBJ->setResultFilterTaxIds(array_intersect($this->getAvailableTaxonomyIds(), $form->getItemByPostVar('results_tax_filters')->getValue()));
}
}
if ($this->formPropertyExists($form, 'anonymity')) {
// anonymity setting
$this->testOBJ->setAnonymity($form->getItemByPostVar('anonymity')->getValue());
}
if ($this->formPropertyExists($form, 'enable_archiving')) {
// Archiving
if ($this->testOBJ->getAnonymity() == true && $form->getItemByPostVar('enable_archiving')->getChecked() == true) {
$this->testOBJ->setEnableArchiving(false);
ilUtil::sendInfo($this->lng->txt('no_archive_on_anonymous'), true);
} else {
$this->testOBJ->setEnableArchiving($form->getItemByPostVar('enable_archiving')->getChecked());
}
}
}
示例2: performSaveForm
//.........这里部分代码省略.........
$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);
}
$this->testOBJ->setEnableProcessingTime($form->getItemByPostVar('chb_processing_time')->getChecked());
if ($this->testOBJ->getEnableProcessingTime()) {
$processingTime = $form->getItemByPostVar('processing_time');
$this->testOBJ->setProcessingTime(sprintf("%02d:%02d:%02d", $processingTime->getHours(), $processingTime->getMinutes(), $processingTime->getSeconds()));
} else {
$this->testOBJ->setProcessingTime('');
}
$this->testOBJ->setResetProcessingTime($form->getItemByPostVar('chb_reset_processing_time')->getChecked());
if ($form->getItemByPostVar('chb_starting_time')->getChecked()) {
$startingTimeSetting = $form->getItemByPostVar('starting_time');
$this->testOBJ->setStartingTime(ilFormat::dateDB2timestamp($startingTimeSetting->getDate()->get(IL_CAL_DATETIME)));
} else {
$this->testOBJ->setStartingTime('');
}
if ($form->getItemByPostVar('chb_ending_time')->getChecked()) {
$endingTimeSetting = $form->getItemByPostVar('ending_time');
$this->testOBJ->setEndingTime(ilFormat::dateDB2timestamp($endingTimeSetting->getDate()->get(IL_CAL_DATETIME)));
} else {
$this->testOBJ->setEndingTime('');
}
if ($form->getItemByPostVar('forcejs') instanceof ilFormPropertyGUI) {
$this->testOBJ->setForceJS($form->getItemByPostVar('forcejs')->getChecked());
}
if ($form->getItemByPostVar('title_output') instanceof ilFormPropertyGUI) {
$this->testOBJ->setTitleOutput($form->getItemByPostVar('title_output')->getValue());
}
if ($form->getItemByPostVar('password') instanceof ilFormPropertyGUI) {
$this->testOBJ->setPassword($form->getItemByPostVar('password')->getValue());
}
if ($form->getItemByPostVar('allowedUsers') instanceof ilFormPropertyGUI) {
$this->testOBJ->setAllowedUsers($form->getItemByPostVar('allowedUsers')->getValue());
}
if ($form->getItemByPostVar('allowedUsersTimeGap') instanceof ilFormPropertyGUI) {
$this->testOBJ->setAllowedUsersTimeGap($form->getItemByPostVar('allowedUsersTimeGap')->getValue());
}
// Selector for uicode characters
global $ilSetting;
if ($ilSetting->get('char_selector_availability') > 0) {
require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
$char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST);
$char_selector->addFormProperties($form);
$char_selector->getFormValues($form);
$this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
$this->testOBJ->setCharSelectorDefinition($char_selector->getConfig()->getDefinition());
}
$this->testOBJ->setAutosave($form->getItemByPostVar('autosave')->getChecked());
$this->testOBJ->setAutosaveIval($form->getItemByPostVar('autosave_ival')->getValue() * 1000);
$this->testOBJ->setUsePreviousAnswers($form->getItemByPostVar('chb_use_previous_answers')->getChecked());
// highscore settings
$this->testOBJ->setHighscoreEnabled((bool) $form->getItemByPostVar('highscore_enabled')->getChecked());
$this->testOBJ->setHighscoreAnon((bool) $form->getItemByPostVar('highscore_anon')->getChecked());
$this->testOBJ->setHighscoreAchievedTS((bool) $form->getItemByPostVar('highscore_achieved_ts')->getChecked());
$this->testOBJ->setHighscoreScore((bool) $form->getItemByPostVar('highscore_score')->getChecked());
$this->testOBJ->setHighscorePercentage((bool) $form->getItemByPostVar('highscore_percentage')->getChecked());
$this->testOBJ->setHighscoreHints((bool) $form->getItemByPostVar('highscore_hints')->getChecked());
$this->testOBJ->setHighscoreWTime((bool) $form->getItemByPostVar('highscore_wtime')->getChecked());
$this->testOBJ->setHighscoreOwnTable((bool) $form->getItemByPostVar('highscore_own_table')->getChecked());
$this->testOBJ->setHighscoreTopTable((bool) $form->getItemByPostVar('highscore_top_table')->getChecked());
$this->testOBJ->setHighscoreTopNum((int) $form->getItemByPostVar('highscore_top_num')->getValue());
if (!$this->testOBJ->participantDataExist()) {
// question set type
if ($form->getItemByPostVar('question_set_type') instanceof ilFormPropertyGUI) {
$this->testOBJ->setQuestionSetType($form->getItemByPostVar('question_set_type')->getValue());
}
// anonymity setting
$this->testOBJ->setAnonymity($form->getItemByPostVar('anonymity')->getValue());
// nr of tries (max passes)
$this->testOBJ->setNrOfTries($form->getItemByPostVar('nr_of_tries')->getValue());
// fixed participants setting
if ($form->getItemByPostVar('fixedparticipants') instanceof ilFormPropertyGUI) {
$this->testOBJ->setFixedParticipants($form->getItemByPostVar('fixedparticipants')->getChecked());
}
}
// store settings to db
$this->testOBJ->saveToDb(true);
// Update ecs export settings
include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
$ecs = new ilECSTestSettings($this->testOBJ);
$ecs->handleSettingsUpdate();
}
示例3: performSaveForm
private function performSaveForm(ilPropertyFormGUI $form)
{
if ($this->areScoringSettingsWritable()) {
if (!$this->isHiddenFormItem('count_system')) {
$this->testOBJ->setCountSystem($form->getItemByPostVar('count_system')->getValue());
}
if (!$this->isHiddenFormItem('mc_scoring')) {
$this->testOBJ->setMCScoring($form->getItemByPostVar('mc_scoring')->getValue());
}
if (!$this->isHiddenFormItem('score_cutting')) {
$this->testOBJ->setScoreCutting($form->getItemByPostVar('score_cutting')->getValue());
}
if (!$this->isHiddenFormItem('pass_scoring')) {
$this->testOBJ->setPassScoring($form->getItemByPostVar('pass_scoring')->getValue());
}
}
if (!$this->isHiddenFormItem('results_access_enabled')) {
if ($form->getItemByPostVar('results_access_enabled')->getChecked()) {
$this->testOBJ->setScoreReporting($form->getItemByPostVar('results_access_setting')->getValue());
if ($this->testOBJ->getScoreReporting() == REPORT_AFTER_DATE) {
$this->testOBJ->setReportingDate($form->getItemByPostVar('reporting_date')->getDate()->get(IL_CAL_FKT_DATE, 'YmdHis'));
} else {
$this->testOBJ->setReportingDate('');
}
$this->testOBJ->setShowPassDetails($form->getItemByPostVar('pass_details')->getChecked());
} else {
$this->testOBJ->setScoreReporting(4);
// never
$this->testOBJ->setShowPassDetails(false);
$this->testOBJ->setReportingDate('');
}
}
if (!$this->isHiddenFormItem('show_result_grading')) {
$this->testOBJ->setShowGradingStatusEnabled($form->getItemByPostVar('grading_status')->getChecked());
$this->testOBJ->setShowGradingMarkEnabled((int) $form->getItemByPostVar('grading_mark')->getChecked());
}
if (!$this->isHiddenFormItem('solution_details')) {
if ($form->getItemByPostVar('solution_details')->getChecked()) {
$this->testOBJ->setShowSolutionDetails(1);
$this->testOBJ->setPrintBestSolutionWithResult((int) $form->getItemByPostVar('print_bs_with_res')->getChecked());
} else {
$this->testOBJ->setShowSolutionDetails(0);
$this->testOBJ->setPrintBestSolutionWithResult(0);
}
}
if (!$this->isHiddenFormItem('solution_printview')) {
if ($form->getItemByPostVar('solution_printview')->getChecked()) {
$this->testOBJ->setShowSolutionPrintview(1);
$this->testOBJ->setShowSolutionListComparison((bool) $form->getItemByPostVar('solution_compare')->getChecked());
$this->testOBJ->setShowSolutionAnswersOnly((int) $form->getItemByPostVar('solution_answers_only')->getChecked());
} else {
$this->testOBJ->setShowSolutionPrintview(0);
$this->testOBJ->setShowSolutionListComparison(false);
$this->testOBJ->setShowSolutionAnswersOnly(0);
}
}
if (!$this->isHiddenFormItem('solution_feedback')) {
$this->testOBJ->setShowSolutionFeedback($form->getItemByPostVar('solution_feedback')->getChecked());
}
if (!$this->isHiddenFormItem('solution_signature')) {
$this->testOBJ->setShowSolutionSignature($form->getItemByPostVar('solution_signature')->getChecked());
}
if (!$this->isHiddenFormItem('examid_in_test_res')) {
$this->testOBJ->setShowExamIdInTestResultsEnabled($form->getItemByPostVar('examid_in_test_res')->getChecked());
}
if (!$this->isHiddenFormItem('solution_suggested')) {
$this->testOBJ->setShowSolutionSuggested($form->getItemByPostVar('solution_suggested')->getChecked());
}
if (!$this->isHiddenFormItem('exp_sc_short')) {
$this->testOBJ->setExportSettingsSingleChoiceShort((int) $form->getItemByPostVar('exp_sc_short')->getChecked());
}
if (!$this->isHiddenFormItem('pass_deletion_allowed')) {
$this->testOBJ->setPassDeletionAllowed((bool) $form->getItemByPostVar('pass_deletion_allowed')->getValue());
}
// result filter taxonomies
if ($this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported()) {
if (!$this->isHiddenFormItem('results_tax_filters') && count($this->getAvailableTaxonomyIds())) {
$this->testOBJ->setResultFilterTaxIds(array_intersect($this->getAvailableTaxonomyIds(), $form->getItemByPostVar('results_tax_filters')->getValue()));
}
}
if (!$this->isHiddenFormItem('anonymity')) {
// anonymity setting
$this->testOBJ->setAnonymity($form->getItemByPostVar('anonymity')->getValue());
}
if (!$this->isHiddenFormItem('enable_archiving')) {
// Archiving
if ($this->testOBJ->getAnonymity() == true && $form->getItemByPostVar('enable_archiving')->getChecked() == true) {
$this->testOBJ->setEnableArchiving(false);
ilUtil::sendInfo($this->lng->txt('no_archive_on_anonymous'), true);
} else {
$this->testOBJ->setEnableArchiving($form->getItemByPostVar('enable_archiving')->getChecked());
}
}
if (!$this->isHiddenFormItem('highscore_enabled')) {
// highscore settings
$this->testOBJ->setHighscoreEnabled((bool) $form->getItemByPostVar('highscore_enabled')->getChecked());
$this->testOBJ->setHighscoreAnon((bool) $form->getItemByPostVar('highscore_anon')->getChecked());
$this->testOBJ->setHighscoreAchievedTS((bool) $form->getItemByPostVar('highscore_achieved_ts')->getChecked());
$this->testOBJ->setHighscoreScore((bool) $form->getItemByPostVar('highscore_score')->getChecked());
$this->testOBJ->setHighscorePercentage((bool) $form->getItemByPostVar('highscore_percentage')->getChecked());
//.........这里部分代码省略.........
示例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);
//.........这里部分代码省略.........