本文整理汇总了PHP中ilObjTest::getPassScoring方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::getPassScoring方法的具体用法?PHP ilObjTest::getPassScoring怎么用?PHP ilObjTest::getPassScoring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::getPassScoring方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hasScoringSettingsChanged
private function hasScoringSettingsChanged(ilPropertyFormGUI $form)
{
$countSystem = $form->getItemByPostVar('count_system');
if (is_object($countSystem) && $countSystem->getValue() != $this->testOBJ->getCountSystem()) {
return true;
}
$mcScoring = $form->getItemByPostVar('mc_scoring');
if (is_object($mcScoring) && $mcScoring != $this->testOBJ->getMCScoring()) {
return true;
}
$scoreCutting = $form->getItemByPostVar('score_cutting');
if (is_object($scoreCutting) && $scoreCutting->getValue() != $this->testOBJ->getScoreCutting()) {
return true;
}
$passScoring = $form->getItemByPostVar('pass_scoring');
if (is_object($passScoring) && $passScoring->getValue() != $this->testOBJ->getPassScoring()) {
return true;
}
return false;
}
示例2: exportToCSV
//.........这里部分代码省略.........
foreach ($additionalFields as $fieldname) {
if (strcmp($fieldname, "gender") == 0) {
array_push($datarow2, $this->lng->txt("gender_" . $userfields[$fieldname]));
} else {
array_push($datarow2, $userfields[$fieldname]);
}
}
}
array_push($datarow2, $data->getParticipant($active_id)->getReached());
array_push($datarow2, $data->getParticipant($active_id)->getMaxpoints());
array_push($datarow2, $data->getParticipant($active_id)->getMark());
if ($this->test_obj->getECTSOutput()) {
array_push($datarow2, $data->getParticipant($active_id)->getECTSMark());
}
array_push($datarow2, $data->getParticipant($active_id)->getQuestionsWorkedThrough());
array_push($datarow2, $data->getParticipant($active_id)->getNumberOfQuestions());
array_push($datarow2, $data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent() / 100.0);
$time = $data->getParticipant($active_id)->getTimeOfWork();
$time_seconds = $time;
$time_hours = floor($time_seconds / 3600);
$time_seconds -= $time_hours * 3600;
$time_minutes = floor($time_seconds / 60);
$time_seconds -= $time_minutes * 60;
array_push($datarow2, sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
$time = $data->getParticipant($active_id)->getQuestionsWorkedThrough() ? $data->getParticipant($active_id)->getTimeOfWork() / $data->getParticipant($active_id)->getQuestionsWorkedThrough() : 0;
$time_seconds = $time;
$time_hours = floor($time_seconds / 3600);
$time_seconds -= $time_hours * 3600;
$time_minutes = floor($time_seconds / 60);
$time_seconds -= $time_minutes * 60;
array_push($datarow2, sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
$fv = $data->getParticipant($active_id)->getFirstVisit();
$lv = $data->getParticipant($active_id)->getLastVisit();
foreach (array($fv, $lv) as $ts) {
if ($ts) {
$visit = ilFormat::formatDate(date('Y-m-d H:i:s', $ts), "datetime", false, false);
array_push($datarow2, $visit);
} else {
array_push($datarow2, "");
}
}
$median = $data->getStatistics()->getStatistics()->median();
$pct = $data->getParticipant($active_id)->getMaxpoints() ? $median / $data->getParticipant($active_id)->getMaxpoints() * 100.0 : 0;
$mark = $this->test_obj->mark_schema->getMatchingMark($pct);
$mark_short_name = "";
if (is_object($mark)) {
$mark_short_name = $mark->getShortName();
}
array_push($datarow2, $mark_short_name);
array_push($datarow2, $data->getStatistics()->getStatistics()->rank($data->getParticipant($active_id)->getReached()));
array_push($datarow2, $data->getStatistics()->getStatistics()->rank_median());
array_push($datarow2, $data->getStatistics()->getStatistics()->count());
array_push($datarow2, $median);
if ($this->test_obj->getPassScoring() == SCORE_BEST_PASS) {
array_push($datarow2, $data->getParticipant($active_id)->getBestPass() + 1);
} else {
array_push($datarow2, $data->getParticipant($active_id)->getLastPass() + 1);
}
for ($pass = 0; $pass <= $data->getParticipant($active_id)->getLastPass(); $pass++) {
$finishdate = $this->test_obj->getPassFinishDate($active_id, $pass);
if ($finishdate > 0) {
if ($pass > 0) {
for ($i = 1; $i < $col - 1; $i++) {
array_push($datarow2, "");
array_push($datarow, "");
}
array_push($datarow, "");
}
array_push($datarow2, $pass + 1);
if (is_object($data->getParticipant($active_id)) && is_array($data->getParticipant($active_id)->getQuestions($pass))) {
foreach ($data->getParticipant($active_id)->getQuestions($pass) as $question) {
$question_data = $data->getParticipant($active_id)->getPass($pass)->getAnsweredQuestionByQuestionId($question["id"]);
array_push($datarow2, $question_data["reached"]);
array_push($datarow, preg_replace("/<.*?>/", "", $data->getQuestionTitle($question["id"])));
}
}
if ($this->test_obj->isRandomTest() || $this->test_obj->getShuffleQuestions() || $counter == 1 && $pass == 0) {
array_push($rows, $datarow);
}
$datarow = array();
array_push($rows, $datarow2);
$datarow2 = array();
}
}
$counter++;
}
}
$csv = "";
$separator = ";";
foreach ($rows as $evalrow) {
$csvrow =& $this->test_obj->processCSVRow($evalrow, TRUE, $separator);
$csv .= join($csvrow, $separator) . "\n";
}
if ($deliver) {
ilUtil::deliverData($csv, ilUtil::getASCIIFilename($this->test_obj->getTitle() . "_results.csv"));
exit;
} else {
return $csv;
}
}
示例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);
}