本文整理汇总了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;
}