本文整理汇总了PHP中ilObjTest::getScoreReporting方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::getScoreReporting方法的具体用法?PHP ilObjTest::getScoreReporting怎么用?PHP ilObjTest::getScoreReporting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::getScoreReporting方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveResultSummarySettings
/**
* @param ilPropertyFormGUI $form
*/
private function saveResultSummarySettings(ilPropertyFormGUI $form)
{
if ($this->formPropertyExists($form, '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->formPropertyExists($form, 'grading_status')) {
$this->testOBJ->setShowGradingStatusEnabled($form->getItemByPostVar('grading_status')->getChecked());
}
if ($this->formPropertyExists($form, 'grading_mark')) {
$this->testOBJ->setShowGradingMarkEnabled((int) $form->getItemByPostVar('grading_mark')->getChecked());
}
}
示例2: addResultSettingsFormSection
private function addResultSettingsFormSection(ilPropertyFormGUI $form)
{
// HEADER: result settings
$header_tr = new ilFormSectionHeaderGUI();
$header_tr->setTitle($this->lng->txt('test_results'));
$form->addItem($header_tr);
// access to test results
$resultsAccessEnabled = new ilCheckboxInputGUI($this->lng->txt('tst_results_access_enabled'), 'results_access_enabled');
$resultsAccessEnabled->setInfo($this->lng->txt('tst_results_access_enabled_desc'));
$resultsAccessEnabled->setChecked($this->testOBJ->isScoreReportingEnabled());
$resultsAccessSetting = new ilRadioGroupInputGUI($this->lng->txt('tst_results_access_setting'), 'results_access_setting');
$resultsAccessSetting->setRequired(true);
$optAlways = new ilRadioOption($this->lng->txt('tst_results_access_always'), 2, '');
$optAlways->setInfo($this->lng->txt('tst_results_access_always_desc'));
$resultsAccessSetting->addOption($optAlways);
$optFinished = $opt = new ilRadioOption($this->lng->txt('tst_results_access_finished'), 1, '');
$optFinished->setInfo($this->lng->txt('tst_results_access_finished_desc'));
$resultsAccessSetting->addOption($optFinished);
$optionDate = new ilRadioOption($this->lng->txt('tst_results_access_date'), 3, '');
$optionDate->setInfo($this->lng->txt('tst_results_access_date_desc'));
// access date
$reportingDate = new ilDateTimeInputGUI($this->lng->txt('tst_reporting_date'), 'reporting_date');
$reportingDate->setShowTime(true);
if (strlen($this->testOBJ->getReportingDate())) {
$reportingDate->setDate(new ilDateTime($this->testOBJ->getReportingDate(), IL_CAL_TIMESTAMP));
} else {
$reportingDate->setDate(new ilDateTime(time(), IL_CAL_UNIX));
}
$optionDate->addSubItem($reportingDate);
$resultsAccessSetting->addOption($optionDate);
$resultsAccessValue = $this->testOBJ->getScoreReporting();
$resultsAccessSetting->setValue($resultsAccessValue > 0 && $resultsAccessValue < 4 ? $resultsAccessValue : 2);
$resultsAccessEnabled->addSubItem($resultsAccessSetting);
// show pass details
$showPassDetails = new ilCheckboxInputGUI($this->lng->txt('tst_show_pass_details'), 'pass_details');
$showPassDetails->setInfo($this->lng->txt('tst_show_pass_details_desc'));
$showPassDetails->setChecked($this->testOBJ->getShowPassDetails());
$resultsAccessEnabled->addSubItem($showPassDetails);
$form->addItem($resultsAccessEnabled);
// grading
$chb_only_passed_failed = new ilCheckboxInputGUI($this->lng->txt('tst_results_grading_opt_show_status'), 'grading_status');
$chb_only_passed_failed->setInfo($this->lng->txt('tst_results_grading_opt_show_status_desc'));
$chb_only_passed_failed->setValue(1);
$chb_only_passed_failed->setChecked($this->testOBJ->isShowGradingStatusEnabled());
$form->addItem($chb_only_passed_failed);
$chb_resulting_mark_only = new ilCheckboxInputGUI($this->lng->txt('tst_results_grading_opt_show_mark'), 'grading_mark');
$chb_resulting_mark_only->setInfo($this->lng->txt('tst_results_grading_opt_show_mark_desc'));
$chb_resulting_mark_only->setValue(1);
$chb_resulting_mark_only->setChecked($this->testOBJ->isShowGradingMarkEnabled());
$form->addItem($chb_resulting_mark_only);
}
示例3: infoScreen
//.........这里部分代码省略.........
$ilToolbar->setCloseFormTag(false);
$info->setOpenFormTag(false);
}
if (strlen($this->object->getIntroduction())) {
$info->addSection($this->lng->txt("tst_introduction"));
$info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction(), true) . $info->getHiddenToggleButton());
} else {
$info->addSection("");
$info->addProperty("", $info->getHiddenToggleButton());
}
$info->addSection($this->lng->txt("tst_general_properties"));
if ($this->object->getShowInfo()) {
$info->addProperty($this->lng->txt("author"), $this->object->getAuthor());
$info->addProperty($this->lng->txt("title"), $this->object->getTitle());
}
if ($this->object->isOnline() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
if ($this->object->getShowInfo() || !$this->object->getForceJS()) {
// use javascript
$checked_javascript = false;
if ($this->object->getJavaScriptOutput()) {
$checked_javascript = true;
}
}
// hide previous results
if (!$this->object->isRandomTest() && !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
if ($this->object->getNrOfTries() != 1) {
if ($this->object->getUsePreviousAnswers() == 0) {
if ($this->object->getShowInfo()) {
$info->addProperty($this->lng->txt("tst_use_previous_answers"), $this->lng->txt("tst_dont_use_previous_answers"));
}
} else {
$use_previous_answers = FALSE;
if ($ilUser->prefs["tst_use_previous_answers"]) {
$checked_previous_answers = TRUE;
}
$info->addPropertyCheckbox($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers", 1, $this->lng->txt("tst_use_previous_answers_user"), $checked_previous_answers);
}
}
}
}
}
$info->hideFurtherSections(false);
if ($this->object->getShowInfo()) {
$info->addSection($this->lng->txt("tst_sequence_properties"));
$info->addProperty($this->lng->txt("tst_sequence"), $this->lng->txt($this->object->getSequenceSettings() == TEST_FIXED_SEQUENCE ? "tst_sequence_fixed" : "tst_sequence_postpone"));
$info->addSection($this->lng->txt("tst_heading_scoring"));
$info->addProperty($this->lng->txt("tst_text_count_system"), $this->lng->txt($this->object->getCountSystem() == COUNT_PARTIAL_SOLUTIONS ? "tst_count_partial_solutions" : "tst_count_correct_solutions"));
$info->addProperty($this->lng->txt("tst_score_mcmr_questions"), $this->lng->txt($this->object->getMCScoring() == SCORE_ZERO_POINTS_WHEN_UNANSWERED ? "tst_score_mcmr_zero_points_when_unanswered" : "tst_score_mcmr_use_scoring_system"));
if ($this->object->isRandomTest()) {
$info->addProperty($this->lng->txt("tst_pass_scoring"), $this->lng->txt($this->object->getPassScoring() == SCORE_BEST_PASS ? "tst_pass_best_pass" : "tst_pass_last_pass"));
}
$info->addSection($this->lng->txt("tst_score_reporting"));
$score_reporting_text = "";
switch ($this->object->getScoreReporting()) {
case REPORT_AFTER_TEST:
$score_reporting_text = $this->lng->txt("tst_report_after_test");
break;
case REPORT_ALWAYS:
$score_reporting_text = $this->lng->txt("tst_report_after_first_question");
break;
case REPORT_AFTER_DATE:
$score_reporting_text = $this->lng->txt("tst_report_after_date");
break;
case 4:
$score_reporting_text = $this->lng->txt("tst_report_never");
break;
}
$info->addProperty($this->lng->txt("tst_score_reporting"), $score_reporting_text);
$reporting_date = $this->object->getReportingDate();
if ($reporting_date) {
#preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
#$txt_reporting_date = date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]));
#$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
$info->addProperty($this->lng->txt('tst_score_reporting_date'), ilDatePresentation::formatDate(new ilDateTime($reporting_date, IL_CAL_TIMESTAMP)));
}
$info->addSection($this->lng->txt("tst_session_settings"));
$info->addProperty($this->lng->txt("tst_nr_of_tries"), $this->object->getNrOfTries() == 0 ? $this->lng->txt("unlimited") : $this->object->getNrOfTries());
if ($this->object->getNrOfTries() != 1) {
$info->addProperty($this->lng->txt("tst_nr_of_tries_of_user"), $testSession->getPass() == false ? $this->lng->txt("tst_no_tries") : $testSession->getPass());
}
if ($this->object->getEnableProcessingTime()) {
$info->addProperty($this->lng->txt("tst_processing_time"), $this->object->getProcessingTime());
}
if (strlen($this->object->getAllowedUsers()) && $this->object->getAllowedUsersTimeGap()) {
$info->addProperty($this->lng->txt("tst_allowed_users"), $this->object->getAllowedUsers());
}
$starting_time = $this->object->getStartingTime();
if ($starting_time) {
$info->addProperty($this->lng->txt("tst_starting_time"), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_TIMESTAMP)));
}
$ending_time = $this->object->getEndingTime();
if ($ending_time) {
$info->addProperty($this->lng->txt("tst_ending_time"), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_TIMESTAMP)));
}
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
// forward the command
}
$this->ctrl->forwardCommand($info);
}
示例4: infoScreen
//.........这里部分代码省略.........
if ($this->object->getShowInfo()) {
$info->addProperty($this->lng->txt("author"), $this->object->getAuthor());
$info->addProperty($this->lng->txt("title"), $this->object->getTitle());
}
if ($this->object->isOnline() && $this->object->isComplete()) {
if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
if ($this->object->getShowInfo() || !$this->object->getForceJS()) {
// use javascript
$checked_javascript = false;
if ($this->object->getJavaScriptOutput()) {
$checked_javascript = true;
}
if ($this->object->getForceJS()) {
$info->addProperty($this->lng->txt("tst_test_output"), $this->lng->txt("tst_use_javascript"));
} else {
$info->addPropertyCheckbox($this->lng->txt("tst_test_output"), "chb_javascript", 1, $this->lng->txt("tst_use_javascript"), $checked_javascript);
}
}
// hide previous results
if (!$this->object->isRandomTest()) {
if ($this->object->getNrOfTries() != 1) {
if ($this->object->getUsePreviousAnswers() == 0) {
if ($this->object->getShowInfo()) {
$info->addProperty($this->lng->txt("tst_use_previous_answers"), $this->lng->txt("tst_dont_use_previous_answers"));
}
} else {
$use_previous_answers = FALSE;
if ($ilUser->prefs["tst_use_previous_answers"]) {
$checked_previous_answers = TRUE;
}
$info->addPropertyCheckbox($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers", 1, $this->lng->txt("tst_use_previous_answers_user"), $checked_previous_answers);
}
}
}
if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
$info->addPropertyTextinput($this->lng->txt("enter_anonymous_code"), "anonymous_id", "", 8, "setAnonymousId", $this->lng->txt("submit"));
}
}
}
$info->hideFurtherSections(false);
if ($this->object->getShowInfo()) {
$info->addSection($this->lng->txt("tst_sequence_properties"));
$info->addProperty($this->lng->txt("tst_sequence"), $this->lng->txt($this->object->getSequenceSettings() == TEST_FIXED_SEQUENCE ? "tst_sequence_fixed" : "tst_sequence_postpone"));
$info->addSection($this->lng->txt("tst_heading_scoring"));
$info->addProperty($this->lng->txt("tst_text_count_system"), $this->lng->txt($this->object->getCountSystem() == COUNT_PARTIAL_SOLUTIONS ? "tst_count_partial_solutions" : "tst_count_correct_solutions"));
$info->addProperty($this->lng->txt("tst_score_mcmr_questions"), $this->lng->txt($this->object->getMCScoring() == SCORE_ZERO_POINTS_WHEN_UNANSWERED ? "tst_score_mcmr_zero_points_when_unanswered" : "tst_score_mcmr_use_scoring_system"));
if ($this->object->isRandomTest()) {
$info->addProperty($this->lng->txt("tst_pass_scoring"), $this->lng->txt($this->object->getPassScoring() == SCORE_BEST_PASS ? "tst_pass_best_pass" : "tst_pass_last_pass"));
}
$info->addSection($this->lng->txt("tst_score_reporting"));
$score_reporting_text = "";
switch ($this->object->getScoreReporting()) {
case REPORT_AFTER_TEST:
$score_reporting_text = $this->lng->txt("tst_report_after_test");
break;
case REPORT_ALWAYS:
$score_reporting_text = $this->lng->txt("tst_report_after_first_question");
break;
case REPORT_AFTER_DATE:
$score_reporting_text = $this->lng->txt("tst_report_after_date");
break;
case 4:
$score_reporting_text = $this->lng->txt("tst_report_never");
break;
}
$info->addProperty($this->lng->txt("tst_score_reporting"), $score_reporting_text);
$reporting_date = $this->object->getReportingDate();
if ($reporting_date) {
#preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
#$txt_reporting_date = date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]));
#$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
$info->addProperty($this->lng->txt('tst_score_reporting_date'), ilDatePresentation::formatDate(new ilDateTime($reporting_date, IL_CAL_TIMESTAMP)));
}
$info->addSection($this->lng->txt("tst_session_settings"));
$info->addProperty($this->lng->txt("tst_nr_of_tries"), $this->object->getNrOfTries() == 0 ? $this->lng->txt("unlimited") : $this->object->getNrOfTries());
if ($this->object->getNrOfTries() != 1) {
$info->addProperty($this->lng->txt("tst_nr_of_tries_of_user"), $this->object->getTestSession()->getPass() == false ? $this->lng->txt("tst_no_tries") : $this->object->getTestSession()->getPass());
}
if ($this->object->getEnableProcessingTime()) {
$info->addProperty($this->lng->txt("tst_processing_time"), $this->object->getProcessingTime());
}
if (strlen($this->object->getAllowedUsers()) && $this->object->getAllowedUsersTimeGap()) {
$info->addProperty($this->lng->txt("tst_allowed_users"), $this->object->getAllowedUsers());
}
$starting_time = $this->object->getStartingTime();
if ($starting_time) {
$info->addProperty($this->lng->txt("tst_starting_time"), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_TIMESTAMP)));
}
$ending_time = $this->object->getEndingTime();
if ($ending_time) {
$info->addProperty($this->lng->txt("tst_ending_time"), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_TIMESTAMP)));
}
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
// forward the command
if ($_GET['crs_show_result'] and !$this->object->getTestSequence()->getFirstSequence()) {
#ilUtil::sendInfo($this->lng->txt('crs_all_questions_answered_successfully'));
}
}
$this->ctrl->forwardCommand($info);
}