本文整理匯總了PHP中question_edit_form::get_per_answer_fields方法的典型用法代碼示例。如果您正苦於以下問題:PHP question_edit_form::get_per_answer_fields方法的具體用法?PHP question_edit_form::get_per_answer_fields怎麽用?PHP question_edit_form::get_per_answer_fields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類question_edit_form
的用法示例。
在下文中一共展示了question_edit_form::get_per_answer_fields方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
function get_per_answer_fields(&$mform, $label, $gradeoptions, &$repeatedoptions, &$answersoption)
{
$repeated = parent::get_per_answer_fields($mform, $label, $gradeoptions, $repeatedoptions, $answersoption);
$tolerance =& $mform->createElement('text', 'tolerance', get_string('acceptederror', 'quiz'));
$repeatedoptions['tolerance']['type'] = PARAM_NUMBER;
array_splice($repeated, 3, 0, array($tolerance));
$repeated[1]->setSize(10);
return $repeated;
}
示例2: get_per_answer_fields
protected function get_per_answer_fields($mform, $label, $gradeoptions, &$repeatedoptions, &$answersoption)
{
$repeated = parent::get_per_answer_fields($mform, $label, $gradeoptions, $repeatedoptions, $answersoption);
$tolerance = $mform->createElement('text', 'tolerance', get_string('acceptederror', 'qtype_numerical'));
$repeatedoptions['tolerance']['type'] = PARAM_FLOAT;
$repeatedoptions['tolerance']['default'] = 0;
array_splice($repeated, 3, 0, array($tolerance));
$repeated[1]->setSize(10);
return $repeated;
}
示例3: get_per_answer_fields
protected function get_per_answer_fields($mform, $label, $gradeoptions, &$repeatedoptions, &$answersoption)
{
$repeated = parent::get_per_answer_fields($mform, $label, $gradeoptions, $repeatedoptions, $answersoption);
$tolerance = $mform->createElement('text', 'tolerance', get_string('answererror', 'qtype_numerical'), array('size' => 15));
$repeatedoptions['tolerance']['type'] = PARAM_FLOAT;
$repeatedoptions['tolerance']['default'] = 0;
$elements = $repeated[0]->getElements();
$elements[0]->setSize(15);
array_splice($elements, 1, 0, array($tolerance));
$repeated[0]->setElements($elements);
return $repeated;
}
示例4: array
function get_per_answer_fields(&$mform, $label, $gradeoptions, &$repeatedoptions, &$answersoption)
{
$repeated = parent::get_per_answer_fields(&$mform, $label, $gradeoptions, $repeatedoptions, $answersoption);
$mform->setType('answer', PARAM_NOTAGS);
$addrepeated = array();
$addrepeated[] =& $mform->createElement('text', 'tolerance', get_string('tolerance', 'qtype_calculated'));
$repeatedoptions['tolerance']['type'] = PARAM_NUMBER;
$repeatedoptions['tolerance']['default'] = 0.01;
$addrepeated[] =& $mform->createElement('select', 'tolerancetype', get_string('tolerancetype', 'quiz'), $this->qtypeobj->tolerance_types());
$addrepeated[] =& $mform->createElement('select', 'correctanswerlength', get_string('correctanswershows', 'qtype_calculated'), range(0, 9));
$repeatedoptions['correctanswerlength']['default'] = 2;
$answerlengthformats = array('1' => get_string('decimalformat', 'quiz'), '2' => get_string('significantfiguresformat', 'quiz'));
$addrepeated[] =& $mform->createElement('select', 'correctanswerformat', get_string('correctanswershowsformat', 'qtype_calculated'), $answerlengthformats);
array_splice($repeated, 3, 0, $addrepeated);
$repeated[1]->setLabel(get_string('correctanswerformula', 'quiz') . '=');
return $repeated;
}