本文整理汇总了PHP中ilObjTest::getShowSolutionSuggested方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::getShowSolutionSuggested方法的具体用法?PHP ilObjTest::getShowSolutionSuggested怎么用?PHP ilObjTest::getShowSolutionSuggested使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::getShowSolutionSuggested方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPassDetailsOverview
protected function getPassDetailsOverview($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList = null)
{
$this->ctrl->setParameter($targetGUI, 'active_id', $active_id);
$this->ctrl->setParameter($targetGUI, 'pass', $pass);
$tableGUI = $this->buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD);
$tableGUI->setAnswerListAnchorEnabled($questionAnchorNav);
$tableGUI->setSingleAnswerScreenCmd($questionDetailsCMD);
$tableGUI->setShowHintCount($this->object->isOfferingQuestionHintsEnabled());
if ($objectivesList !== null) {
$tableGUI->setQuestionRelatedObjectivesList($objectivesList);
$tableGUI->setObjectiveOrientedPresentationEnabled(true);
}
$tableGUI->setActiveId($active_id);
$tableGUI->setPass($pass);
$tableGUI->setShowSuggestedSolution(false);
$usersQuestionSolutions = array();
foreach ($result_array as $key => $val) {
if ($key === 'test' || $key === 'pass') {
continue;
}
if ($this->object->getShowSolutionSuggested() && strlen($val['solution'])) {
$tableGUI->setShowSuggestedSolution(true);
}
if (isset($val['pass'])) {
$tableGUI->setPassColumnEnabled(true);
}
$usersQuestionSolutions[$key] = $val;
}
$tableGUI->initColumns()->initFilter();
$tableGUI->setFilterCommand($targetCMD . 'SetTableFilter');
$tableGUI->setResetCommand($targetCMD . 'ResetTableFilter');
$tableGUI->setData($usersQuestionSolutions);
return $this->ctrl->getHTML($tableGUI);
}
示例2: getPassDetailsOverview
/**
* Returns the pass details overview for a given active ID and pass
*
* @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult)
* @param integer $active_id Active ID of the active user
* @param integer $pass Test pass
* @param string $targetclass The name of the ILIAS class for the "pass details" URL (optional)
* @param string $targetcommand The name of the ILIAS command for the "pass details" URL (optional)
* @param string $targetcommanddetails The name of the ILIAS command which should be called for the details of an answer (optional)
* @param boolean $standard_header TRUE if the table headers should be plain text, FALSE if the table headers should be URL's for sortable columns
* @return string HTML code of the pass details overview
* @access public
*/
function getPassDetailsOverview($result_array, $active_id, $pass, $targetclass = "", $targetcommandsort = "", $targetcommanddetails = "", $standard_header = TRUE)
{
global $ilUser;
$testresults = $result_array["pass"];
unset($result_array["test"]);
$user_id = $this->object->_getUserIdFromActiveId($active_id);
$sort = $_GET["sort"] ? $_GET["sort"] : "nr";
$sortorder = $_GET["sortorder"] ? $_GET["sortorder"] : "asc";
if (!$standard_header) {
// change sortorder of result array
usort($result_array, "sortResults");
}
$color_class = array("tblrow1top", "tblrow2top");
$counter = 0;
$template = new ilTemplate("tpl.il_as_tst_pass_details_overview.html", TRUE, TRUE, "Modules/Test");
$this->ctrl->setParameterByClass($targetclass, "pass", "{$pass}");
if (!$testresults["total_max_points"]) {
$percentage = 0;
} else {
$percentage = $testresults["total_reached_points"] / $testresults["total_max_points"] * 100;
}
$total_max = $testresults["total_max_points"];
$total_reached = $testresults["total_reached_points"];
$totalRequestedHints = $testresults["total_requested_hints"];
$img_title_percent = "";
$img_title_nr = "";
$hasSuggestedSolutions = FALSE;
if ($this->object->getShowSolutionSuggested()) {
foreach ($result_array as $key => $value) {
if (strlen($value["solution"])) {
$hasSuggestedSolutions = TRUE;
}
}
}
foreach ($result_array as $key => $value) {
if (preg_match("/\\d+/", $key)) {
if (strlen($targetclass) && strlen($targetcommanddetails)) {
$template->setCurrentBlock("linked_title");
$template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$template->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
$this->ctrl->setParameterByClass($targetclass, "evaluation", $value["qid"]);
$this->ctrl->setParameterByClass($targetclass, "active_id", $active_id);
$template->setVariable("URL_QUESTION_TITLE", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommanddetails));
$template->parseCurrentBlock();
} else {
$template->setCurrentBlock("plain_title");
$template->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
$template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$template->parseCurrentBlock();
}
if ($hasSuggestedSolutions) {
$template->setCurrentBlock("question_suggested_solution");
$template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$template->setVariable("SOLUTION_HINT", $this->object->prepareTextareaOutput($value["solution"], true));
$template->parseCurrentBlock();
}
$template->setCurrentBlock("question");
$template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$template->setVariable("VALUE_QUESTION_COUNTER", $value["nr"]);
$template->setVariable("VALUE_MAX_POINTS", $value["max"]);
$template->setVariable("VALUE_REACHED_POINTS", $value["reached"]);
if ($this->object->isOfferingQuestionHintsEnabled()) {
$template->setVariable("VALUE_HINT_COUNT", $value["requested_hints"]);
}
$template->setVariable("VALUE_PERCENT_SOLVED", $value["percent"]);
$template->parseCurrentBlock();
$counter++;
}
}
if ($hasSuggestedSolutions) {
$template->touchBlock("footer_suggested_solution");
}
$template->setCurrentBlock("footer");
$template->setVariable("VALUE_QUESTION_COUNTER", "<strong>" . $this->lng->txt("total") . "</strong>");
$template->setVariable("VALUE_QUESTION_TITLE", "");
$template->setVariable("VALUE_MAX_POINTS", "<strong>{$total_max}</strong>");
$template->setVariable("VALUE_REACHED_POINTS", "<strong>{$total_reached}</strong>");
if ($this->object->isOfferingQuestionHintsEnabled()) {
$template->setVariable("VALUE_TOTAL_HINT_COUNT", "<strong>{$totalRequestedHints}</strong>");
}
$template->setVariable("VALUE_PERCENT_SOLVED", "<strong>" . sprintf("%2.2f", $percentage) . " %" . "</strong>");
$template->parseCurrentBlock();
if ($standard_header) {
if ($hasSuggestedSolutions) {
$template->setCurrentBlock("standard_header_suggested_solution");
$template->setVariable("SOLUTION_HINT_HEADER", $this->lng->txt("solution_hint"));
$template->parseCurrentBlock();
//.........这里部分代码省略.........
示例3: addResultDetailsSettingsFormSection
private function addResultDetailsSettingsFormSection(ilPropertyFormGUI $form)
{
// HEADER: result settings
$header_tr = new ilFormSectionHeaderGUI();
$header_tr->setTitle($this->lng->txt('tst_results_details_options'));
$form->addItem($header_tr);
// show solution details
$showSolutionDetails = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_details'), 'solution_details');
$showSolutionDetails->setInfo($this->lng->txt('tst_show_solution_details_desc'));
$showSolutionDetails->setChecked($this->testOBJ->getShowSolutionDetails());
$form->addItem($showSolutionDetails);
// best solution in test results
$results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt('tst_results_print_best_solution'), 'print_bs_with_res');
$results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info'));
$results_print_best_solution->setChecked((bool) $this->testOBJ->isBestSolutionPrintedWithResult());
$showSolutionDetails->addSubItem($results_print_best_solution);
// show solution feedback ==> solution feedback in test results
$showSolutionFeedbackOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_feedback'), 'solution_feedback');
$showSolutionFeedbackOption->setInfo($this->lng->txt('tst_show_solution_feedback_desc'));
$showSolutionFeedbackOption->setChecked($this->testOBJ->getShowSolutionFeedback());
$form->addItem($showSolutionFeedbackOption);
// show suggested solution
$showSuggestedSolutionOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_suggested'), 'solution_suggested');
$showSuggestedSolutionOption->setInfo($this->lng->txt('tst_show_solution_suggested_desc'));
$showSuggestedSolutionOption->setChecked($this->testOBJ->getShowSolutionSuggested());
$form->addItem($showSuggestedSolutionOption);
// show solution printview ==> list of answers
$showSolutionPrintview = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_printview'), 'solution_printview');
$showSolutionPrintview->setInfo($this->lng->txt('tst_show_solution_printview_desc'));
$showSolutionPrintview->setChecked($this->testOBJ->getShowSolutionPrintview());
$form->addItem($showSolutionPrintview);
// show best solution in list of answers
$solutionCompareInput = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_compare'), 'solution_compare');
$solutionCompareInput->setChecked($this->testOBJ->getShowSolutionListComparison());
$showSolutionPrintview->addSubItem($solutionCompareInput);
// solution answers only ==> printview of results (answers only)
$solutionAnswersOnly = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_answers_only'), 'solution_answers_only');
$solutionAnswersOnly->setInfo($this->lng->txt('tst_show_solution_answers_only_desc'));
$solutionAnswersOnly->setChecked($this->testOBJ->getShowSolutionAnswersOnly());
$showSolutionPrintview->addSubItem($solutionAnswersOnly);
// high score
$highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled");
$highscore->setValue(1);
$highscore->setChecked($this->testOBJ->getHighscoreEnabled());
$highscore->setInfo($this->lng->txt("tst_highscore_description"));
$form->addItem($highscore);
$highscore_tables = new ilRadioGroupInputGUI($this->lng->txt('tst_highscore_mode'), 'highscore_mode');
$highscore_tables->setRequired(true);
$highscore_tables->setValue($this->testOBJ->getHighscoreMode());
$highscore_table_own = new ilRadioOption($this->lng->txt('tst_highscore_own_table'), ilObjTest::HIGHSCORE_SHOW_OWN_TABLE);
$highscore_table_own->setInfo($this->lng->txt('tst_highscore_own_table_description'));
$highscore_tables->addOption($highscore_table_own);
$highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_top_table'), ilObjTest::HIGHSCORE_SHOW_TOP_TABLE);
$highscore_table_other->setInfo($this->lng->txt('tst_highscore_top_table_description'));
$highscore_tables->addOption($highscore_table_other);
$highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_all_tables'), ilObjTest::HIGHSCORE_SHOW_ALL_TABLES);
$highscore_table_other->setInfo($this->lng->txt('tst_highscore_all_tables_description'));
$highscore_tables->addOption($highscore_table_other);
$highscore->addSubItem($highscore_tables);
$highscore_top_num = new ilNumberInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
$highscore_top_num->setSize(4);
$highscore_top_num->setRequired(true);
$highscore_top_num->setMinValue(1);
$highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
$highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum(null));
$highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
$highscore->addSubItem($highscore_top_num);
$highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon");
$highscore_anon->setValue(1);
$highscore_anon->setChecked($this->testOBJ->getHighscoreAnon());
$highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description"));
$highscore->addSubItem($highscore_anon);
$highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts");
$highscore_achieved_ts->setValue(1);
$highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS());
$highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description"));
$highscore->addSubItem($highscore_achieved_ts);
$highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score");
$highscore_score->setValue(1);
$highscore_score->setChecked($this->testOBJ->getHighscoreScore());
$highscore_score->setInfo($this->lng->txt("tst_highscore_score_description"));
$highscore->addSubItem($highscore_score);
$highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage");
$highscore_percentage->setValue(1);
$highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage());
$highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description"));
$highscore->addSubItem($highscore_percentage);
$highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints");
$highscore_hints->setValue(1);
$highscore_hints->setChecked($this->testOBJ->getHighscoreHints());
$highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description"));
$highscore->addSubItem($highscore_hints);
$highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime");
$highscore_wtime->setValue(1);
$highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime());
$highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description"));
$highscore->addSubItem($highscore_wtime);
// show signature placeholder
$showSignaturePlaceholder = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_signature'), 'solution_signature');
$showSignaturePlaceholder->setInfo($this->lng->txt('tst_show_solution_signature_desc'));
//.........这里部分代码省略.........
示例4: scoringObject
//.........这里部分代码省略.........
$results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_always"), 2, ''));
$results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_finished"), 1, ''));
$results_access_date_limitation = new ilRadioOption($this->lng->txt("tst_results_access_date"), 3, '');
$results_access->addOption($results_access_date_limitation);
$results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_never"), 4, ''));
$results_access->setValue($this->object->getScoreReporting());
$results_access->setInfo($this->lng->txt("tst_results_access_description"));
// access date
$reporting_date = new ilDateTimeInputGUI('', 'reporting_date');
$reporting_date->setShowDate(true);
$reporting_date->setShowTime(true);
if (strlen($this->object->getReportingDate())) {
$reporting_date->setDate(new ilDateTime($this->object->getReportingDate(), IL_CAL_TIMESTAMP));
} else {
$reporting_date->setDate(new ilDateTime(time(), IL_CAL_UNIX));
}
$results_access_date_limitation->addSubItem($reporting_date);
$form->addItem($results_access);
$results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt("tst_results_print_best_solution"), "print_bs_with_res");
$results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info'));
$results_print_best_solution->setValue(1);
$results_print_best_solution->setChecked((bool) $this->object->isBestSolutionPrintedWithResult());
$form->addItem($results_print_best_solution);
// results presentation
$results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt("tst_results_presentation"), "results_presentation");
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_pass_details"), 'pass_details', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_details"), 'solution_details', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_printview"), 'solution_printview', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_feedback"), 'solution_feedback', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_answers_only"), 'solution_answers_only', ''));
$signatureOption = new ilCheckboxOption($this->lng->txt("tst_show_solution_signature"), 'solution_signature', '');
$results_presentation->addOption($signatureOption);
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_suggested"), 'solution_suggested', ''));
$values = array();
if ($this->object->getShowPassDetails()) {
array_push($values, 'pass_details');
}
if ($this->object->getShowSolutionDetails()) {
array_push($values, 'solution_details');
}
if ($this->object->getShowSolutionPrintview()) {
array_push($values, 'solution_printview');
}
if ($this->object->getShowSolutionFeedback()) {
array_push($values, 'solution_feedback');
}
if ($this->object->getShowSolutionAnswersOnly()) {
array_push($values, 'solution_answers_only');
}
if ($this->object->getShowSolutionSignature()) {
array_push($values, 'solution_signature');
}
if ($this->object->getShowSolutionSuggested()) {
array_push($values, 'solution_suggested');
}
$results_presentation->setValue($values);
$results_presentation->setInfo($this->lng->txt("tst_results_presentation_description"));
if ($this->object->getAnonymity()) {
$signatureOption->setDisabled(true);
}
$form->addItem($results_presentation);
// deletion of test results
$passDeletion = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_deletion"), "pass_deletion_allowed");
$passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_not_allowed"), 0, ''));
$passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_allowed"), 1, ''));
$passDeletion->setValue($this->object->isPassDeletionAllowed());
$form->addItem($passDeletion);
// export settings
$export_settings = new ilCheckboxGroupInputGUI($this->lng->txt("tst_export_settings"), "export_settings");
$export_settings->addOption(new ilCheckboxOption($this->lng->txt("tst_exp_sc_short"), 'exp_sc_short', ''));
$values = array();
if ($this->object->getExportSettingsSingleChoiceShort()) {
array_push($values, 'exp_sc_short');
}
$export_settings->setValue($values);
$form->addItem($export_settings);
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
$form->addCommandButton("saveScoring", $this->lng->txt("save"));
}
// remove items when using template
if ($template_settings) {
foreach ($template_settings as $id => $item) {
if ($item["hide"]) {
$form->removeItemByPostVar($id);
}
}
}
$errors = false;
if ($save) {
$errors = !$form->checkInput();
$form->setValuesByPost();
if ($errors) {
$checkonly = false;
}
}
if (!$checkonly) {
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}
return $errors;
}