本文整理汇总了PHP中ilObjTest::getShuffleQuestions方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::getShuffleQuestions方法的具体用法?PHP ilObjTest::getShuffleQuestions怎么用?PHP ilObjTest::getShuffleQuestions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::getShuffleQuestions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchQuestionsFromStageRandomly
protected function fetchQuestionsFromStageRandomly($questionStage, $requiredQuestionAmount)
{
$randomKeys = $this->getRandomArrayKeys($questionStage, $requiredQuestionAmount);
$questionSet = array();
foreach ($randomKeys as $randomKey) {
$questionSet[] = $questionStage[$randomKey];
}
if ($this->testOBJ->getShuffleQuestions()) {
shuffle($questionSet);
}
return $questionSet;
}
示例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: buildForm
//.........这里部分代码省略.........
require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
$char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST);
$char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
$char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
$char_selector->addFormProperties($form);
$char_selector->setFormValues($form);
}
// Autosave
$autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
$autosave_output->setValue(1);
$autosave_output->setChecked($this->testOBJ->getAutosave());
$autosave_output->setInfo($this->lng->txt('autosave_info'));
$autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
$autosave_interval->setSize(10);
$autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000);
$autosave_interval->setInfo($this->lng->txt('autosave_ival_info'));
$autosave_output->addSubItem($autosave_interval);
$form->addItem($autosave_output);
if (!$this->settingsTemplate || $this->formShowSequenceSection($this->settingsTemplate->getSettings())) {
// sequence properties
$seqheader = new ilFormSectionHeaderGUI();
$seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
$form->addItem($seqheader);
}
// postpone questions
$postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone");
$postpone->setValue(1);
$postpone->setChecked($this->testOBJ->getSequenceSettings());
$postpone->setInfo($this->lng->txt("tst_postpone_description"));
$form->addItem($postpone);
// shuffle questions
$shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
$shuffle->setValue(1);
$shuffle->setChecked($this->testOBJ->getShuffleQuestions());
$shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
$form->addItem($shuffle);
// show list of questions
$list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
//$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
$list_of_questions->setValue(1);
$list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
$list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
$list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
$list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
$list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
$list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
$values = array();
if ($this->testOBJ->getListOfQuestionsStart()) {
array_push($values, 'chb_list_of_questions_start');
}
if ($this->testOBJ->getListOfQuestionsEnd()) {
array_push($values, 'chb_list_of_questions_end');
}
if ($this->testOBJ->getListOfQuestionsDescription()) {
array_push($values, 'chb_list_of_questions_with_description');
}
$list_of_questions_options->setValue($values);
$list_of_questions->addSubItem($list_of_questions_options);
$form->addItem($list_of_questions);
// show question marking
$marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
$marking->setValue(1);
$marking->setChecked($this->testOBJ->getShowMarker());
$marking->setInfo($this->lng->txt("question_marking_description"));
$form->addItem($marking);
// show suspend test
示例4: handleQuestionOrdering
protected function handleQuestionOrdering(ilTestRandomQuestionSetQuestionCollection $questionSet)
{
if ($this->testOBJ->getShuffleQuestions()) {
$questionSet->shuffleQuestions();
}
}
示例5: propertiesObject
//.........这里部分代码省略.........
$title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
$title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
$title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
$title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
$title_output->setValue($this->object->getTitleOutput());
$title_output->setInfo($this->lng->txt("tst_title_output_description"));
$form->addItem($title_output);
// Autosave
$autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
$autosave_output->setValue(1);
$autosave_output->setChecked($this->object->getAutosave());
$autosave_output->setInfo($this->lng->txt('autosave_info'));
$autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
$autosave_interval->setSize(10);
$autosave_interval->setValue($this->object->getAutosaveIval());
$autosave_interval->setInfo($this->lng->txt('autosave_ival_info'));
$autosave_output->addSubItem($autosave_interval);
$form->addItem($autosave_output);
if (!$template || $template && $this->formShowSequenceSection($template_settings)) {
// sequence properties
$seqheader = new ilFormSectionHeaderGUI();
$seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
$form->addItem($seqheader);
}
// postpone questions
$postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone");
$postpone->setValue(1);
$postpone->setChecked($this->object->getSequenceSettings());
$postpone->setInfo($this->lng->txt("tst_postpone_description"));
$form->addItem($postpone);
// shuffle questions
$shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
$shuffle->setValue(1);
$shuffle->setChecked($this->object->getShuffleQuestions());
$shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
$form->addItem($shuffle);
// show list of questions
$list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
//$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
$list_of_questions->setValue(1);
$list_of_questions->setChecked($this->object->getListOfQuestions());
$list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
$list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
$list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
$list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
$list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
$values = array();
if ($this->object->getListOfQuestionsStart()) {
array_push($values, 'chb_list_of_questions_start');
}
if ($this->object->getListOfQuestionsEnd()) {
array_push($values, 'chb_list_of_questions_end');
}
if ($this->object->getListOfQuestionsDescription()) {
array_push($values, 'chb_list_of_questions_with_description');
}
$list_of_questions_options->setValue($values);
$list_of_questions->addSubItem($list_of_questions_options);
$form->addItem($list_of_questions);
// show question marking
$marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
$marking->setValue(1);
$marking->setChecked($this->object->getShowMarker());
$marking->setInfo($this->lng->txt("question_marking_description"));
$form->addItem($marking);
// show suspend test