本文整理汇总了PHP中question_attempt_step::get_qt_var方法的典型用法代码示例。如果您正苦于以下问题:PHP question_attempt_step::get_qt_var方法的具体用法?PHP question_attempt_step::get_qt_var怎么用?PHP question_attempt_step::get_qt_var使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类question_attempt_step
的用法示例。
在下文中一共展示了question_attempt_step::get_qt_var方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
$saquestions = explode(',', $step->get_qt_var('_stemorder'));
foreach ($saquestions as $questionid) {
$this->stems[$questionid] = $step->get_qt_var('_stem_' . $questionid);
$this->stemformat[$questionid] = $step->get_qt_var('_stemformat_' . $questionid);
$key = $step->get_qt_var('_right_' . $questionid);
$this->right[$questionid] = $key;
$this->choices[$key] = $step->get_qt_var('_choice_' . $key);
}
parent::apply_attempt_state($step);
}
示例2: test_set_var
public function test_set_var() {
$step = new question_attempt_step();
$step->set_qt_var('_x', 1);
$step->set_behaviour_var('_x', 2);
$this->assertEquals('1', $step->get_qt_var('_x'));
$this->assertEquals('2', $step->get_behaviour_var('_x'));
}
示例3: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
$this->stemorder = explode(',', $step->get_qt_var('_stemorder'));
$this->set_choiceorder(explode(',', $step->get_qt_var('_choiceorder')));
// Add any missing subquestions. Sometimes people edit questions after they
// have been attempted which breaks things.
foreach ($this->stemorder as $stemid) {
if (!isset($this->stems[$stemid])) {
$this->stems[$stemid] = html_writer::span(get_string('deletedsubquestion', 'qtype_match'), 'notifyproblem');
$this->stemformat[$stemid] = FORMAT_HTML;
$this->right[$stemid] = 0;
}
}
// Add any missing choices. Sometimes people edit questions after they
// have been attempted which breaks things.
foreach ($this->choiceorder as $choiceid) {
if (!isset($this->choices[$choiceid])) {
$this->choices[$choiceid] = get_string('deletedchoice', 'qtype_match');
}
}
}
示例4: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
foreach ($this->choices as $group => $choices) {
$this->set_choiceorder($group, explode(',', $step->get_qt_var('_choiceorder' . $group)));
}
}
示例5: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
$this->answers = $this->get_ordering_answers();
$this->options = $this->get_ordering_options();
$this->currentresponse = array_filter(explode(',', $step->get_qt_var('_currentresponse')));
$this->correctresponse = array_filter(explode(',', $step->get_qt_var('_correctresponse')));
}
示例6: prepare_response_for_editing
protected function prepare_response_for_editing($name, question_attempt_step $step, $context)
{
return $step->prepare_response_files_draft_itemid_with_text($name, $context->id, $step->get_qt_var($name));
}
示例7: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
list($point, $separator) = explode('$', $step->get_qt_var('_separators'));
$this->ap->set_characters($point, $separator);
}
示例8: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
$this->stemorder = explode(',', $step->get_qt_var('_stemorder'));
$this->set_choiceorder(explode(',', $step->get_qt_var('_choiceorder')));
}
示例9: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
$this->order = explode(',', $step->get_qt_var('_order'));
}
示例10: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
$this->seed = (int) $step->get_qt_var('_seed');
$this->initialise_question_from_seed();
}
示例11: response_area_input
public function response_area_input($name, question_attempt $qa, question_attempt_step $step, $lines, $context) {
$response = $step->get_qt_var($name);
$inputname = $qa->get_qt_field_name($name);
$textarea = $this->textarea($response, $lines, array('name' => $inputname));
$formattag = $this->get_format_tag($inputname);
$countarea = $this->get_count_area_input($qa, $response);
return $textarea.$formattag.$countarea;
}