本文整理汇总了PHP中ilObjTest::getAnonymity方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::getAnonymity方法的具体用法?PHP ilObjTest::getAnonymity怎么用?PHP ilObjTest::getAnonymity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::getAnonymity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: npResetFilterObject
function npResetFilterObject()
{
include_once "./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php";
$table_gui = new ilTestParticipantsTableGUI($this, "participants", false, $this->object->getAnonymity(), 0);
$table_gui->resetFilter();
// writes filter to session
$table_gui->resetOffset();
// sets record offest to 0 (first page)
$this->participantsObject();
}
示例2: getResultsHeadUserAndPass
/**
* Returns the user and pass data for a test results output
*
* @param integer $active_id The active ID of the user
* @return string HTML code of the user data for the test results
* @access public
*/
function getResultsHeadUserAndPass($active_id, $pass)
{
$template = new ilTemplate("tpl.il_as_tst_results_head_user_pass.html", TRUE, TRUE, "Modules/Test");
include_once './Services/User/classes/class.ilObjUser.php';
$user_id = $this->object->_getUserIdFromActiveId($active_id);
if (strlen(ilObjUser::_lookupLogin($user_id)) > 0) {
$user = new ilObjUser($user_id);
} else {
$user = new ilObjUser();
$user->setLastname($this->lng->txt("deleted_user"));
}
$title_matric = "";
if (strlen($user->getMatriculation()) && $this->object->getAnonymity() == FALSE) {
$template->setCurrentBlock("user_matric");
$template->setVariable("TXT_USR_MATRIC", $this->lng->txt("matriculation"));
$template->parseCurrentBlock();
$template->setCurrentBlock("user_matric_value");
$template->setVariable("VALUE_USR_MATRIC", $user->getMatriculation());
$template->parseCurrentBlock();
$template->touchBlock("user_matric_separator");
$title_matric = " - " . $this->lng->txt("matriculation") . ": " . $user->getMatriculation();
}
$invited_user = array_pop($this->object->getInvitedUsers($user_id));
if (strlen($invited_user["clientip"])) {
$template->setCurrentBlock("user_clientip");
$template->setVariable("TXT_CLIENT_IP", $this->lng->txt("client_ip"));
$template->parseCurrentBlock();
$template->setCurrentBlock("user_clientip_value");
$template->setVariable("VALUE_CLIENT_IP", $invited_user["clientip"]);
$template->parseCurrentBlock();
$template->touchBlock("user_clientip_separator");
$title_client = " - " . $this->lng->txt("clientip") . ": " . $invited_user["clientip"];
}
$template->setVariable("TXT_USR_NAME", $this->lng->txt("name"));
$uname = $this->object->userLookupFullName($user_id, FALSE);
$template->setVariable("VALUE_USR_NAME", $uname);
$template->setVariable("TXT_PASS", $this->lng->txt("scored_pass"));
$template->setVariable("VALUE_PASS", $pass);
return $template->get();
}
示例3: addMiscSettingsFormSection
private function addMiscSettingsFormSection(ilPropertyFormGUI $form)
{
// misc settings
$header_misc = new ilFormSectionHeaderGUI();
$header_misc->setTitle($this->lng->txt('misc'));
$form->addItem($header_misc);
// result filter taxonomies
if ($this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported()) {
$availableTaxonomyIds = $this->getAvailableTaxonomyIds();
if (count($availableTaxonomyIds)) {
require_once 'Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
$labelTranslater = new ilTestTaxonomyFilterLabelTranslater($this->db);
$labelTranslater->loadLabelsFromTaxonomyIds($availableTaxonomyIds);
$results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt('tst_results_tax_filters'), 'results_tax_filters');
foreach ($availableTaxonomyIds as $taxonomyId) {
$results_presentation->addOption(new ilCheckboxOption($labelTranslater->getTaxonomyTreeLabel($taxonomyId), $taxonomyId, ''));
}
$results_presentation->setValue($this->testOBJ->getResultFilterTaxIds());
$form->addItem($results_presentation);
}
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($this->testOBJ->participantDataExist()) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->testOBJ->getAnonymity());
$form->addItem($anonymity);
// enable_archiving
$enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
$enable_archiving->setInfo($this->lng->txt('test_enable_archiving_desc'));
$enable_archiving->setValue(1);
$enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
$form->addItem($enable_archiving);
}
示例4: 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());
}
}
}
示例5: buildExportFileXML
/**
* build xml export file
*/
function buildExportFileXML()
{
global $ilBench;
$ilBench->start("TestExport", "buildExportFile");
include_once "./Services/Xml/classes/class.ilXmlWriter.php";
$this->xml = new ilXmlWriter();
// set dtd definition
$this->xml->xmlSetDtdDef("<!DOCTYPE Test SYSTEM \"http://www.ilias.uni-koeln.de/download/dtd/ilias_co.dtd\">");
// set generated comment
$this->xml->xmlSetGenCmt("Export of ILIAS Test " . $this->test_obj->getId() . " of installation " . $this->inst . ".");
// set xml header
$this->xml->xmlHeader();
// create directories
$this->test_obj->createExportDirectory();
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::makeDir($this->export_dir . "/" . $this->subdir);
ilUtil::makeDir($this->export_dir . "/" . $this->subdir . "/objects");
// get Log File
$expDir = $this->test_obj->getExportDirectory();
include_once "./Services/Logging/classes/class.ilLog.php";
$expLog = new ilLog($expDir, "export.log");
$expLog->delete();
$expLog->setLogFormat("");
$expLog->write(date("[y-m-d H:i:s] ") . "Start Export");
// write qti file
$qti_file = fopen($this->export_dir . "/" . $this->subdir . "/" . $this->qti_filename, "w");
fwrite($qti_file, $this->test_obj->toXML());
fclose($qti_file);
// get xml content
$ilBench->start("TestExport", "buildExportFile_getXML");
$this->test_obj->exportPagesXML($this->xml, $this->inst_id, $this->export_dir . "/" . $this->subdir, $expLog);
$ilBench->stop("TestExport", "buildExportFile_getXML");
// dump xml document to screen (only for debugging reasons)
/*
echo "<PRE>";
echo htmlentities($this->xml->xmlDumpMem($format));
echo "</PRE>";
*/
// dump xml document to file
$ilBench->start("TestExport", "buildExportFile_dumpToFile");
$this->xml->xmlDumpFile($this->export_dir . "/" . $this->subdir . "/" . $this->filename, false);
$ilBench->stop("TestExport", "buildExportFile_dumpToFile");
if (@file_exists("./Modules/Test/classes/class.ilTestResultsToXML.php")) {
// dump results xml document to file
include_once "./Modules/Test/classes/class.ilTestResultsToXML.php";
$resultwriter = new ilTestResultsToXML($this->test_obj->getTestId(), $this->test_obj->getAnonymity());
$ilBench->start("TestExport", "buildExportFile_results");
$resultwriter->xmlDumpFile($this->export_dir . "/" . $this->subdir . "/" . $this->resultsfile, false);
$ilBench->stop("TestExport", "buildExportFile_results");
}
// add media objects which were added with tiny mce
$ilBench->start("QuestionpoolExport", "buildExportFile_saveAdditionalMobs");
$this->exportXHTMLMediaObjects($this->export_dir . "/" . $this->subdir);
$ilBench->stop("QuestionpoolExport", "buildExportFile_saveAdditionalMobs");
// zip the file
$ilBench->start("TestExport", "buildExportFile_zipFile");
ilUtil::zip($this->export_dir . "/" . $this->subdir, $this->export_dir . "/" . $this->subdir . ".zip");
$ilBench->stop("TestExport", "buildExportFile_zipFile");
// destroy writer object
$this->xml->_XmlWriter;
$expLog->write(date("[y-m-d H:i:s] ") . "Finished Export");
$ilBench->stop("TestExport", "buildExportFile");
return $this->export_dir . "/" . $this->subdir . ".zip";
}
示例6: buildForm
private function buildForm()
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
$form->setTableWidth("100%");
$form->setId("test_properties");
if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
}
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
$md_section = $md_obj->getGeneral();
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setRequired(true);
$title->setValue($md_section->getTitle());
$form->addItem($title);
$ids = $md_section->getDescriptionIds();
if ($ids) {
$desc_obj = $md_section->getDescription(array_pop($ids));
$desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
$desc->setCols(50);
$desc->setRows(4);
$desc->setValue($desc_obj->getDescription());
$form->addItem($desc);
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($this->testOBJ->participantDataExist()) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->testOBJ->getAnonymity());
$form->addItem($anonymity);
// test mode (question set type)
$questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
$questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
$questSetType->addOption($questSetTypeFixed);
$questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
$questSetType->addOption($questSetTypeRandom);
$questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
$questSetType->addOption($questSetTypeContinues);
$questSetType->setValue($this->testOBJ->getQuestionSetType());
if ($this->testOBJ->participantDataExist()) {
$questSetType->setDisabled(true);
}
$form->addItem($questSetType);
// pool usage
$pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
$pool_usage->setValue(1);
$pool_usage->setChecked($this->testOBJ->getPoolUsage());
$form->addItem($pool_usage);
// enable_archiving
$enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
$enable_archiving->setValue(1);
$enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
$form->addItem($enable_archiving);
// activation/availability (no template support yet)
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->lng->loadLanguageModule('rep');
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('rep_activation_availability'));
$form->addItem($section);
// additional info only with multiple references
$act_obj_info = $act_ref_info = "";
if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
$act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
}
$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
$online->setChecked($this->testOBJ->isOnline());
$online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
$form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
$act_type->setInfo($act_ref_info);
$act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
$opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
$act_type->addOption($opt);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
$opt->setInfo($this->lng->txt('tst_availability_until_info'));
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI("", "access_period");
$dur->setShowTime(true);
$date = $this->testOBJ->getActivationStartingTime();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->testOBJ->getActivationEndingTime();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$opt->addSubItem($dur);
//.........这里部分代码省略.........