Im trying to get values out of my last question_attempt_step. But even when i do $step->get_all_data() it will only return one (i think default) key-value pair instead of my values.
public function formulation_and_controls ( question_attempt $qa, question_display_options $options ) {
$step = $qa->get_last_step();
$result = $step->get_all_data();
foreach($result as $key => $value)
{
echo $key.'=>'.$value;
}
...
$inputname = $qa->get_qt_field_name ( $name );
return $this->textarea ( $step->get_qt_var ( $name ), $code, $lines, array (
'name' => $inputname
) )
...
protected function textarea ( $response, $code, $lines, $attributes ) {
$attributes['class'] = $this->class_name () . ' qtype_javaunittest_response';
$attributes['rows'] = $lines;
$attributes['cols'] = 60;
if ( empty ( $response ) ) {
return html_writer::tag ( 'textarea', s ( $code ), $attributes );
}
return html_writer::tag ( 'textarea', s ( $response ), $attributes );
}