本文整理匯總了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;
}