本文整理汇总了PHP中ilObjTest::getEnableArchiving方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::getEnableArchiving方法的具体用法?PHP ilObjTest::getEnableArchiving怎么用?PHP ilObjTest::getEnableArchiving使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::getEnableArchiving方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recalculatePasses
/**
* @param $userdata
* @param $active_id
*/
public function recalculatePasses($userdata, $active_id)
{
require_once './Modules/Test/classes/class.ilTestEvaluationGUI.php';
// Below!
require_once './Modules/Test/classes/class.ilTestPDFGenerator.php';
require_once './Modules/Test/classes/class.ilTestArchiver.php';
$passes = $userdata->getPasses();
foreach ($passes as $pass => $passdata) {
if (is_object($passdata)) {
$this->recalculatePass($passdata, $active_id, $pass);
if ($this->test->getEnableArchiving()) {
// requires out of the loop!
$test_evaluation_gui = new ilTestEvaluationGUI($this->test);
$overview = $test_evaluation_gui->getPassListOfAnswers($passdata, $active_id, $pass, true, false, false, true);
$filename = ilUtil::getWebspaceDir() . '/assessment/scores-' . $this->test->getId() . '-' . $active_id . '-' . $pass . '.pdf';
ilTestPDFGenerator::generatePDF($overview, ilTestPDFGenerator::PDF_OUTPUT_FILE, $filename);
$archiver = new ilTestArchiver($this->test->getId());
$archiver->handInTestResult($active_id, $pass, $filename);
unlink($filename);
}
}
}
}
示例2: addMiscSettingsFormSection
private function addMiscSettingsFormSection(ilPropertyFormGUI $form)
{
$fields = array('anonymity', 'enable_archiving');
if ($this->isSectionHeaderRequired($fields) || $this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported()) {
// 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);
}
示例3: saveQuestion
protected function saveQuestion()
{
$question_id = $_POST['q_id'];
$question_pool_id = $_POST['qpl_id'];
$form = $this->buildAdjustQuestionForm($question_id, $question_pool_id);
$form->setValuesByPost($_POST);
if (!$form->checkInput()) {
ilUtil::sendFailure($this->lng->txt('adjust_question_form_error'));
$this->outputAdjustQuestionForm($form);
return;
}
require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
/** @var $question assQuestionGUI|ilGuiQuestionScoringAdjustable */
$question = assQuestion::instantiateQuestionGUI($question_id);
if ($question instanceof ilGuiQuestionScoringAdjustable) {
$question->writeQuestionSpecificPostData($form);
}
if ($question->object instanceof ilObjQuestionScoringAdjustable) {
$question->object->saveAdditionalQuestionDataToDb();
}
if ($question instanceof ilGuiAnswerScoringAdjustable) {
$question->writeAnswerSpecificPostData($form);
}
if ($question->object instanceof ilObjAnswerScoringAdjustable) {
$question->object->saveAnswerSpecificDataToDb();
}
$question->object->setPoints($question->object->getMaximumPoints());
$question->object->saveQuestionDataToDb();
require_once './Modules/Test/classes/class.ilTestScoring.php';
$scoring = new ilTestScoring($this->object);
$scoring->setPreserveManualScores($_POST['preserve_manscoring'] == 1 ? true : false);
$scoring->recalculateSolutions();
if ($this->object->getEnableArchiving()) {
require_once 'Modules/Test/classes/class.ilTestArchiveService.php';
$archiveService = new ilTestArchiveService($this->object);
$archiveService->archivePassesByActives($scoring->getRecalculatedPassesByActives());
}
ilUtil::sendSuccess($this->lng->txt('saved_adjustment'));
$this->questionsObject();
}
示例4: 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);
//.........这里部分代码省略.........